TikTok-Api
TikTok-Api copied to clipboard
AttributeError: 'TikTokApi' object has no attribute '_browser'
heroku logs showing AttributeError: 'TikTokApi' object has no attribute '_browser' i have playwright, puppeteer buildpack on heroku
2022-07-28T07:13:11.018984+00:00 app[bot.1]: Traceback (most recent call last): 2022-07-28T07:13:11.018985+00:00 app[bot.1]: File "/app/.heroku/python/lib/python3.10/site-packages/TikTokApi/tiktok.py", line 421, in del 2022-07-28T07:13:11.019011+00:00 app[bot.1]: File "/app/.heroku/python/lib/python3.10/site-packages/TikTokApi/tiktok.py", line 635, in shutdown 2022-07-28T07:13:11.019061+00:00 app[bot.1]: AttributeError: 'TikTokApi' object has no attribute '_browser' 2022-07-28T07:13:11.244049+00:00 heroku[bot.1]: State changed from up to crashed
figured out what is the cause but i didnt know why,, if i run this code from vs code it works
#working on vscode // doesnt work on heroku
from TikTokApi import TikTokApi
api = TikTokApi()
however the code above doesnt work on heroku so i did this instead of using a variable to call TikTokApi i just use TikTokApi
#works perfectly
TikTokApi.video(url=url).info()
mb it doesnt work on heroku,, other cmds are working however the TikTokApi have some error saying that
'TikTokApi' object has no attribute '_browser'
mb it doesnt work on heroku,, other cmds are working however the TikTokApi have some error saying that
'TikTokApi' object has no attribute '_browser'
is there a way to fix this?
Try python3 -m playwright install, maybe this gonna help you.
Try python3 -m playwright install, maybe this gonna help you.
i already tried that :(
here are the things i've tried
- added pytest-playwright on the requirements.txt
- run
pip install pytest-playwright
in the vs code - run
pip install pytest-playwright
in the heroku console - run
playwright install
in vs code - run
playwright install
in heroku console
Having the same issue :(
Add the following snippet
import nest_asyncio nest_asyncio.apply()
prior to instantiate your API object.
Reference is from here: https://stackoverflow.com/questions/46827007/runtimeerror-this-event-loop-is-already-running-in-python
What fixed this for me was uninstalling and re-installing playwright with pip, and then running
playwright install
again
ok Saturday, 03 December 2022, 11:09PM +03:00 from Michael Miele-Herndon @.*** :
What fixed this for me was uninstalling and re-installing playwright with pip, and then running
playwright install again — Reply to this email directly, view it on GitHub , or unsubscribe . You are receiving this because you commented. Message ID: @ github . com>
should be fixed in V6
having this issue now, have tried everything in this thread with no fix. Not sure if it is because I am running the code from within a docker container