Page MenuHomePhabricator

Flickrripper: support flickrapi 2.x
Closed, ResolvedPublic

Description

Currently flickrripper.py only works on Python 2.

flickrripper.py currently only supports flickrapi 1.4.x and not the new flickrapi 2.x
And flickrapi 1.4.x does not support Python 3.

Trying to run flickrripper on Python 3 results in:

\pywikibot\core>pwb.py scripts\flickrripper.py
Traceback (most recent call last):
  File "\pywikibot\core\pwb.py", line 239,in <module>
    if not main():
  File "\pywikibot\core\pwb.py", line 233,in main
    run_python_file(filename, argv, argvu, file_package)
  File "\pywikibot\core\pwb.py", line 88, in run_python_file
    main_mod.__dict__)
  File ".\scripts\flickrripper.py", line 539, in <module>
    main()
  File ".\scripts\flickrripper.py", line 427, in main
    (token, frob) = flickr.get_token_part_one(perms='read')
  File "\Python34\lib\site-packages\flickrapi\call_builder.py", line 37, in __call__
    return self.flickrapi_object.do_flickr_call(self.method_name, **kwargs)
  File "\Python34\lib\site-packages\flickrapi\core.py", line 319, in do_flickr_call
    **params)
  File "\Python34\lib\site-packages\flickrapi\core.py", line 389, in _wrap_in_parser
    return parser(self, data)
  File "\Python34\lib\site-packages\flickrapi\core.py", line 280, in parse_etree
    raise FlickrError(six.u('Error: %(code)s: %(msg)s') % err.attrib, code=code)
 
flickrapi.exceptions.FlickrError: Error: 112: Method "flickr.get.token.part.one"
 not found
<class 'flickrapi.exceptions.FlickrError'>
CRITICAL: Waiting for 1 network thread(s) to finish. Press ctrl-c to abort

Event Timeline

valhallasw raised the priority of this task from to Needs Triage.
valhallasw updated the task description. (Show Details)
valhallasw added a project: Pywikibot.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptJun 17 2015, 7:30 PM
XXN added a subscriber: XXN.Aug 23 2015, 1:13 AM
jayvdb moved this task from Backlog to Harvesting on the Pywikibot-Commons board.
jayvdb added a subscriber: jayvdb.
Restricted Application added a subscriber: Avicennasis. · View Herald TranscriptOct 7 2015, 10:13 PM

flickrripper 2.0 uses OAuth. The change is documented on http://stuvel.eu/media/flickrapi-docs/documentation/1-intro.html#from-1-x-to-2-0

It should be possible to setup flickrripper using OAuth. In my case the quick fix was to fetch and use flickrripper 1.0 from https://bitbucket.org/sybren/flickrapi/

However, one day flickr will stop supporting the old API…

jayvdb renamed this task from Flickrripper: Error: 112: Method "flickr.get.token.part.one" not found to Flickrripper: support flickrapi 2.x.Oct 8 2015, 8:08 AM
jayvdb triaged this task as Normal priority.
jayvdb updated the task description. (Show Details)
jayvdb set Security to None.
jayvdb raised the priority of this task from Normal to High.EditedOct 8 2015, 8:16 AM

We need to support flickrapi 2.x for its Python 3 support. Currently we are only using flickrapi 1.4 for Python 2.6 (T107830).

setup.py and requirements.txt currently do not specify a desired version of flickrapi, but that is an implicit endorsement of flickrapi 2.0. A quick fix would be to specify 1.4.x for Python 2.7 to reduce the impact of this bug. Until that is done, this script has effectively regressed quite significantly, as it doesn't work with the version which setup.py/pip will install by default.

The old get_token_part_one method has been removed from flickrapi 2.x

Here is the old 1.x method
https://bitbucket.org/sybren/flickrapi/src/9e7a28e6da6431e632ea2b1c8d6055b0b2e6cb71/flickrapi/__init__.py?at=branch-1.4&fileviewer=file-view-default#__init__.py-663

In 2.0, it looks like the equivalent is get_token

https://bitbucket.org/sybren/flickrapi/src/af963fbe4efa7395fea668b43ade4459c3327f66/flickrapi/core.py?at=default&fileviewer=file-view-default#core.py-525

And if get_token fails, a authenticate_console method can be used

https://bitbucket.org/sybren/flickrapi/src/af963fbe4efa7395fea668b43ade4459c3327f66/flickrapi/core.py?at=default&fileviewer=file-view-default#core.py-562

jayvdb added a comment.Oct 8 2015, 9:17 AM

An observation was made that maybe this script isnt so critical now that Commons UploadWizard has Flickr support. It supports streams, showing all photos in the stream, and allowing users to "select up to 50 files to upload."

We have batch uploading where 50 is a significant limitation. I didnt see any task intending to increase that limit on T45450: UploadWizard Flickr (tracking).

I also found two tools which could be used.
http://tools.wmflabs.org/flickr2commons/
http://tools.wmflabs.org/magnustools/flickrfree.php

@jayvdb to clarify on your earlier comments - Is this Phab task required now ?
If not, we could close this.
If it's still needed, I'll begin work on it.

Josve05a added subscribers: Zppix, Josve05a.

I need a tool or a script to help my batch uploading, when the above tools can not help out (too many image in the same stream fo those tools)...

I need a tool or a script to help my batch uploading, when the above tools can not help out (too many image in the same stream fo those tools)...

Could you confirm that all three tools (UploadWizard ,flickr2commons & flickrfree) have limit problems?
Has a task been raised about increasing the limit, at least with UploadWizard?

Josve05a added a comment.EditedMay 16 2016, 5:12 AM

UW only llows 50, but will soon be rased to 50, or 5000 images. (I have a feed of 17000 image I want to upload)
F2C crashes the browser, after the memory is all "gone". 5-8000 images.
Flickrfree is just a ay to find flickr images, and then uses F2C to upload them.

jayvdb updated the task description. (Show Details)May 16 2016, 5:15 AM

Would it be a good idea to ask UploadWizard to allow some users permission to upload in bulk, similar to how users need to get permission to run a bot ?

Possibly they could use the same bot account to allot permission ?

This task looks resolved, I can't find the problematic get_token_part_one in the script, no ?

matmarex removed a subscriber: matmarex.Dec 11 2017, 5:17 PM
revi added a subscriber: revi.Dec 16 2017, 11:19 AM
Xqt closed this task as Resolved.Thu, Jun 20, 1:11 PM
Xqt claimed this task.
Xqt added a subscriber: Xqt.

This task looks resolved, I can't find the problematic get_token_part_one in the script, no ?