При работе моего скрипта может внезапно возникнуть такая ошибка:
D:\Projects\tiktok\venv\Scripts\python.exe D:/Projects/tiktok/main.py
Traceback (most recent call last):
File "D:\Projects\tiktok\main.py", line 505, in
_token_bot.polling(none_stop=True, interval=0)
File "D:\Projects\tiktok\venv\lib\site-packages\telebot\__init__.py", line 485, in polling
self.__threaded_polling(none_stop, interval, timeout, long_polling_timeout)
File "D:\Projects\tiktok\venv\lib\site-packages\telebot\__init__.py", line 544, in __threaded_polling
raise e
File "D:\Projects\tiktok\venv\lib\site-packages\telebot\__init__.py", line 507, in __threaded_polling
self.worker_pool.raise_exceptions()
File "D:\Projects\tiktok\venv\lib\site-packages\telebot\util.py", line 117, in raise_exceptions
raise self.exception_info
File "D:\Projects\tiktok\venv\lib\site-packages\telebot\util.py", line 69, in run
task(*args, **kwargs)
File "D:\Projects\tiktok\main.py", line 318, in _create_proc_rec
trending = api.trending(int(message.text))
File "D:\Projects\tiktok\venv\lib\site-packages\TikTokApi\tiktok.py", line 404, in by_trending
res = self.getData(url=api_url, **kwargs)
File "D:\Projects\tiktok\venv\lib\site-packages\TikTokApi\tiktok.py", line 228, in get_data
verify_fp, did, signature = self.browser.sign_url(**kwargs)
File "D:\Projects\tiktok\venv\lib\site-packages\TikTokApi\browser.py", line 164, in sign_url
context = self.create_context()
File "D:\Projects\tiktok\venv\lib\site-packages\TikTokApi\browser.py", line 117, in create_context
context = self.browser.new_context(**iphone)
File "D:\Projects\tiktok\venv\lib\site-packages\playwright\sync_api\_generated.py", line 8600, in new_context
self._sync(
File "D:\Projects\tiktok\venv\lib\site-packages\playwright\_impl\_sync_base.py", line 101, in _sync
self._dispatcher_fiber.switch()
greenlet.error: cannot switch to a different thread
Process finished with exit code 1
Посоветовали использовать:
from gevent import monkey
monkey.patch_all()
Но получаю такую ошибку:
'gevent._gevent_cevent.Event' object has no attribute '_set'