jayvdb added a comment.

i.e. we would add a use_fake_user_agent parameter to methods in http.comms, which is False by default, True forces a fake user-agent, and None means automatic use of fallback logic (use fake if in the config list, otherwise try with real user-agent, and fallback to fake).

http.comms seems to be used only to get the user_agent, but not for making the requests themselves. Shouldn't this parameter and logic be implemented in the scripts that need fake UAs (i.e. reflinks and weblinkchecker) instead?

See pywikibot.comms.http.request

It would also be nice if the config list allowed literal strings: when connecting to this server, use this user-agent, rather than a random one.

Yup. This list would also be better if it is dynamically updated, instead of hard-coded in config2.py, so maybe we should put this on a WikiTech page. This make user-agent specifications like this less messy as well.

Nah, it should be part of the config, but at the end of a bot run it should warn the user that they should add the extra sites to the config.
We have been developing "loading config from the wiki", using JSON. I'll look into how that is going. We can continue with that after this task.


TASK DETAIL
https://phabricator.wikimedia.org/T152075

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: jayvdb
Cc: jayvdb, Aklapper, TerraCodes, pywikibot-bugs-list, Dargasea, Magul, MayS, Mdupont, JJMC89, Dalba, Masti, Alchimista, Rxy
_______________________________________________
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to