EchterAlsFake/PHUB

phub.utils has no attribute "remove_video_ads"

EchterAlsFake opened this issue · 4 comments

Hey,

I got this error here:

Traceback (most recent call last):
  File "/home/asuna/PycharmProjects/Porn_Fetch/test.py", line 6, in <module>
    videos = client.get_user(url).videos
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/functools.py", line 1001, in __get__
    val = self.func(instance)
          ^^^^^^^^^^^^^^^^^^^
  File "/home/asuna/PycharmProjects/Porn_Fetch/venv/lib/python3.11/site-packages/phub/classes.py", line 127, in videos
    corrector = utils.remove_video_ads
                ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'phub.utils' has no attribute 'remove_video_ads'

This was the test code I used

import phub

url = "https://de.pornhub.com/model/realtelarilove" # Tried with multiple channels / models

client = phub.Client()
videos = client.get_user(url).videos

for video in videos:
    print(video.title)

API Version is the v3.2.2

Hi, PH changed a bunch of things that makes some features not work anymore.

If you really want this fixed now, here is another patch.

  • delete phub/classes.py, line 129
  • change phub/classes.py, line 594 to self.videos = consts.regexes.extract_videos(raw.split('videoSection')[1])

This patch will make your script work, but other features like searching will fail, because there has been no difference for user videos and search results so far in PHUB3. Ive started working on PHUB4 again but it will take a really long time, sorry.

Okay thanks :)

Leaving this open for visibility.

if you want to help on PHUB4, check out the v4 branch so it can be finished faster!

Should be fixed in v4