about summary refs log tree commit diff
diff options
context:
space:
mode:
authorpiplongrun <piplongrun@users.noreply.github.com>2021-02-21 17:19:37 +0100
committerGitHub <noreply@github.com>2021-02-21 23:19:37 +0700
commit696183e1333aa8f2f1241e149759edf410f94c79 (patch)
treeee962f2d5bdea862408475fef24f5a2123dfd5fe
parentf90d825a6be852b6a3fa39b0948cc9b94154963e (diff)
downloadyoutube-dl-696183e1333aa8f2f1241e149759edf410f94c79.tar.gz
youtube-dl-696183e1333aa8f2f1241e149759edf410f94c79.tar.xz
youtube-dl-696183e1333aa8f2f1241e149759edf410f94c79.zip
[youporn] Extract duration (#28019)
Co-authored-by: Sergey M <dstftw@gmail.com>
-rw-r--r--youtube_dl/extractor/youporn.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/youtube_dl/extractor/youporn.py b/youtube_dl/extractor/youporn.py
index 534270bac..2b5771828 100644
--- a/youtube_dl/extractor/youporn.py
+++ b/youtube_dl/extractor/youporn.py
@@ -25,6 +25,7 @@ class YouPornIE(InfoExtractor):
             'title': 'Sex Ed: Is It Safe To Masturbate Daily?',
             'description': 'Love & Sex Answers: http://bit.ly/DanAndJenn -- Is It Unhealthy To Masturbate Daily?',
             'thumbnail': r're:^https?://.*\.jpg$',
+            'duration': 210,
             'uploader': 'Ask Dan And Jennifer',
             'upload_date': '20101217',
             'average_rating': int,
@@ -153,6 +154,8 @@ class YouPornIE(InfoExtractor):
         thumbnail = self._search_regex(
             r'(?:imageurl\s*=|poster\s*:)\s*(["\'])(?P<thumbnail>.+?)\1',
             webpage, 'thumbnail', fatal=False, group='thumbnail')
+        duration = int_or_none(self._html_search_meta(
+            'video:duration', webpage, 'duration', fatal=False))
 
         uploader = self._html_search_regex(
             r'(?s)<div[^>]+class=["\']submitByLink["\'][^>]*>(.+?)</div>',
@@ -194,6 +197,7 @@ class YouPornIE(InfoExtractor):
             'title': title,
             'description': description,
             'thumbnail': thumbnail,
+            'duration': duration,
             'uploader': uploader,
             'upload_date': upload_date,
             'average_rating': average_rating,