Closed EchterAlsFake closed 1 year ago
hey
Thats what ive been thinking about before fixing #3 with a0c5572fe578014226099e10c82c911b19197033 (which is the exact inverse from your PR).
however, your solution does not entirely fix everything, e.g. q = Quality(Quality('best'))
does not work anymore.
"PyCharm told me, that the .new value is not defined, so I removed it."
Are you talking about the __new__
method?
The original Quality object was made on the fly and is full of bugs, i've been rewriting it with dataclasses and i'll commit it in a minute, should be all clean. Now, all these options should work once package updated:
q = Quality('best')
q = Quality.BEST
q = Quality(Quality('best')
# etc.
Additionnaly, Video objects now constantly try to pre-transform reveived qualities to Quality objects, so you can also do something like that:
video.download(..., quality = 'best')
Thanks for pointing out tho, this object was an atrocity and i had totally forgot about it
Hi,
When I tried to download a video with a simple script like this:
from phub import Client, Quality url = "https://de.pornhub.com/view_video.php?viewkey=64c73f8307b2a" client = Client(language="en") video = client.get(url) video.download(quality=Quality.WORST, path="./")
I got this error:
raise TypeError('Internal error: quality type is', type(self.value)) TypeError: ('Internal error: quality type is', <class 'phub.utils.Quality'>)
When I looked into the utils.py PyCharm told me, that the .new value is not defined, so I removed it. Issue was not fixed, but after removing the presets further down it was. I don't know why, and I don't know if this is a good and stable solution or if it breaks anything, but I hope I could helped with it.
At least the video was downloaded successfully with this changes.