https://bugzilla.wikimedia.org/show_bug.cgi?id=62008
Bug ID: 62008 Summary: Add commonsMedia to harvest_template Product: Pywikibot Version: core (2.0) Hardware: All OS: All Status: NEW Severity: normal Priority: Unprioritized Component: Wikidata Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: maarten@mdammers.nl Web browser: --- Mobile Platform: ---
As pointed out in https://www.wikidata.org/wiki/User:Underlying_lk/sandbox#commonsMedia_suppor... , 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.