TikTok-Api: [BUG] - Getting videos by Hashtag stopped working
Getting an exception:
Tag #viral, Error: Expecting value: line 1 column 1 (char 0)
It fails at this code:
with TikTokApi() as api:
tag = api.hashtag(name="viral")
print(tag.info())
->for video in tag.videos():
print(video.id)
the for loop fires the exception and return 0 videos
This is the log output
urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): m.tiktok.com:443
urllib3.connectionpool - DEBUG - https://m.tiktok.com:443 "GET /api/challenge/detail" 200 308
urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): us.tiktok.com:443
urllib3.connectionpool - DEBUG - https://us.tiktok.com:443 "GET /api/challenge/item_list" 200 0
batch - ERROR - Tag #viral, Error: Expecting value: line 1 column 1 (char 0)
It was working perfectly on production, code above is a simplified example of my code, the issue happens with or without a proxy It was working up to the Nov 15th
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 28 (1 by maintainers)
+1
This works
@mandys, i was try hit with full request params and response is blank… how you solve this issue?
For anyone still needing to get around this issue, I’m working on my own library that does work with getting videos under a tag. You don’t need to preload any cookies because it doesn’t handle API calls in the same way. I have yet to need to provide a proxy for bulk scraping. The methodology to get a large number of videos from a tag or user or comments under a video is handled a bit different, but this is explained in the documentation. I am actively working on the development of the library and am open to issues and contributions.
@azickri I am working with this, using as guideline the comments in others issues:
I am working with this code for search by keyword
@DarinKumarnsit ,
I think, that not sessionid but csrf_session_id, you can see in developer tab Browser