poe-api-wrapper icon indicating copy to clipboard operation
poe-api-wrapper copied to clipboard

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Open shawnWXN opened this issue 1 year ago • 8 comments

  • [x] poe-api-wrapper: 1.3.6
  • [x] python: 3.9.6
  • [x] OS: Ubuntu 20.04.6 LTS
>>> from poe_api_wrapper import PoeApi
>>> client = PoeApi("BngWPT8UUE****WdhMvwg==", proxy=True)  # Poe cookies
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ubuntu/miniconda3/envs/python3.9/lib/python3.9/site-packages/poe_api_wrapper/api.py", line 146, in __init__
    self.get_channel_settings()
  File "/home/ubuntu/miniconda3/envs/python3.9/lib/python3.9/site-packages/poe_api_wrapper/api.py", line 199, in get_channel_settings
    response_json = self.client.get(f'{self.BASE_URL}/poe_api/settings', headers=self.HEADERS, follow_redirects=True).json()
  File "/home/ubuntu/miniconda3/envs/python3.9/lib/python3.9/site-packages/httpx/_models.py", line 761, in json
    return jsonlib.loads(self.content, **kwargs)
  File "/home/ubuntu/miniconda3/envs/python3.9/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/home/ubuntu/miniconda3/envs/python3.9/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/home/ubuntu/miniconda3/envs/python3.9/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
>>> client = PoeApi("m_oJTNezS****TelxGHQ==", proxy=True)  # Quora cookies
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ubuntu/miniconda3/envs/python3.9/lib/python3.9/site-packages/poe_api_wrapper/api.py", line 146, in __init__
    self.get_channel_settings()
  File "/home/ubuntu/miniconda3/envs/python3.9/lib/python3.9/site-packages/poe_api_wrapper/api.py", line 199, in get_channel_settings
    response_json = self.client.get(f'{self.BASE_URL}/poe_api/settings', headers=self.HEADERS, follow_redirects=True).json()
  File "/home/ubuntu/miniconda3/envs/python3.9/lib/python3.9/site-packages/httpx/_models.py", line 761, in json
    return jsonlib.loads(self.content, **kwargs)
  File "/home/ubuntu/miniconda3/envs/python3.9/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/home/ubuntu/miniconda3/envs/python3.9/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/home/ubuntu/miniconda3/envs/python3.9/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

shawnWXN avatar Jan 23 '24 08:01 shawnWXN

一样

31702160136 avatar Jan 23 '24 10:01 31702160136

Hello, it would be better to print the data before calling json.load so we could see whats wrong :)

XenocodeRCE avatar Jan 24 '24 09:01 XenocodeRCE

image image

elinalai0000 avatar Jan 25 '24 00:01 elinalai0000

the same

RyanXie123 avatar Jan 26 '24 03:01 RyanXie123

why the status code is 403? The token has copied from the poe.com

YogeLiu avatar Feb 22 '24 14:02 YogeLiu

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

31702160136 avatar Feb 22 '24 14:02 31702160136

same

benngaihk avatar May 10 '24 06:05 benngaihk

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

31702160136 avatar May 10 '24 06:05 31702160136