Kijiji-Repost-Headless: kijiji_api.KijijiApiException: XSRF token not found in html text
Not able to show ads anymore, I get the following error when I run the command:
python kijiji_repost_headless [-u USERNAME] [-p PASSWORD] show
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "kijiji_repost_headless/__main__.py", line 205, in <module>
main()
File "kijiji_repost_headless/__main__.py", line 51, in main
args.function(args)
File "kijiji_repost_headless/__main__.py", line 106, in show_ads
api.login(args.username, args.password)
File "kijiji_repost_headless/kijiji_api.py", line 111, in login
"xsrfToken": get_xsrf_token(resp.text),
File "kijiji_repost_headless/kijiji_api.py", line 84, in get_xsrf_token
raise KijijiApiException("XSRF token not found in html text.", html)
kijiji_api.KijijiApiException: XSRF token not found in html text.
See kijijiapi_dump_20200530T191135.html in current directory for latest dumpfile.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 19 (5 by maintainers)
I believe this is fixed in #181. Please open a new issue if you find it still occurs.
@ArthurG Nice 😉 Byte code is pretty easy to reverse. I just uploaded the original source Here The decomp is close, but it mangles the if statements a little. Anyways, use what you need. Also, kijiji has switched to http2.0 protocols. So the requests module works for some things, but has troubles with others. So I used httpx to solve my issues.
I decompiled that code and found out that it is using a mobile Kijiji API - mingle.kijiji.ca
Sounds like the Mobile API could work
All credits for the code below goes to rybodiddly.
I agree, using the mobile app API sounds like a good idea.