jayvdb added a comment. In https://phabricator.wikimedia.org/T85153#947827, @Tgr wrote:
> The wiki to which the repo is local could be private or have its API disabled > though, that's perfectly legal; and from the point of view of the bot, it > still raises the same problem. From a client perspective it is a different problem. Our problem is how to identify the wiki hosting the file and its real wiki page. Once we are able to identify the real host, we know what further options are available. e.g. do we have configuration setting relevant for that wiki , such as usernames ? If that api url is not accessible, or the user doesnt have relevant permissions, they will be shown a reasonable error about that. In https://phabricator.wikimedia.org/T85153#964947, @Tgr wrote: > For local repos, you can use `articlepath` from the siteinfo API. For > API-based foreign repos, `articlepath` and `server`is included in the > filerepoinfo API output. For shared-DB foreign repos, you can use > `descBaseUrl`. > > See > http://en.wikipedia.beta.wmflabs.org/w/api.php?action=query&meta=filerepoinfo > for an example which has all three kinds of repos and uses code from master. > > It would be nicer to have a property which has the same name and semantics > for all three, not sure if that's important enough to create duplicate > properties though. It looks like we could also use `scriptDirUrl + '/api.php'` for all foreign repos to obtain the API endpoint, which would be better as it doesnt require stripping 'File:' from the URL, which may be difficult if the File: was translated, or if the MW version was pre 1.14 and used Image:. TASK DETAIL https://phabricator.wikimedia.org/T85153 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: jayvdb Cc: Anomie, jayvdb, Aklapper, pywikibot-bugs-list, Tgr, XZise, Bawolff, Fabrice_Florin, Legoktm, Malyacko, P.Copp _______________________________________________ pywikibot-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs
