📜  pornhub - Python (1)

📅  最后修改于: 2023-12-03 15:03:48.639000             🧑  作者: Mango

Pornhub-Python

pornhub-python

Introduction

Pornhub-Python is a Python API wrapper for the popular adult website, Pornhub. With this wrapper, developers can easily scrape and access data from Pornhub's vast database of user-generated content.

Installation

Install the package using pip:

pip install pornhub-python
Features
Get Videos
from pornhub import Pornhub

ph = Pornhub()

# Search for videos
videos = ph.search('big boobs')

# Get a video by its ID
video = ph.get_video_by_id('123456')

# Get a video's comments
comments = ph.get_comments(video)
Get Pornstars
from pornhub import Pornhub

ph = Pornhub()

# Search for Pornstars
pornstars = ph.search_pornstars('Lisa Ann')

# Get a Pornstar by her ID
pornstar = ph.get_pornstar_by_id('abcdef')

# Get a Pornstar's videos
videos = ph.get_pornstar_videos(pornstar)
Get Categories
from pornhub import Pornhub

ph = Pornhub()

# Get all categories
categories = ph.get_categories()

# Get a category by its name
category = ph.get_category('MILF')

# Get a category's videos
videos = ph.get_category_videos(category)
Examples
Get the titles of the top 5 most viewed videos
from pornhub import Pornhub

ph = Pornhub()

videos = ph.get_most_viewed()
for video in videos[:5]:
    print(video.title)
Download a Video
from pornhub import Pornhub

ph = Pornhub()

video = ph.get_video_by_id('123456')
url = video.download()
Conclusion

Pornhub-Python provides an easy-to-use Python wrapper for accessing Pornhub's database of user-generated content. Developers can utilize this wrapper to create innovative applications and tools for adult entertainment.