Michele0303 / tiktok-live-recorder

🎥✨ A TikTok live streaming recorder tool written in Python. Capture and relive your favorite TikTok moments effortlessly. 🎥✨
MIT License
373 stars 102 forks source link

ERROR - JSONDecodeError.__init__() missing 2 required positional arguments: 'doc' and 'pos' #129

Closed Kaimeera closed 1 month ago

Kaimeera commented 2 months ago

[*] 2024-07-18 13:00:32 - ERROR - JSONDecodeError.init() missing 2 required positional arguments: 'doc' and 'pos'

CD'd to src & ran python main.py -user [user] -mode automatic -ffmpeg -output [Path]

(Windows)

Kaimeera commented 2 months ago

Sorry, Reopening bc I know the issue now.

The previous error was "ERROR - Unable to find room_id. I'll try again in 2 minutes". This is the same thing that happens when TT isn't displaying the Room_ID.

The new error your code is throwing is: ERROR - JSONDecodeError.init() missing 2 required positional arguments: 'doc' and 'pos'

But it's flooding the console so I had to stop the program altogether for now.

Michele0303 commented 2 months ago

It looks like TikTok's WAF is blocking your IP

Kaimeera commented 2 months ago

If that's what is happening, it's only blocking for like 5 minutes at a time. After a few minutes, it can find the room_ID again.

Michele0303 commented 2 months ago
'<!DOCTYPE html> 
<html lang="en">
   <head>
      <link rel="icon" href="data:;base64,=">
      <script id="slardar-config" type="application/json"> {     "slardarClient": "SlardarWAF",     "sdkUrl": "https://sf16-website-login.neutral.ttwstatic.com/obj/tiktok_web_login_static/slardar/fe/sdk-web/browser.sg.js",     "bid": "slardar_us_waf",     "pid": "pid",     "pluginPathPrefix": "https://sf16-website-login.neutral.ttwstatic.com/obj/tiktok_web_login_static/slardar/fe/sdk-web/plugins" } </script>     <script src="https://sf16-website-login.neutral.ttwstatic.com/obj/tiktok_web_login_static/slardar/sdk-pre/browser.web.pre.js" crossorigin="anonymous"></script> 
   </head>
   <body>
      Please wait... 
      <p id="wci" class="_wafchallengeid"></p>
      <p id="cs" class="eyJ2Ijp7ImEiOiIzcjFibzV4amJHeExERnYwNWhXN3JQUVl4RHhGeXFJMTdEbHJSR2orTkpZPSIsImIiOjE3MjEzMzEzNDMsImMiOiJKZFZYVjFQd2o5Zy90TlNDYmZZNHEwNUV2RysvcUxTaTFmODdkdHBaYmNnPSJ9LCJzIjoiSkp6Z284cjl4T1dVTFhQQ3lNdWxFbWV5RHcxZXJHM0gycWhYUTltR05GWT0ifQ"></p>
      <script tpye="text/javascript" src="https://sf16-website-login.neutral.ttwstatic.com/obj/tiktok_web_login_static/obj/waf-aiso/dd9799.js"></script> 
   </body>
</html>
'

This is the output I was able to get

booleangit commented 2 months ago

If that's what is happening, it's only blocking for like 5 minutes at a time. After a few minutes, it can find the room_ID again.

Indeed. I haven't tried it myself, but does automatic mode crashes when your IP is temporarily banned? It shouldn't throw an error but just try again in 5 minutes.

Kaimeera commented 2 months ago

On the previous version, it rechecks without crashing. "ERROR - Unable to find room_id. I'll try again in 5 minutes" until it can connect again.

On the new version, it floods the console with "ERROR - JSONDecodeError.init() missing 2 required positional arguments: 'doc' and 'pos'" but doesn't crash. It eventually reconnects.

It's usable and works beyond that tho.

Michele0303 commented 2 months ago

I've made some commits attempting to bypass the WAF, but since I can't replicate the problem, these changes are essentially tests.

Kaimeera commented 2 months ago

So far so good! I'm going to let my tests run for a while, but so far not blocked!