davidteather / TikTok-Api

The Unofficial TikTok API Wrapper In Python
https://davidteather.github.io/TikTok-Api
MIT License
4.88k stars 976 forks source link

[BUG] - pyppeteer.errors.BrowserError: Browser closed unexpectedly: #178

Closed TimeToGoogle closed 4 years ago

TimeToGoogle commented 4 years ago

Since the update I'm always running into the error: pyppeteer.errors.BrowserError: Browser closed unexpectedly.

This is the output: Traceback (most recent call last): File "/.local/lib/python3.7/site-packages/TikTokApi/browser.py", line 61, in start self.browser = await pyppeteer.launch(self.options) File "/.local/lib/python3.7/site-packages/pyppeteer/launcher.py", line 305, in launch return await Launcher(options, **kwargs).launch() File "/.local/lib/python3.7/site-packages/pyppeteer/launcher.py", line 166, in launch self.browserWSEndpoint = get_ws_endpoint(self.url) File "/.local/lib/python3.7/site-packages/pyppeteer/launcher.py", line 225, in get_ws_endpoint raise BrowserError('Browser closed unexpectedly:\n')

Because if this I'm getting an AttributeError: 'browser' object has no attribute 'browser' error in my TikTokApi function.

Any ideas how I can fix this?

issue-label-bot[bot] commented 4 years ago

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.99. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

davidteather commented 4 years ago

Your pyppeteer isn't launching. Run the following script

from pyppeteer.launcher import Launcher
print(' '.join(Launcher().cmd)) # prints the command used to launch pyppeteer

Then copy the output of that program and run it into your terminal or cmd, please respond with the output of that command. If this command throws an error it may be easier to investigate.

TimeToGoogle commented 4 years ago

/.local/share/pyppeteer/local-chromium/588429/chrome-linux/chrome --disable-background-networking --disable-background-timer-throttling --disable-breakpad --disable-browser-side-navigation --disable-client-side-phishing-detection --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=site-per-process --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --disable-translate --metrics-recording-only --no-first-run --safebrowsing-disable-auto-update --enable-automation --password-store=basic --use-mock-keychain --headless --hide-scrollbars --mute-audio about:blank --remote-debugging-port=60603 --user-data-dir=/.local/share/pyppeteer/.dev_profile/tmp7c7dulgm

Was the response. Thx for your help.

davidteather commented 4 years ago

Please run that in your console

TimeToGoogle commented 4 years ago

Well the console always saying chrome command not found.

davidteather commented 4 years ago

Install chrome on your computer as well as download chromedriver and add it to your system path.