EchterAlsFake / PHUB

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

Private videos - regexError #69

Open AlexPlay1 opened 3 hours ago

AlexPlay1 commented 3 hours ago

The package doesn't handle videos being private well, it just throws not that descriptive RegexError "Pattern failed".

EchterAlsFake commented 3 hours ago

Thanks for pointing that out!

Could you please provide us with a URL of such a video, so that I can create an exception class for it?

AlexPlay1 commented 3 hours ago

link

EchterAlsFake commented 2 hours ago

Thanks.

I don't think that the video is private. When I enter the URL PornHub shows me that the video is not available in my region. We actually already have a mechanism which should detect that, but it seems that it failed, so I hardened that.

Maybe PornHub gives you other information and for you it shows something like that it's private, but at least for me it doesn't. If you want you can try installing PHUB from git and see if it raises the "RegionBlocked" exception class.

You can do this by:

pip uninstall phub pip install git+https://github.com/EchterAlsFake/PHUB

AlexPlay1 commented 1 hour ago

see if it raises the "RegionBlocked" exception class. it does, but i checked with both my home ip and vpn, and both times it said that i need to have that user as a friend to watch the video

EchterAlsFake commented 1 hour ago

I tried with a turkish VPN too, but for me it still shows that it's not available in my country. Since you said it raises the issue I would leave it like that, because I can't really do anything about it now.

Basically the exception class searches for this little string in the HTML code:

<div id="js-player" class="videoGeoUnavailable">

Since the exception raised it means that it's not available for you anyways. I guess even if you would have that person as a friend. Maybe you can add him / her. I don't know if this is possible in your case.

Unfortunately I also can't just upload a video by myself, set it to private and investigate it with my own example, because you need a verified model account for uploading and you need to send your ID card and I am not 18, sooooooo yeeeah.

But thanks for your report anyways :)

AlexPlay1 commented 47 minutes ago

so here's the video wrapper code if it helps =) https://privatebin.net/?015340bbb150412a#EH5zupBS45SZSios1TS6hWhQw1q9T67B1B47CDNGEGrd