Manual talk:Pywikibot/imagetransfer.py

Transfer means
When imagetransfer.py is used, does it relay the file being transferred via a download to the user and then reupload; or does it take it direct from one wiki to another? I am looking to move large djvu files from Commons to Wikisource, and having them download and upload is just going to slow the process significantly. Thanks. billinghurst  sDrewth  12:41, 4 August 2010 (UTC)

error
Error message:
 * pywikibot.exceptions.NoPage: (dead:en, u' en:Http://dead.wikia.com/wiki/Paradise Plaza ', 'Page does not exist. In rare cases, if you are certain the page does exist, look into overriding family.RversionTab')

(I modified the actual url)

pywikipedia\family.py has the following:

def RversionTab(self, code): """Change this to some regular expression that shows the page we       found is an existing page, in case the normal regexp does not work.""" return None

So how do I change this?

Adamtheclown 10:54, 19 November 2010 (UTC)
 * I changed it to:
 * return True
 * And I still get the same error message. Adamtheclown 11:01, 19 November 2010 (UTC)

"b/bc/Wiki.png"
Okay so I'm currently on the third step trying to get the direct file download links (which is what I'm assuming it's supposed to be fetching). The problem is, it seems like no matter what I put in I keep getting "b/bc/Wiki.png" for every image. (Also the first couple times I let it go through and it seemed to stop at image 417, but there are just above 700 images).

Here's the code I have right now to make it clearer (I'm not going to put in every file name so I'll cut that part out). use strict; use warnings; use LWP::Simple; use LWP::UserAgent; use HTTP::Request; use HTTP::Response;

my @myFileName=(''); $myFileName[0]="Kniro-Lippies V.6 Concept.JPG"; $myFileName[1]="Kniro concept thing.png"; $myFileName[2]="Kniro og.png"; ... $myFileName[700]="Theta&#39;s redesign.jpg"; $myFileName[701]="THETA..jpg"; $myFileName[702]="Lippies Book 8 Page 10.jpg"; my $agentName="User:Nyro_the_Leopard (http://lippies.shoutwiki.com/wiki/User:Nyro_the_Leopard) grabbing some data using ExtractImages.pl"; my $browser = LWP::UserAgent->new; $browser->timeout(500); my $string='crappyfartsgohome/images/'; my $endString='"'; my $position=0; my $endPosition=0; my $prefix=''; my $delimiter="\n"; my $reject1='OKAY_I_SERIOUSLY_CANNOT.png);'; my $reject2='Yum yum.jpg'; my $newArrayIndex=0;
 * 1) my $prefix='http://vignette.wikia.nocookie.net/crappyfartsgohome/images/;

for (my $count=0; $count<=417; $count++){ my $url="http://crappyfartsgohome.wikia.com/wiki/File:".$myFileName[$count]; my $request = HTTP::Request->new(GET => $url); my $response = $browser->request($request); if ($response->is_error) {printf "%s\n", $response->status_line;} my $contents = $response->content; $position=index($contents,$string,0)+length($string); $endPosition=index($contents,$endString,$position); my $fileName=substr($contents,$position,$endPosition-$position); if ($position!=-1 && $fileName ne $reject1 && $fileName ne $reject2){ #print $prefix.$fileName.$delimiter; print '$myFileName['.$newArrayIndex.']="'.$fileName.'";'.$delimiter; $newArrayIndex++; } }

for the "my string" part I did have it at just "images/" but I changed it wondering if it would fix it, but it didn't.

I don't really know how to make it actually get the files, so if someone can help me, it would be much appreciated.

(Also for the reject things, I didn't really know what to put there so I just uploaded two stupid images to the wiki I'm taking the images from and put their names in. Maybe that's what's making it not work?)

Nyro Fletcher (talk) 15:13, 6 April 2016 (UTC)