Code Monkey home page Code Monkey logo

commonsdownloader's Issues

Download fails for file "C'est là le moulin?.JPG"

Log is:

INFO:root:Downloading C'est_l+á_le_moulin?.JPG with width 99999
INFO:root:Requested width is bigger than source - downloading full size
Traceback (most recent call last):
  File "C:\Python27\Scripts\download_from_Wikimedia_Commons-script.py", line 9, in <module>
    load_entry_point('CommonsDownloader==0.2', 'console_scripts', 'download_from_Wikimedia_Commons')()
  File "build\bdist.win32\egg\commonsdownloader\commonsdownloader.py", line 85, in main
  File "build\bdist.win32\egg\commonsdownloader\commonsdownloader.py", line 27, in download_from_file_list
  File "build\bdist.win32\egg\commonsdownloader\thumbnaildownload.py", line 122, in download_file
IOError: [Errno 22] invalid mode ('wb') or filename: ".\\Pictures\\C'est_l\xc3\xa0_le_moulin?.jpg"

Running @symac's patched version with Python 2.7.8 in PowerShell in Windows 8.1 Pro N. Issue seems to be caused by NTFS / Windows not supporting "?" in filenames.

Default width when value is too large

When I specify a width for a file that is larger than the file width I want CommonsDownloader to get the largest thumb possible for this file instead of getting an error.

UTF-8 file names decoding/encoding issue

With @symac's patched CommonsDownloader version of October 1st (see mail discussions), resulting file names on the filesystem are not properly encoded : two bytes UTF-8 chars (like é), that are properly encoded in the file list (Abbaye Saint-Pierre de Marcilhac-sur-Célé - Eglise.JPG,99999, get translated to two one byte chars, like in Abbaye_Saint-Pierre_de_Marcilhac-sur-Célé_-_Eglise. On the console, output is misencoded too, but not in the same way : Downloading Abbaye_Saint-Pierre_de_Marcilhac-sur-C├®l├®_-_Eglise.JPG.

Running with Python 2.7.8 in PowerShell under Windows 8.1 Pro N.

CommonsDownloader should not use thumb.php

According to @dschwen, using thumb.php « is evil for lack of caching ».

CommonsDownloader should not rely on it to get thumbs, but rather use Special:FilePath

Either:

  • https://commons.wikimedia.org/w/index.php?title=Special:FilePath&file=Example.jpg&width=100px
  • https://commons.wikimedia.org/wiki/Special:FilePath/Example.jpg?width=100

Alter logging to by default display INFO messages

As a user, I want to have some feedback on CommonsDownloader progress.

Right now, CommonsDownloader does not display any information message. We probably want to display by default INFO-level messages, with an option to mute them.

SyntaxError: invalid syntax in downloading from Category

I used pip to install CommonsDownloader and I'm using python 3.6 on Ubuntu. 18.04 When I run this command:

download_from_Wikimedia_Commons --category Giovanni_Battista_Moroni --output ~/path
I get the following error:

 File "/home/user/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2456, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/local/lib/python3.6/dist-packages/commonsdownloader/commonsdownloader.py", line 104
    except DownloadException, e:
                            ^
SyntaxError: invalid syntax

Is it something I'm doing wrong?
Thanks in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.