Talk:Uploadmultiple.py
hopefully[edit]
Hopefully some people find this script useful. I made it because I needed an easy way to upload lots of images to one of my wikis. -Jonathan Kovaciny 21:53, 8 June 2007 (UTC)
- I'm happy to say I've already found this quite useful! :) Blckdmnd99 05:03, 15 June 2007 (UTC)
Bug when uploading files with ' in the file name[edit]
When uploading files with apostrophes in the file name, it cuts off everything before the last apostrophe and uploads under the wrong name. For example, it uploaded a file named Bigleaf_Hydrangea_Hydrangea_macrophylla_'Tokyo_Delight'_Pink_3008px.jpg as "'_Pink_3008px.jpg". —Zachary talk 05:43, 3 February 2008 (UTC)
Error when using this...[edit]
Getting an error when I attempt to run this:
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 0-1: unexpected end of data
The command I'm using is:
uploadmultiple.py -file:"Icon List.txt" -nodesc
Anyone know what's up? --DragoonWraith 17:04, 1 November 2008 (UTC)
- Further tests have this error popping up no matter what I do - even if I use uploadmultiple -help! DragoonWraith 01:36, 2 November 2008 (UTC)
- See below. Adamtheclown 11:12, 19 November 2010 (UTC)
unicode error[edit]
C:\Users\t\Desktop\pywikipedia>Uploadmultiple.py File "C:\Users\t\Desktop\pywikipedia\Uploadmultiple.py", line 78 'pt': u'Upload τπo automßtica' SyntaxError: (unicode error) 'utf8' codec can't decode byte 0xe7 in position 0: unexpected end of data
I fixed the error:
SyntaxError: (unicode error) 'utf8' codec can't decode byte 0xe7 in position 0:
By deleting all of the foreign language lines.
Adamtheclown 11:35, 19 November 2010 (UTC)
ImportError: No module named mediawiki_messages[edit]
Upload.py works for me, this script does not work though.
I was attempting to upload two images and got this error:
C:\Users\t\Desktop\pywikipedia>Uploadmultiple.py unicode test: triggers problem #3081100 Traceback (most recent call last): File "C:\Users\t\Desktop\pywikipedia\Uploadmultiple.py", line 62, in <module> import wikipedia, config, mediawiki_messages ImportError: No module named mediawiki_messages
pywikipedia.py/mediawiki_messages.py "Allows access to the MediaWiki messages, that's the label texts of the MediaWiki software in the current language"
- Deleting mediawiki_messages reference
I deleted the two references to mediawiki_messages, but I also had to remove a good portion of the error message coding too. The script now runs smoothly:
Text showing the bot running smoothly but no images uploaded |
---|
C:\Users\t\Desktop\pywikipedia>Uploadmultiple.py unicode test: triggers problem #3081100 Available arguments: -debug Switch to debug mode. Files are not actually uploaded. -file:xxx Specify the file which contains the list of filenames to
-nodesc Do not ask for a description for each file. -rename Prompt for a new filename for each file in the filelist.
Enter a brief description for this file and press Enter. Wikitext is acceptable. Leave blank if no description is desired. To use the external editor, type "edit" and press Enter. To skip uploading this file, type "skip" and press Enter. To abort all uploads, type "quit" and press Enter. Description: l Uploading file to dead:en Password for user anno1404 on dead:en: Logging in to dead:en as anno1404 via API. Should be logged in now
Enter a brief description for this file and press Enter. Wikitext is acceptable. Leave blank if no description is desired. To use the external editor, type "edit" and press Enter. To skip uploading this file, type "skip" and press Enter. To abort all uploads, type "quit" and press Enter. Description: p Uploading file to dead:en DONE. |
But nothing actually happens on my wiki. no images are actually uploaded.
This Uploadmultiple.py script says :
- This script is a combination of pagefromfile.py and upload.py by Andre Engles (2004).
Neither of these scripts (pagefromfile.py and upload.py) have the code mediawiki_messages in them.
Differences between lines:
- Uploadmultiple:
- import wikipedia, config, mediawiki_messages
Upload.py: (line 32-33)
- import wikipedia as pywikibot
- import config, query
Pagefromfile.py: (line 53-54)
- import wikipedia as pywikibot
- import config
Adamtheclown 17:30, 20 November 2010 (UTC)
moved mediawiki_messages.py error with mediawiki_msg[edit]
mediawiki_messages.py is in the pywikipedia/archive folder.
I suspect that it was once in the root pywikipedia/ folder, but was then moved. I moved:
- pywikipedia/archive/mediawiki_messages.py
to the root folder
- /pywikipedia.
Then received this error message:
ERROR: MediaWiki_Msg caused error Error URL |
---|
C:\Users\t\Desktop\pywikipedia>Uploadmultiple.py unicode test: triggers problem #3081100 Available arguments: -debug Switch to debug mode. Files are not actually uploaded. -file:xxx Specify the file which contains the list of filenames to be uploaded. "uploadlist.txt" is default. -nodesc Do not ask for a description for each file. -rename Prompt for a new filename for each file in the filelist. -------------------------------------------------------------------- C:\Users\t\Desktop\Deadrising2_2010-10-04_12-05-55-57.jpg Enter a brief description for this file and press Enter. Wikitext is acceptable. Leave blank if no description is desired. To use the external editor, type "edit" and press Enter. To skip uploading this file, type "skip" and press Enter. To abort all uploads, type "quit" and press Enter. Description: t Uploading file to dead:en Retrieving MediaWiki messages for dead:en Parsing MediaWiki messages ERROR: MediaWiki_Msg caused error Error URL: /w//index.php?title=Special:Allmess ages&ot=html&useskin=monobook. Dump MediaWiki_Msg_dead_en__Sat_Nov_20_12-39-11_2 010.dump created. C:\Users\t\Desktop\pywikipedia> |
Adamtheclown 17:45, 20 November 2010 (UTC)
Solution for ImportError: No module named mediawiki_messages[edit]
If you don't want to move around things in the bot installation directory, you can in Uploadmultiple.py replace the line
import wikipedia, config, mediawiki_messages
with
import wikipedia, config import archive.mediawiki_messages as mediawiki_messages
Then add an empty file called __init__.py (exactly like this!) to the archive/ directory (e.g. using Unix touch) and the import will be able to find mediawiki_messages.py in there.
--83.253.3.236 17:41, 7 February 2011 (UTC)
ASCII error[edit]
C:\Users\Eigenaar\Documents\Mark\Wikia\Afbeeldingen\TERA Wiki\Screenshots\ Screenshot_ (1).jpg Uploading file to tera:en 'ascii' codec can't decode byte 0xff in position 546: ordinal not in range(128) WARNING: Could not open 'http://tera.wikia.com/index.php?title=Special:Upload&us eskin=monobook'. Maybe the server or your connection is down. Retrying in 1 minutes...
I'm getting that error when trying to run this script. I've applied all of the fixes above. Does anybody have any idea how to fix this? 213.93.184.183 15:39, 19 May 2011 (UTC)
I have the same problem --Ivesklein 01:24, 5 January 2012 (UTC)
C:\scripts\img\adrian-solar-lozier.jpg Uploading file to FeUAI:es 'utf8' codec can't decode byte 0xff in position 550: invalid start byte WARNING: Could not open 'http://www.boxmedia.cl/~feuai/wiki/index.php?title=Espe cial:Upload&useskin=monobook'. Maybe the server or your connection is down. Retrying in 1 minutes...
- Short answer: Install Python 2.6.5
- Long answer: upload.py doesn't work with Python 2.7.2 (ascii codec error), and Python 2.6.6+ and 2.7.0 fail at unicode test: triggers problem #3081100
- Well... I didn't test 2.7.1... --79.147.182.17 01:13, 14 February 2012 (UTC)