This commit is contained in:
scrat5h 2024-04-28 10:17:38 +05:30 committed by GitHub
commit 02350ed97e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 19 additions and 4 deletions

View File

@ -12,6 +12,7 @@ from ..networking.exceptions import HTTPError
from ..utils import (
NO_DEFAULT,
ExtractorError,
base_url,
clean_html,
determine_ext,
format_field,
@ -24,6 +25,7 @@ from ..utils import (
update_url_query,
url_or_none,
urlencode_postdata,
urljoin,
)
@ -138,12 +140,14 @@ class PornHubIE(PornHubBaseIE):
_EMBED_REGEX = [r'<iframe[^>]+?src=["\'](?P<url>(?:https?:)?//(?:www\.)?pornhub(?:premium)?\.(?:com|net|org)/embed/[\da-z]+)']
_TESTS = [{
'url': 'http://www.pornhub.com/view_video.php?viewkey=648719015',
'md5': 'a6391306d050e4547f62b3f485dd9ba9',
'md5': '4d4a4e9178b655776f86cf89ecaf0edf',
'info_dict': {
'id': '648719015',
'ext': 'mp4',
'thumbnail': r're:^https://.i\.phncdn\.com/videos/201306/28/14084201/original/.*\.jpg',
'title': 'Seductive Indian beauty strips down and fingers her pink pussy',
'uploader': 'Babes',
'uploader': 'BABES-COM',
'uploader_id': '/users/babes-com',
'upload_date': '20130628',
'timestamp': 1372447216,
'duration': 361,
@ -208,11 +212,22 @@ class PornHubIE(PornHubBaseIE):
'url': 'http://www.pornhub.com/view_video.php?viewkey=ph601dc30bae19a',
'info_dict': {
'id': 'ph601dc30bae19a',
'ext': 'mp4',
'uploader': 'Projekt Melody',
'uploader_id': 'projekt-melody',
'upload_date': '20210205',
'title': '"Welcome to My Pussy Mansion" - CB Stream (02/03/21)',
'thumbnail': r're:https?://.+',
'age_limit': 18,
'view_count': int,
'cast': [],
'like_count': int,
'comment_count': int,
'dislike_count': int,
'timestamp': 1612564932,
'duration': 8173,
'categories': list,
'tags': list,
},
}, {
'url': 'http://www.pornhub.com/view_video.php?viewkey=ph557bbb6676d2d',
@ -318,10 +333,10 @@ class PornHubIE(PornHubBaseIE):
r'var\s+flashvars_\d+\s*=\s*({.+?});', webpage, 'flashvars', default='{}'),
video_id)
if flashvars:
subtitle_url = url_or_none(flashvars.get('closedCaptionsFile'))
subtitle_url = flashvars.get('closedCaptionsFile')
if subtitle_url:
subtitles.setdefault('en', []).append({
'url': subtitle_url,
'url': urljoin(base_url(url), subtitle_url),
'ext': 'srt',
})
thumbnail = flashvars.get('image_url')