[17:03:54] Hello folks... I'm having an issue with getting CSRF tokens using the API with a bot password. (i'm using the mozilla wiki instance). Not sure what I'm doing wrong here. Anyone able to guide me? Here is the code I've tried https://paste.debian.net/hidden/794a5e45/ [17:34:07] Masterphi: I don’t see anything wrong with that at a glance (though I’d generally recommend using a MediaWiki client library – for Python I like https://github.com/mediawiki-utilities/python-mwapi) [17:34:29] maybe check what the session.cookies look like? (they should be nonempty at the very least) [17:34:50] Yeah I see some cookies in there [17:35:44] I just noticed that line 49 is .post() but uses params= (unlike line 23, .get() with params=, or line 39, .post() with data=) [17:35:46] going to try the python lib [17:35:56] no idea if that makes a difference in requests [17:37:25] post does take in `data` ---> `def post(self, url, data=None, json=None, **kwargs):` [17:40:23] (I’m about to go afk but good luck…) [17:56:41] Masterphi: try dumping the response body of the login POST, it may contain a useful error message [17:57:09] (or just use a lib as previously suggested) [17:57:09] moonmoon the login seems to work [17:59:10] Sorry, I wasn't very specific on my initial message, the CSRF api is returning just `+\\` [17:59:38] there's no errors in any of the calls listed in the script [18:00:53] my guess is cookie handling not working [22:02:27] I'm assuming wiki_session is the cookie we care about, and it seems to be passing it along as it should, wouldn't the query/tokens endpoint return an error if there was a problem with the session/credentials? [22:14:03] Lucas_WMDE I tried mwapi, but couldn't get it to login using the lib methods [23:27:01] Masterphi: How long does your session last if you login without checking the "remember me" checkbox? Some installs may have broken sessions if they setup a very volatile $wgMainCacheType . From my understanding, the check forces recording the session on the database no matter what your main cache type is [23:27:48] I have to leave now, but this information may help others diagnose it