Skip to content

[Bugfix] RuntimeError: There is no current event loop in thread #1

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

Merged
merged 1 commit into from
Jun 11, 2022

Conversation

Martouta
Copy link
Owner

@Martouta Martouta commented Jun 11, 2022

RuntimeError: There is no current event loop in thread 'ThreadPoolExecutor-0_0'
    TRACEBACK:
    Traceback (most recent call last):
  ...
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/TikTokAPI/tiktokapi.py", line 239, in downloadVideoById
    video_info = self.getVideoById(video_id)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/TikTokAPI/tiktokapi.py", line 236, in getVideoById
    return self.send_get_request(url, params)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/TikTokAPI/tiktokapi.py", line 74, in send_get_request
    signature = self.tiktok_browser.fetch_auth_params(url, language=self.language)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/TikTokAPI/tiktok_browser.py", line 54, in fetch_auth_params
    return asyncio.get_event_loop().run_until_complete(self.async_fetch_auth_params(url, language))
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/events.py", line 656, in get_event_loop
    raise RuntimeError('There is no current event loop in thread %r.'

In tests, it used to show up like: DeprecationWarning: There is no current event loop

```
RuntimeError: There is no current event loop in thread 'ThreadPoolExecutor-0_0'
    TRACEBACK:
    Traceback (most recent call last):
  ...
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/TikTokAPI/tiktokapi.py", line 239, in downloadVideoById
    video_info = self.getVideoById(video_id)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/TikTokAPI/tiktokapi.py", line 236, in getVideoById
    return self.send_get_request(url, params)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/TikTokAPI/tiktokapi.py", line 74, in send_get_request
    signature = self.tiktok_browser.fetch_auth_params(url, language=self.language)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/TikTokAPI/tiktok_browser.py", line 54, in fetch_auth_params
    return asyncio.get_event_loop().run_until_complete(self.async_fetch_auth_params(url, language))
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/events.py", line 656, in get_event_loop
    raise RuntimeError('There is no current event loop in thread %r.'
```
@Martouta Martouta self-assigned this Jun 11, 2022
@Martouta Martouta changed the title [Bugfix] RuntimeError: There is no current event loop in thread [Hotfix] RuntimeError: There is no current event loop in thread Jun 11, 2022
@Martouta Martouta changed the title [Hotfix] RuntimeError: There is no current event loop in thread [Bugfix] RuntimeError: There is no current event loop in thread Jun 11, 2022
@Martouta Martouta merged commit aed4e8c into master Jun 11, 2022
@Martouta Martouta deleted the browser-no-current-event-loop-using-threads branch June 11, 2022 05:43
@Martouta
Copy link
Owner Author

This addresses the same issue: avilash#7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant