sskender/pornhub-api
소개
PornHub.com 비공식 Python API
개발 도구측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalPornHub Unofficial API
Unofficial API for pornhub.com in Python
Pull requests are welcome!!!
I find it quite difficult to make time for an active development on this project, so I will be more than happy to merge your pull requests. Thank you all for supporting this project!
Install
pip3 install pornhubapi
How to use
Create client
import pornhub
client = pornhub.PornHub()
Create client with proxy
import pornhub
# With proxy, given a Proxy IP and Port. For the countries with restricted access like Turkey, etc.
client = pornhub.PornHub("5.135.164.72", 3128)
Grab stars
The request can be sorted by: view, trend, subs, alpha, videos, random
for star in client.getStars(10, sort_by="view"):
print(star)
print(star["name"])
Create client with search keywords
keywords = ["word1", "word2"]
client = pornhub.PornHub(keywords)
# if using a proxy
client = pornhub.PornHub(keywords, "5.135.164.72", 3128)
# or
client = pornhub.PornHub(ProxyIP="5.135.164.72", ProxyPort=3128, keywords=["word1", "word2"])
for video in client.getVideos(10, page=2):
print(video)
print(video["url"])
Sort Video by parameter
When keywords are set: view, rate, long, recent
keywords = ["word1", "word2"]
client = pornhub.PornHub(keywords)
for video in client.getVideos(10, page=2, sort_by="long"):
print(video)
print(video["url"])
When keywords are not set: view, rate, long, new, hot
client = pornhub.PornHub()
for video in client.getVideos(10, page=2, sort_by="hot"):
print(video)
print(video["url"])
Take full information about all videos
Parameter full_data allows you to get complete information about the video, but its much more slower due to every page needs to be opened
keywords = ["word1", "word2"]
client = pornhub.PornHub(keywords)
for video in client.getVideos(10, page=2, full_data=True):
print(video)
print(video["upload_date"])
Get more information about the single video
Method getVideo(url, viewkey) gives more detail information about a single video
client = pornhub.PornHub()
# You can input the full video url, like that
video = client.getVideo("https://www.pornhub.com/view_video.php?viewkey=SOMEKEY")
# Or that
video = client.getVideo(url="https://www.pornhub.com/view_video.php?viewkey=SOMEKEY")
# Or input only viewkey, like that
video = client.getVideo(viewkey="SOMEKEY")
print(video)
print(video["title"])
The method return a dictionary with keywords:
title(type: string) - Video titleviews(type: string) - Rounded number of views, for example "2M"accurate_views(type: integer) - Full number of views, for example "123456789". When video don't have many viewsviews=accurate_viewsrating(type: integer) - Video rating in percentduration(type: string) - Video duration in format "hh:mm:ss"loaded(type: string) - When the video was uploaded, for example "2 months ago"upload_date(type: string) - Video upload date in format "yyyy-mm-dd"likes(type: string) - Similar likeviewsaccurate_likes(type: integer) - Similar likeaccurate_viewsdislikes(type: string) - Similar likeviewsaccurate_dislikes(type: integer) - Similar likeaccurate_viewsfavorite(type: string) - How many times added to favorites, rounded. For example "2K"author(type: string) - Video author (channel)pornstars(type: list) - Video starscategories(type: list) - Video categoriestags(type: list) - Video tagsproduction(type: string) - Video production (Professional or Homemade)url(type: string) - URL to Videoimg_url(type: string) - URL to Preview Image of Videoembed_url(type: string) - URL to Video Player
If the video is not available in your country, in title will "Video not available in your country", in others keys will None
Contributors
SashaSZ |
Ibrahim Ipek |
Kittinan |
Елизаров Роман Русланович |
IThinkImOKAY |
License
MIT license
관련 프로젝트 살펴보기
불러오는 중…