An API for PornHub
Project description
PHUB - An API for PornHub.
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.
:warning: Early development + not maintained a lot don't hesitate to submit issues and PRs
Installation
- Install using pip (python 3.11 or higher required):
pip install --upgrade phub
- Or using this repository to get latest features:
pip install --upgrade git+https://github.com/Egsagon/PHUB.git
CLI usage
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 also use this beautiful UI made by EchterAlsFake: EchterAlsFake/Porn_Fetch
Package usage
Example video download usage:
import phub
client = phub.Client()
video = client.get('enter video URL here')
# Download on working dir with maximum quality
video.download('.', quality = phub.Quality.BEST)
Example searching for videos:
query = client.search('enter query here')
# Display videos from 0 to 10
for video in query[:10]:
print(video.title)
Documentation
See here (working on it).
Why?
This project was made as an enhancement for pfetch, which aimed at downloading videos from PornHub.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file phub-3.1.2.tar.gz
.
File metadata
- Download URL: phub-3.1.2.tar.gz
- Upload date:
- Size: 30.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8dd11aac73fd1a68761ed4b792a6c794a9755471f392244ac081eb0838e61f6 |
|
MD5 | 5ba8ff59ebe2d05e4917ac8cc0053bd1 |
|
BLAKE2b-256 | 4c55a8e59a163a297d104c50bab615643ddeb021ab7d12b37de17096aceb05cb |
File details
Details for the file phub-3.1.2-py3-none-any.whl
.
File metadata
- Download URL: phub-3.1.2-py3-none-any.whl
- Upload date:
- Size: 32.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64fa2654342da30e345aa72094aa55111ef146e463539511d14763e3ebe3922a |
|
MD5 | c843da7ba6398a4c498ecbf00c324beb |
|
BLAKE2b-256 | fbf889a339d4ccef52f3c19033efbaa4d8b19bb739a67b2786ea233f3fd24f54 |