oliverjrose99 / Recordurbate

A Bot to automatically record Chaturbate live streams.
GNU General Public License v3.0
233 stars 79 forks source link

CB room online status json error #54

Open sevypannella opened 3 years ago

sevypannella commented 3 years ago

I'm getting an error from with python 3.5 related to the online status function with Recordurbate 2.0.4 I'm not an axe with python so all I can do is verifying that something is going wrong on line 75, hence requests.post to CB's json is not getting the full json response. Here follows the log:

2021-04-07 11:17:48,025 - Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "/root/recordurbate/bot.py", line 76, in is_online
    if r.json()["room_status"] == "public":
  File "/usr/lib/python3/dist-packages/requests/models.py", line 894, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib/python3.5/json/__init__.py", line 319, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Now, considering that no connectivity problem is in place since I'm on a 1Gbps multi-routed pipeline and considering there shouldn't be any cpu/ram/drive bottleneck since I'm using a dedibox which is running Recordurbate only on a SSD driven Ubuntu 18.04 with a Ryzen 7 3700X 3.6 GHz with 16 Gigs DDR5, well... I suspect the problem is on CB's side!

Yet I ask if anyone else is facing the same issue and how to fix it. Could it be some misleading element in the json response from CB? Could it be a timeout problem? Maybe some integrity check has to be implemented after the HTTP request? I really don't know. Anyway I'm gonna fork the repo so maybe I can improve it, but again I'm not a Python guru.

Any help would be greatly appreciated...

Tutul- commented 3 years ago

Tested with postman and got that error in return : { "url": "", "room_status": "offline", "hidden_message": "", "success": false }

for every single test attempt

leet86 commented 1 year ago

Resolved under pull request #70 (Fixes Issue #69 and #54)

jkruse commented 1 year ago

Tested with postman and got that error in return : { "url": "", "room_status": "offline", "hidden_message": "", "success": false }

for every single test attempt

Do note that this response is not an error, it's a success, indicating that room is offline. The service is designed to retrieve the stream URL, hence "success: false" when room is offline.

leet86 commented 1 year ago

Just seeing this. I forgot to include that the rooms I check were actually online. But, as you mentioned on the other issue, this might have been a temporary issue at CB that lasted for some time, and now resolved.