isaackogan / TikTokLive

Python library to receive live stream events (comments, gifts, etc.) in realtime from TikTok LIVE.
https://isaackogan.github.io/TikTokLive/
MIT License
897 stars 176 forks source link

Age restricted stream despite session_id #256

Closed int3debug closed 1 month ago

int3debug commented 1 month ago

Describe the bug

After updating from version 6.0.8 to newest version my program no longer works

Bug: [ERROR] Unexpected error: Age restricted stream. Cannot fetch room info. Pass sessionid to log in & bypass age restriction.. Retrying in 10 seconds...

I use: client.web.set_session_id("SESSION_ID")

Expected Behaviour

Should still work

Actual Behaviour

If applicable, include screenshots!

python app.py -u 'USERNAME' -r [INFO] USERNAME is live! [ERROR] Unexpected error: Age restricted stream. Cannot fetch room info. Pass sessionid to log in & bypass age restriction.. Retrying in 10 seconds...

Package Version

My version of TikTokLive is TikTokLive-6.1.3.

Operating System

Anything Else

If there's anything else, add it here.

Here is proof:

TikTokLive-6.0.8

python app.py -u 'USERNAME' -r [INFO] USERNAME is live! [INFO] USERNAME connected

Successfully installed TikTokLive-6.1.3

python app.py -u 'USERNAME' -r Traceback (most recent call last): File "app.py", line 20, in from TikTokLive.client.web.routes.fetch_video import VideoFetchQuality, VideoFetchFormat ModuleNotFoundError: No module named 'TikTokLive.client.web.routes.fetch_video'

sed -i 's/fetch_video/download_video/g' app.py

python app.py -u 'USERNAME' -r [INFO] USERNAME is live! [ERROR] Unexpected error: Age restricted stream. Cannot fetch room info. Pass sessionid to log in & bypass age restriction.. Retrying in 10 seconds...

Successfully installed TikTokLive-6.0.8

sed -i 's/download_video/fetch_video/g' app.py python app.py -u 'USERNAME' -r 2024-09-14 07:51:10,667 [INFO] USERNAME is live! 2024-09-14 07:51:15,262 [INFO] USERNAME connected

Unfortunately the problem still exists @isaackogan

isaackogan commented 1 month ago

I can't reproduce this...

MissZeda commented 1 month ago

After my attempts, I discovered that the issue was due to the IP being blocked by TikTok. Similar to Google's CAPTCHA, when I used a residential proxy, I no longer encountered the age restriction issue.

The Node.js version of this project doesn't encounter this issue, and I don't know why either.

So I think you can try setting up an HTTP proxy and WebSocket proxy to see if it resolves the issue. I solved the problem by configuring these settings.

int3debug commented 1 month ago

After my attempts, I discovered that the issue was due to the IP being blocked by TikTok. Similar to Google's CAPTCHA, when I used a residential proxy, I no longer encountered the age restriction issue.

The Node.js version of this project doesn't encounter this issue, and I don't know why either.

So I think you can try setting up an HTTP proxy and WebSocket proxy to see if it resolves the issue. I solved the problem by configuring these settings.

Your explanation is all good and I thank you for it But you can see in my example if I change version then it works This can't be a problem with being blocked by TikTok

int3debug commented 1 month ago

I can't reproduce this...

I offered to give them the session ID on discord to test it Unfortunately I didn't get an answer Can you maybe help me and give me tips on how I can debug it myself?

isaackogan commented 1 month ago

Most likely fixed in https://github.com/isaackogan/TikTokLive/commit/1c95a74bdeb470f30ca39157eef76883a2d36b55

Please confirm by updating to 6.1.4 so I can close this issue. Thanks!

@MissZeda @int3debug

int3debug commented 1 month ago

@isaackogan Now the message no longer comes with Age restricted but nothing works

Version 6.1.4: https://bpa.st/raw/2GGOW Version 6.0.8: https://bpa.st/raw/JJR7E

isaackogan commented 1 month ago

Possibly fixed in https://github.com/isaackogan/TikTokLive/commit/f7632924d75f029c3d8d251c6d5c3daf3ef2e958, please confirm so I can close thanks.

@int3debug

isaackogan commented 1 month ago

Confirmed fixed in https://github.com/isaackogan/TikTokLive/issues/260