EchterAlsFake / PHUB

A lightweight API for Pornhub
https://phub.rtfd.io
GNU General Public License v3.0
67 stars 22 forks source link
api downloader porn-download pornhub pornhub-api pornhub-downloader pornhub-scraper pornhubapi pornography python python3 scrapper-api webscraper xxx

Downloads PyPI version API Tests


PHUB is an easy-to-use API wrapper for Pornhub. It can access most used or useful PH features, such as video searching, account features, video downloading, and more.

[!WARNING] This project is probably against Pornhub TOS. Use at your own risks.

Installation

Usage from command line

# Download a single video
py -m phub https://www.pornhub.com/view_video.php?viewkey=abcdef
# Download multiple videos from a text file
py -m phub path/to/file.txt --quality best --downloader threaded --output video.mp4

Quickstart

[!NOTE] You can find the docs on this project here.

import phub
from phub.locals import *

# Initialise a client
client = phub.Client()

# Fetch and download a video
video = client.get('https://...')
video.download('my-video.mp4', Quality.BEST)

# Fetch user videos
user = client.get_user('this-user')
for video in user.videos:
    print(video.title)

# Perform a research
for video in client.search('my-query'):
    print(video.title)

# Connect to an account
client = phub.Client('my-username', 'my-password')

# Access account history, liked and recommended stuff
client.account.watched
client.account.liked
client.account.recommended

License

PHUB uses GPLv3. See the LICENSE file.

This repository was initiated and maintained by Egsagon He doesn't have any time to maintain this and transferred me the ownership. I'll do my best to maintain this repository functional.

Contributing

Feel free to contribute to this project by submitting feature requests, issues, bugs, or whatever.