Download file from flashka.j-net.ru

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#!/usr/bin/perl
$|++;
use LWP 5.64;
$browser = LWP::UserAgent->new;
push @{$browser->requests_redirectable}, 'GET';
push @{$browser->requests_redirectable}, 'POST';
$urls=shift || "urls.txt";
$account_name = 'ltviies157';
$password = 'ltviies157';
open(URLS,$urls) || die "Usage: $0 <urlsfile>\n";
chomp(@urls=<URLS>);
close(URLS);
print("Loading url's from file \"$urls\"...\n");
foreach (@urls) {
$_=~/^! (.*) (.*)/;
if ($1 && $2) {
print("Found new account information, applying...\n");
$account_name = $1;
$password = $2;
next;
}
$_=~/http\:\/\/flashka\.j\-net\.ru\/get\.php\?cid\=\d+\&crc\=.*/;
if (!$&) {
print("\"$_\" is not like to be an url! Ignoring...\n");
next;
}
$url = 'http://flashka.j-net.ru/';
@ns_headers = (
'Host' => 'flashka.j-net.ru',
'User-Agent' => 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1) Gecko/20060601 Firefox/2.0 (Ubuntu-edgy)',
'Accept' => 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5',
'Accept-Charset' => 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
'Accept-Language' => 'ru,en;q=0.5',
'Connection' => 'keep-alive',
'Keep-Alive' => '300',
);
print("Getting main page...\n");
$response = $browser->get($url, @ns_headers);
die "Can't get $url -- ", $response->status_line
unless $response->is_success;
die "Hey, I was expecting HTML, not ", $response->content_type
unless $response->content_type eq 'text/html';
print("Serching identification data...\n");
foreach $str($response->content)
{
$str=~/d[\'] value[\=][\'](.*)[\']/;
$fcid=$1;
}
foreach $str($response->content)
{
$str=~/y[\'] value[\=][\'](.*)[\']/;
$fkey=$1;
}
foreach $str($response->content)
{
$str=~/D[\"] value[\=][\"](.*)[\"]/;
$phpsessid=$1;
}
print("Trying login in...\n");
$response = $browser->post($url,
[
PHPSESSID => $phpsessid,
account_name => $account_name,
password => $password,
fcid => $fcid,
fkey => $fkey,
], @ns_headers
);
die "Can't get $url -- ", $response->status_line
unless $response->is_success;
die "Hey, I was expecting HTML, not ", $response->content_type
unless $response->content_type eq 'text/html';
print("Serching identification data...\n");
foreach $str($response->content)
{
$str=~/D[\"] value[\=][\"](.*)[\"]/;
$phpsessid=$1;
}
#http://flashka.j-net.ru/get.php?cid=53115&crc=9893da040518a9cf
@ns_headers2 = (
'Host' => $account_name.'.flashka.j-net.ru',
'User-Agent' => 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1) Gecko/20060601 Firefox/2.0 (Ubuntu-edgy)',
'Accept' => 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5',
'Accept-Charset' => 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
'Accept-Language' => 'ru,en;q=0.5',
'Connection' => 'keep-alive',
'Keep-Alive' => '300',
'Referer' => 'http://'.$account_name.'.flashka.j-net.ru/files/?PHPSESSID='.$phpsessid,
);
$count++;
print("Starting download...\n");
`wget --server-response -c --content-disposition "$&&PHPSESSID=$phpsessid"`;
print("Login out...\n");
$url="http://flashka.j-net.ru/?logout";
$response = $browser->get($url, @ns_headers2);
}
exit print "Done $count files\n";