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

[BUG] - KeyError: 'challengeInfo' #260

Closed
DiegoMORENO-DS opened this issue Sep 13, 2020 · 4 comments
Closed

[BUG] - KeyError: 'challengeInfo' #260

DiegoMORENO-DS opened this issue Sep 13, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@DiegoMORENO-DS
Copy link

Hi,

I was trying to scrap a hashtag but now is not possible. I've had been many problems and the process is not successful. I did in the past and worked well. I'd like to understand why the changes?. Thnaks

code:
from TikTokApi import TikTokApi
api = TikTokApi()
hashtag = 'pasta'
hash1 = api.byHashtag(hashtag, count=10000, language='en', proxy=None)

Error message:

hash1 = api.byHashtag(hashtag, count=10000, language='en', proxy=None)
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\diego\Desktop\TikTok2\TikTok-Api-master\TikTokApi\tiktok.py", line 545, in byHashtag
id = self.getHashtagObject(hashtag)['challengeInfo']['challenge']['id']
KeyError: 'challengeInfo'

@DiegoMORENO-DS DiegoMORENO-DS added the bug Something isn't working label Sep 13, 2020
@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.87. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@davidteather davidteather changed the title [BUG] - Your Error Here [BUG] - KeyError: 'challengeInfo' Sep 13, 2020
@davidteather
Copy link
Owner

Please provide your OS and TikTokApi version.

If you're not on TikTokApi 3.5.0 or higher please upgrade with the following

pip install TikTokApi --upgrade

If you still run into issues, you may be sending too many requests. The code below will allow you to delay your requests automatically.

from TikTokApi import TikTokApi
request_delay_seconds = 1 # throttling requests 
api = TikTokApi(request_delay=request_delay_seconds)
hashtag = 'pasta'
hash1 = api.byHashtag(hashtag, count=10000, language='en', proxy=None)

@davidteather
Copy link
Owner

I think I fixed this in a recent update

@Etanial
Copy link

Etanial commented Oct 9, 2020

I used the API a lot in the last 24 hours, doing similar queries for hashtags as DiegoMORENO-DS. As of this morning, I am getting the challenge error above. I suspect it is related to number of requests over a given period. Adding the delay to the request did not help.

The API version is up to date. Here is the error:

`
~/anaconda3/lib/python3.7/site-packages/TikTokApi/tiktok.py in byHashtag(self, hashtag, count, **kwargs)
545 """
546 region, language, proxy, minCursor, maxCursor, maxCount = self.process_kwargs(kwargs)
--> 547 id = self.getHashtagObject(hashtag)['challengeInfo']['challenge']['id']
548 response = []
549

KeyError: 'challengeInfo'
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants