Skip to main content

An API for PornHub

Project description

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.

: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 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:

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

phub-3.1.tar.gz (30.1 kB view hashes)

Uploaded Source

Built Distribution

phub-3.1-py3-none-any.whl (31.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page