You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When i launch the script it raise an raise Exception("User might be offline" if valid_response else "Your IP or country might be blocked by TikTok.") Exception: Your IP or country might be blocked by TikTok.
This error happens in this line of code self.__room_id = get_room_id_from_main_page_html(html) that can be found in TikTokLive/utils.py.
I'm in italy and tiktok is not blocked i can watch live streams with no problem from smartphone or laptop.
Additional context
Is raised because inside the html variable (html: str = await self._http.get_livestream_page_html(self.__unique_id)) there isn't a room_id and that happens cause when get_livestream_page_html(unique_id) is called tiktok redirect to a login page to be authenticated.
It's not a real bug instead a lack of control, i guess. Last thing if i hardcode the room_id then the script work flawless.
Desktop (please complete the following information):
OS: Windows 10
Traceback:
ERROR:root:Traceback (most recent call last):
File "C:\Users\mari\Desktop\ycharmProjects\tiktok\tiktok\lib\site-packages\TikTokLive\client\base.py", line 91, in __fetch_room_id
self.__room_id = get_room_id_from_main_page_html(html)
File "C:\Users\mari\Desktop\ycharmProjects\tiktok\tiktok\lib\site-packages\TikTokLive\utils.py", line 20, in get_room_id_from_main_page_html
raise Exception("User might be offline" if valid_response else "Your IP or country might be blocked by TikTok.")
Exception: Your IP or country might be blocked by TikTok.
Failed to retrieve room id from page source
Traceback (most recent call last):
File "C:\Users\mari\Desktop\ycharmProjects\tiktok\tiktok\lib\site-packages\TikTokLive\client\base.py", line 210, in _connect
raise LiveNotFound()
TikTokLive.types.errors.LiveNotFound
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\mari\Desktop\ycharmProjects\tiktok\live.py", line 23, in <module>
client.run()
File "C:\Users\mari\Desktop\ycharmProjects\tiktok\tiktok\lib\site-packages\TikTokLive\client\base.py", line 285, in run
self.loop.run_until_complete(self._connect())
File "C:\Users\mari\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete
return future.result()
File "C:\Users\mari\Desktop\ycharmProjects\tiktok\tiktok\lib\site-packages\TikTokLive\client\client.py", line 39, in _connect
result: str = await super(TikTokLiveClient, self)._connect()
File "C:\Users\mari\Desktop\ycharmProjects\tiktok\tiktok\lib\site-packages\TikTokLive\client\base.py", line 239, in _connect
raise FailedConnection(message)
TikTokLive.types.errors.FailedConnection```
The text was updated successfully, but these errors were encountered:
It does not matter that you are able to access it from mobile. TikTok is sending you a captcha for web-browser requests, like the one being made here. Use a proxy.
Describe the bug
When i launch the script it raise an raise Exception("User might be offline" if valid_response else "Your IP or country might be blocked by TikTok.") Exception: Your IP or country might be blocked by TikTok.
This error happens in this line of code
self.__room_id = get_room_id_from_main_page_html(html)
that can be found in TikTokLive/utils.py.I'm in italy and tiktok is not blocked i can watch live streams with no problem from smartphone or laptop.
Additional context
Is raised because inside the html variable (
html: str = await self._http.get_livestream_page_html(self.__unique_id)
) there isn't a room_id and that happens cause whenget_livestream_page_html(unique_id)
is called tiktok redirect to a login page to be authenticated.It's not a real bug instead a lack of control, i guess. Last thing if i hardcode the room_id then the script work flawless.
Desktop (please complete the following information):
Traceback:
The text was updated successfully, but these errors were encountered: