Skip to content
/ PHUB Public
forked from EchterAlsFake/PHUB

An API for Pornhub with video downloading

License

Notifications You must be signed in to change notification settings

EmadXD/PHUB

 
 

Repository files navigation

PHUB

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.

⚠️ 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 the provided UI if you have tkinter installed:

python3 -m phub ui

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:

record = client.search('enter query here')

# Display all videos (careful if there is a lot of results)
for video in record.range(0, 10):
  print(video.title)

Documentation

See the wiki.

Why?

This project was made as an enhancement for pfetch, which aimed at downloading videos from PornHub.

About

An API for Pornhub with video downloading

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%