cesapun has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to write a perl script that upload torrent to a site.Script doesn't return any error,but torrent isn't uploaded.
Please,what i'm doing wrong?
#!/usr/bin/perl use strict; use warnings; my $username = "test"; my $password = "lol"; use WWW::Mechanize; my $name = $ARGV[0]; #%N - Title of torrent my $descr= "none"; foreach(glob "*.torrent"){ use_contents($_); } sub use_contents{ my $filename = shift; my $torrent_file = $filename; my $mech = WWW::Mechanize->new( autocheck => 1); #Initializes WWW::Mec +hanize $mech->get("http://localhost/TB_ALPHA/login.php"); #Retrieves The Logi +n Page print "Logging Into ES, Please Wait.\n"; #Alerts The User $mech->submit_form( #Logs Us Into BTN form_number => 0, fields => { username => "$username", password => "$password", } ); $mech->get("http://localhost/TB_ALPHA/upload.php"); sleep 2; warn "wait"; $mech->field('file', $torrent_file); #input torrent file warn "wait $torrent_file"; $mech->field('name', $name); #file name warn "wait $name"; $mech->field('descr', $descr); #description warn "wait $descr"; $mech->value(3); #category warn "wait"; $mech->click_button(value => "Do it!"); #Clicks do it warn "wait"; }
Thanks in advance
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Semi-up script doesn't work
by blue_cowdawg (Monsignor) on Sep 09, 2011 at 17:04 UTC | |
Re: Script doesn't return any error,but torrent isn't uploaded.
by Corion (Patriarch) on Sep 09, 2011 at 17:12 UTC | |
A reply falls below the community's threshold of quality. You may see it by logging in. |
Back to
Seekers of Perl Wisdom