With the end of vacations for me, this project will probably remain unmaintained for a lot of time. That said, i will still view issues/PRs/discussions and try to answer to them or apply quick fixes, so don't hesitate to post there.
PHUB is an API wrapper for PornHub. It is able to fetch, search and download videos and supports account connections, achieved with efficient web scrapping using requests and regexes.
⚠️ This project is probably against Pornhub TOS.
- Install using pip (python 3.11 or higher required):
pip install --upgrade phub
- Or using this repository to get the latest features:
pip install --upgrade git+https://github.com/Egsagon/PHUB.git
You can use phub like so from the terminal as as CLI script:
python3 -m phub
Example for downloading a video knowing its url, in the best available quality:
python3 -m phub download --url https://www.pornhub.com/view_video.php?viewkey=xxx -q 'best'
You can use this masterpiece made by EchterAlsFake: EchterAlsFake/Porn_Fetch
Exemple for downloading a video:
import phub
client = phub.Client()
video = client.get('enter video URL here')
print('Downloading:', video.title)
# Download on working dir with best quality
video.download('.', quality = phub.Quality.BEST)
I don't plan to really maintain this after i start school, so feel free to support this project by submiting issues or requests and share the bugs you encountered in Known issues
You can find out more on the API in the docs.
GPLv3 - See the LICENSE
file.