[go: nahoru, domu]

Page MenuHomePhabricator

Implement filearchive in Pywikibot Site
Closed, ResolvedPublicFeature

Description

The very old task T23345 got implemented Sorry, mixed up old versions of a not deleted file ( https://www.mediawiki.org/wiki/Manual:Oldimage_table ) and deleted images ( https://www.mediawiki.org/wiki/Manual:Filearchive_table ).

We can now search the filearchive in the api by hash, see https://commons.wikimedia.org/w/api.php?action=query&list=filearchive&faprop=sha1&fasha1=c0f895d6a4973ef711d9749fb9b83ce65ac0c53f . That means we can finally add the site function to access this in pywikibot. Function in API is described at https://www.mediawiki.org/wiki/API:Filearchive and https://commons.wikimedia.org/w/api.php?action=help&recursivesubmodules=1#query+filearchive . Implementation could be done the same way as the allimages, see https://github.com/wikimedia/pywikibot/blob/master/pywikibot/site.py#L4434

Event Timeline

When I hit the api I'm logged into my own (sysop) account so I get something back. Bot account can't see deleted stuff so doesn't work. Looking at https://commons.wikimedia.org/wiki/Special:ListGroupRights the rights are either see everything deleted or see nothing. A more fine grained right would be needed to be able to search by sha1, but not see the actual file content and maybe intentionally hidden metadata. Sounds complicated, dropping this one to low.

Xqt changed the subtype of this task from "Task" to "Feature Request".Sep 12 2019, 11:31 AM
Xqt subscribed.

api.PageGenerator does not work because that module cannot be used as a generator. ListGenerator can be used instead but it retrieves the property items instead of the FilePage which would be given by a PageGenerator. What would be the best solution for this request:

  1. retrieving the FilePages for the given request or
  2. retrieving the list items for the given properties or
  3. retrieving the FilePages for the given request where other parts are given as a data attribute

Change 536620 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [IMPR] Add ListGenerator for filearchive to site.py

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

Change 536620 merged by jenkins-bot:
[pywikibot/core@master] [IMPR] Add ListGenerator for filearchive to site.py

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