📅  最后修改于: 2023-12-03 15:03:48.639000             🧑  作者: Mango
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.
Install the package using pip:
pip install pornhub-python
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)
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)
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)
from pornhub import Pornhub
ph = Pornhub()
videos = ph.get_most_viewed()
for video in videos[:5]:
print(video.title)
from pornhub import Pornhub
ph = Pornhub()
video = ph.get_video_by_id('123456')
url = video.download()
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.