Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

downloadTikTok.py example #94

Closed
madnai opened this issue May 22, 2020 · 6 comments
Closed

downloadTikTok.py example #94

madnai opened this issue May 22, 2020 · 6 comments
Labels
installation_help Someone is having problems installing the api

Comments

@madnai
Copy link

madnai commented May 22, 2020

I have a provlem when running example downloadTikTok.py

I get an error:
Traceback (most recent call last): File "downloadTikTok.py", line 6, in <module> tiktokData = api.get_Video_By_Url("https://www.tiktok.com/@ceciliaannborne/video/6817602864228207878", return_bytes=1) File "/home/ubuntu/workspace/django-react/TikTokApi/TikTokApi/tiktok.py", line 276, in get_Video_By_Url driver = webdriver.Chrome() File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/chrome/webdriver.py", line 81, in __init__ desired_capabilities=desired_capabilities) File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__ self.start_session(capabilities, browser_profile) File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute self.error_handler.check_response(response) File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally. (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

Im working on Ubuntu 18.04
I have chrome installed version: 81.0.4044.138
I have chromedrvier installed: 81.0.4044.138

Did anyone maybe knows what is wrong?

@madnai madnai added the bug Something isn't working label May 22, 2020
@madnai madnai changed the title [BUG] [BUG] downloadTikTok.py example May 22, 2020
@madnai madnai changed the title [BUG] downloadTikTok.py example downloadTikTok.py example May 22, 2020
@davidteather
Copy link
Owner

Since I think you're using a virtual environment on ubuntu you should run the following

sudo apt-get install chromium-chromedriver

More info #95

@madnai
Copy link
Author

madnai commented May 24, 2020

I did install chromium-chromedriver globally and I have the same problem.
When I run command: chromedriver I got response:
Starting ChromeDriver 81.0.4044.138 (8c6c7ba89cc9453625af54f11fd83179e23450fa-refs/branch-heads/4044@{#999}) on port 9515 Only local connections are allowed. Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.

@davidteather
Copy link
Owner

Does it work when you run the script as sudo?

@davidteather davidteather added installation_help Someone is having problems installing the api and removed bug Something isn't working labels May 25, 2020
@madnai
Copy link
Author

madnai commented May 25, 2020

Running sudo python3 downloadTikTok.py results:
Traceback (most recent call last): File "downloadTikTok.py", line 6, in <module> tiktokData = api.get_Video_By_Url("https://www.tiktok.com/@ceciliaannborne/video/6817602864228207878", return_bytes=1) File "/home/ubuntu/workspace/django-react/TikTokApi/TikTokApi/tiktok.py", line 276, in get_Video_By_Url driver = webdriver.Chrome() File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/chrome/webdriver.py", line 81, in __init__ desired_capabilities=desired_capabilities) File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__ self.start_session(capabilities, browser_profile) File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute self.error_handler.check_response(response) File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally. (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

@davidteather
Copy link
Owner

Closing because I’m unable to replicate. If you want a setup guide for Ubuntu you can check out the Travis.yml in the root of this GitHub which if you run the prescript section commands you should have a working Ubuntu version.

@FavorMylikes
Copy link

Same issue.
Centos 8
4.18.0-147.8.1.el8_1.x86_64 #1 SMP Thu Apr 9 13:49:54 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
python 3.8

    self.api: TikTokApi = TikTokApi.get_instance(use_selenium=True, executablePath=CHROME_DRIVER)
  File "/root/py38/lib/python3.8/site-packages/TikTokApi/tiktok.py", line 89, in get_instance
    TikTokApi(**kwargs)
  File "/root/py38/lib/python3.8/site-packages/TikTokApi/tiktok.py", line 56, in __init__
    self.browser = browser(**kwargs)
  File "/root/py38/lib/python3.8/site-packages/TikTokApi/browser_selenium.py", line 65, in __init__
    raise e
  File "/root/py38/lib/python3.8/site-packages/TikTokApi/browser_selenium.py", line 63, in __init__
    self.browser = webdriver.Chrome(executable_path=self.executablePath, chrome_options=options)
  File "/root/py38/lib/python3.8/site-packages/selenium/webdriver/chrome/webdriver.py", line 76, in __init__
    RemoteWebDriver.__init__(
  File "/root/py38/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "/root/py38/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/root/py38/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "/root/py38/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally
  (unknown error: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
  (Driver info: chromedriver=2.42.591071 (0b695ff80972cc1a65a5cd643186d2ae582cd4ac),platform=Linux 4.18.0-147.8.1.el8_1.x86_64 x86_64)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installation_help Someone is having problems installing the api
Projects
None yet
Development

No branches or pull requests

3 participants