d60 / twikit

Twitter API Scraper | Without an API key | Twitter Internal API | Free | Twitter scraper | Twitter Bot

Home Page:https://twikit.readthedocs.io/en/latest/twikit.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

get_trends() easily got KeyError 'trend' when using category other than trending

CocoaRush opened this issue · comments

the error:
File "/usr/local/lib/python3.10/site-packages/twikit/client.py", line 2582, in get_trends
trend_info = item['item']['content']['trend']

I am wondering if some item may not have the key trend, it may need to do a key existing test, and only valid trend_info could be added to results.

commented

can't reproduce.