还原迅雷的url
迅雷的url很恶心,硬是把你绑死在它的流氓软件上,今天试了一个用base64解码,果然用这个伎俩来欺骗用户。在原始的url前面和后面各加两个字符,然后用base64编码。写了下面一段script来还原出原始的url,这样随便用那个下载工具都可以用了。
#!/usr/bin/perl -w
use strict;
use MIME::Base64;
my $thunder_url = shift;
my $encode_url;
## remove 'thunder://'
if ($thunder_url =~ /^thunder:\/\/(\w+)$/) {
$encode_url = $1;
}else {
die " Not a valid input!!\n" ;
}
my $decoded = decode_base64($encode_url) ;
## remove the first and last two characters.
$decoded =~ s/^\w{2}// ;
$decoded =~ s/\w{2}$// ;
print "$decoded\n";
$ perl decode_thunder_url.pl
thunder://QUFmdHA6Ly8xMTYuNTIuMTEuOTE6OTUyNy96aC1oYW5zX3dpbmRvd3
NfdmlzdGFfd2l0aF9zZXJ2aWNlX3BhY2tfMV94NjRfZHZkX3gxNC0zMDczMy5pc29aWg $
ftp://116.52.11.91:9527/zh-hans_windows_vista_with_service_pack_1_x64_dvd_x14-30733.iso