EchterAlsFake / PHUB

A lightweight API for Pornhub
https://phub.rtfd.io
GNU General Public License v3.0
67 stars 22 forks source link

phub.utils has no attribute "remove_video_ads" #10

Closed EchterAlsFake closed 12 months ago

EchterAlsFake commented 12 months ago

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

Egsagon commented 12 months ago

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.

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.

EchterAlsFake commented 12 months ago

Okay thanks :)

Egsagon commented 12 months ago

Leaving this open for visibility.

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

Egsagon commented 12 months ago

Should be fixed in v4