Page MenuHomePhabricator

Add commonsMedia datatype to harvest_template.py
Closed, ResolvedPublic

Description

As pointed out in https://www.wikidata.org/wiki/User:Underlying_lk/sandbox#commonsMedia_support_in_harvest_template , it should be relatively easy to add image support.

elif claim.getType() == 'commonsMedia':

mediasite = pywikibot.Site("commons", "commons")
image = pywikibot.ImagePage(mediasite, value)
claim.setTarget(image)

Instead of using ImagePage I think Link() should be used.


Version: core-(2.0)
Severity: normal

Details

Reference
bz62008

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:01 AM
bzimport set Reference to bz62008.

Change 127478 had a related patch set uploaded by Multichill:
(bug 62008) Added support for images

https://gerrit.wikimedia.org/r/127478

Change 127478 merged by jenkins-bot:
(bug 62008) Added support for images Now with checking for redirect and if the image actually exists

https://gerrit.wikimedia.org/r/127478

Implemented. Added a bit more checking:

  • Uses Link instead of Page directly
  • Checks if the imagepage is a redirect
  • Checks if the image actually exists