-
Notifications
You must be signed in to change notification settings - Fork 810
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
i ame the code for scraping tranding tiktok video but its showing an error with api #818
Comments
this the of file that i run**`import asyncio async def fetch_trending_videos():
if name == "main": `** |
It looks like you're encountering an error related to the Tiktok Audio extractor API in your Python script. The error message indicates that there's an issue with the TikTokException.init() method, specifically that it's missing two required positional arguments: 'raw_response' and 'message'. Check the TikTok API Documentation: Update TikTok API Library: Here's a basic example of how you might structure your code to catch and handle exceptions: async def fetch_trending_videos(): asyncio.run(fetch_trending_videos())` |
➜ code pipython3 URL_scarper.py
Traceback (most recent call last):
File "/home/damner/code/URL_scarper.py", line 24, in
asyncio.run(fetch_trending_videos())
File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/home/damner/code/URL_scarper.py", line 17, in fetch_trending_videos
async for video in api.trending.videos(count=100):
File "/usr/local/lib/python3.10/dist-packages/TikTokApi/api/trending.py", line 43, in videos
resp = await Trending.parent.make_request(
File "/usr/local/lib/python3.10/dist-packages/TikTokApi/tiktok.py", line 429, in make_request
raise EmptyResponseException()
TypeError: TikTokException.init() missing 2 required positional arguments: 'raw_response' and 'message'
➜ code
The text was updated successfully, but these errors were encountered: