folg / slimrat

Automatically exported from code.google.com/p/slimrat
MIT License
0 stars 0 forks source link

depositfiles.com non-US URLs can't extract filename #166

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Download a file with a non-US url, e.g. http://www.depositfiles.com/de/ID 
instead of http://www.depositfiles.com/en/ID.

DepositFiles.pm expects an English page. It tries to fix this with a cookie, 
but the cookie it sets is overridden by the /de/ in the URL. 

Fix: cut the country code from URLs, e.g.

DepositFiles.pm:
    $self->{URL} = $_[2];
+++$self->{URL} =~ s|depositfiles.com/../|depositfiles.com/|g;

With the cookie set, the URL without the country code will be rewritten as /en/ 
and then the scraping will work.

Original issue reported on code.google.com by hugo.mal...@gmail.com on 19 Oct 2010 at 3:48