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


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.2.tar.gz (30.4 kB view details)

Uploaded Source

Built Distribution

phub-3.1.2-py3-none-any.whl (32.1 kB view details)

Uploaded Python 3

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

Hashes for phub-3.1.2.tar.gz
Algorithm Hash digest
SHA256 d8dd11aac73fd1a68761ed4b792a6c794a9755471f392244ac081eb0838e61f6
MD5 5ba8ff59ebe2d05e4917ac8cc0053bd1
BLAKE2b-256 4c55a8e59a163a297d104c50bab615643ddeb021ab7d12b37de17096aceb05cb

See more details on using hashes here.

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

Hashes for phub-3.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 64fa2654342da30e345aa72094aa55111ef146e463539511d14763e3ebe3922a
MD5 c843da7ba6398a4c498ecbf00c324beb
BLAKE2b-256 fbf889a339d4ccef52f3c19033efbaa4d8b19bb739a67b2786ea233f3fd24f54

See more details on using hashes here.

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