Closed ziyueluo closed 4 years ago
Issue-Label Bot is automatically applying the label bug
to this issue, with a confidence of 0.71. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!
Links: app homepage, dashboard and code for this bot.
Are you running the latest version
Yes, I'm running with version 3.6.0
What hashtag were you trying to get
I also can't seem to replicate your bySound issue are you sending requests too fast to TikTok?
I'm updating the bySound endpoint and the byHashtag method although I'm not sure it will fix your issue.
Right now, I tried with your latest version. BySound is working fine. But for byHashtag, I still get repeated results for some hashtags. When I run: hashtags=api.byHashtag('#HeinzHalloween',count=2000) It return 2000 results but there are only 29 unique objects.
The hashtag string shouldn’t contain # you’re searching for ##HeinzHalloween there’s probably only 29 videos there
I tried with: hashtags=api.byHashtag('HeinzHalloween',count=2000) Still the same result
from TikTokApi import TikTokApi
api = TikTokApi()
def ensure_unique(arr):
tmp = []
for t in arr:
if t['id'] not in arr:
tmp.append(t['id'])
return tmp
tiktoks=api.byHashtag('HeinzHalloween',count=2000)
print(len(ensure_unique(tiktoks)))
I'm personally getting 2,000 unique results.
Hi, in fact with the previous code you get 2000 unique results but if you restart the function immediately afterwards it will find the same 2000 results again. (of course the hashtag has more than 2000). how to explain this? is it resolvable?
Hi, I found some problems for method bySound and byHashtag( I'm using 3.6.0) when I tried: musics=api.bySound('6883993546467051522',count=10) it returns: Traceback (most recent call last): File "", line 1, in
File "D:\Anaconda3\envs\lib\site-packages\TikTokApi\tiktok.py", line 633, in bySound
for t in res["body"]["itemListData"]:
KeyError: 'body'
And when I tried with byHashtag, sometimes it returned the same error but sometimes it worked well. And when I used byHashtag, like: hashtags=api.byHashtag(hashtag,count=2000,proxies=proxies) the result only contained around 50 unique tiktoks and just kept repeating the same 50 tiktoks.
Thanks for your help!