Page MenuHomePhabricator

Adding the API support for Special:FileDuplicateSearch
Closed, DeclinedPublic

Description

Author: filnik

Description:
Hello,

On the MediaWiki-General channel, I was suggest to request new APIs feature instead of using the HTML's pages with my Bots (that won't work after also some minor changes in the HTML format). So, here I am.

I need to use this special page: Special:FileDuplicateSearch with my Bots and I would like to do it trough APIs instead of HTML.

It would be really useful for commons and the other wikis in general to catch the duplicated images in the uploading phase.

Thanks,

Filnik


Version: 1.13.x
Severity: enhancement

Details

Reference
bz13911

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:09 PM
bzimport set Reference to bz13911.

That's possible already. First, get the file's SHA-1 hash with

http://commons.wikimedia.org/w/api.php?action=query&titles=Image:Bombers_of_WW1.ogg&prop=imageinfo&iiprop=sha1

then get a list of all files with that SHA-1 hash with

http://commons.wikimedia.org/w/api.php?action=query&list=allimages&aisha1=3caa72f8f594f7c5089224ec8595fee14801eab9

The latter should only list the original title (Image:Bombers_of_WW1.ogg), if it lists other images as well, they're duplicates.

filnik wrote:

Uhm... a bit hackish but the bots doesn't care too much if the procedure is complicated. So, thanks for the HowTo :-)

So, can you close the bug? :-) (not sure if I can/if it's the case that I close it on my own ;-))

Thanks again, Filnik

(In reply to comment #2)

Uhm... a bit hackish but the bots doesn't care too much if the procedure is
complicated. So, thanks for the HowTo :-)

No problem.

So, can you close the bug? :-) (not sure if I can/if it's the case that I close
it on my own ;-))

Did that already. Look at the top of this page, where it says Status: RESOLVED Resolution: WORKSFORME