iSarabjitDhiman / TweeterPy

TweeterPy is a python library to extract data from Twitter. TweeterPy API lets you scrape data from a user's profile like username, userid, bio, followers/followings list, profile media, tweets, etc.
MIT License
123 stars 17 forks source link

bug fix for empty array. #65

Open shioshio38 opened 1 month ago

shioshio38 commented 1 month ago

The following code may return an empty array.

reduce(dict.get, data_path, response) if item['type'] == 'TimelineAddEntries')

error code

  File "xxxxxxxx/ib/python3.10/site-packages/tweeterpy/tweeterpy.py", line 76, in _handle_pagination
    data = [item for item in reduce(
IndexError: list index out of range

To avoid errors, code was added to check if the array is empty or not.