EchterAlsFake/PHUB

Index Error on get_user.videos

Closed this issue · 2 comments

Hi,

One of my users had an Issue with the model / user function. He tried to get all videos from this model:

https://cn.pornhub.com/model/ada-kham

Everything worked fine, but after 61 fetched videos an Index Error appeared:

Traceback (most recent call last):
  File "/home/asuna/PycharmProjects/Porn_Fetch/test.py", line 7, in <module>
    for video in videos:
  File "/home/asuna/PycharmProjects/Porn_Fetch/venv/lib/python3.11/site-packages/phub/objects/query.py", line 77, in __next__
    return self.get(self.iter_index)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/asuna/PycharmProjects/Porn_Fetch/venv/lib/python3.11/site-packages/phub/objects/query.py", line 90, in get
    raw = self._get_page(index // self.PAGE_LENGTH)[index % self.PAGE_LENGTH]
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range

Sometimes the Index Error appears and sometimes it doesn't, but it ends in 61 videos. I tested it with multiple channels and sometimes it is able to fetch all videos. (For example Elly Clutch, but still thows the Index Error.)

Hi,

Pretty sure this was fixed with adff583. Did you use the latest PHUB version?

Fixed, Thank you so much :)