kijijiapi icon indicating copy to clipboard operation
kijijiapi copied to clipboard

kijijiapi: exception "urllib.error.HTTPError: HTTP Error 401: Unauthorized"

Open Asher256 opened this issue 8 years ago • 3 comments

Hi,

I tried kijijiapi on Arch Linux / Python 3.5.1:

./kijijiapi.py list

But I got this error:

[ ] Connecting to Kijiji...
[ ] Signing in... Traceback (most recent call last):
  File "./kijijiapi.py", line 402, in <module>
    main()
  File "./kijijiapi.py", line 339, in main
    args.func(args)
  File "./kijijiapi.py", line 359, in main_list
    main_signin(kijapi)
  File "./kijijiapi.py", line 349, in main_signin
    kijapi.sign_in()
  File "./kijijiapi.py", line 178, in sign_in
    f = urllib.request.urlopen(url, params)
  File "/usr/lib/python3.5/urllib/request.py", line 162, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.5/urllib/request.py", line 471, in open
    response = meth(req, response)
  File "/usr/lib/python3.5/urllib/request.py", line 581, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.5/urllib/request.py", line 509, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.5/urllib/request.py", line 443, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.5/urllib/request.py", line 589, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 401: Unauthorized

Any idea why this exception is raised? Kijiji may have changed the way people login?

Thank you.

Asher256

Asher256 avatar Jun 20 '16 20:06 Asher256

Hi @Asher256, sorry but I don't use Kijiji anymore so I can't help you there. As you point out, this is probably due to a change in the login form. If you find a fix, contributions are welcome! :)

adrienverge avatar Jun 21 '16 08:06 adrienverge

@Asher256 @adrienverge I am creating my own version of KijijiAPI. Kijiji has gotten a lot more complicated this bot was introduced, as a lot more information must be sent when you want to post an ad.

My new bot supports these features, tho. I invite developers to take a look and issues as they see fit. It's still in alpha mode and I'll be developing it in the coming months :) https://github.com/guoarthur/KijijiBotV2

Thanks

ArthurG avatar Oct 12 '16 00:10 ArthurG

Thanks @guoarthur, I've added a link to your new tool on my project's README.

adrienverge avatar Oct 14 '16 07:10 adrienverge