Skip to content

Commit 696183e

Browse files
piplongrundstftw
andauthored
[youporn] Extract duration (ytdl-org#28019)
Co-authored-by: Sergey M <dstftw@gmail.com>
1 parent f90d825 commit 696183e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

youtube_dl/extractor/youporn.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class YouPornIE(InfoExtractor):
2525
'title': 'Sex Ed: Is It Safe To Masturbate Daily?',
2626
'description': 'Love & Sex Answers: http://bit.ly/DanAndJenn -- Is It Unhealthy To Masturbate Daily?',
2727
'thumbnail': r're:^https?://.*\.jpg$',
28+
'duration': 210,
2829
'uploader': 'Ask Dan And Jennifer',
2930
'upload_date': '20101217',
3031
'average_rating': int,
@@ -153,6 +154,8 @@ def _real_extract(self, url):
153154
thumbnail = self._search_regex(
154155
r'(?:imageurl\s*=|poster\s*:)\s*(["\'])(?P<thumbnail>.+?)\1',
155156
webpage, 'thumbnail', fatal=False, group='thumbnail')
157+
duration = int_or_none(self._html_search_meta(
158+
'video:duration', webpage, 'duration', fatal=False))
156159

157160
uploader = self._html_search_regex(
158161
r'(?s)<div[^>]+class=["\']submitByLink["\'][^>]*>(.+?)</div>',
@@ -194,6 +197,7 @@ def extract_tag_box(regex, title):
194197
'title': title,
195198
'description': description,
196199
'thumbnail': thumbnail,
200+
'duration': duration,
197201
'uploader': uploader,
198202
'upload_date': upload_date,
199203
'average_rating': average_rating,

0 commit comments

Comments
 (0)