mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-21 20:46:36 -05:00
[escapist] Extract duration
This commit is contained in:
parent
29cad7ad13
commit
8237bec4f0
1 changed files with 4 additions and 0 deletions
|
@ -8,6 +8,7 @@
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
ExtractorError,
|
ExtractorError,
|
||||||
js_to_json,
|
js_to_json,
|
||||||
|
parse_duration,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,6 +26,7 @@ class EscapistIE(InfoExtractor):
|
||||||
'uploader': 'The Escapist Presents',
|
'uploader': 'The Escapist Presents',
|
||||||
'title': "Breaking Down Baldur's Gate",
|
'title': "Breaking Down Baldur's Gate",
|
||||||
'thumbnail': 're:^https?://.*\.jpg$',
|
'thumbnail': 're:^https?://.*\.jpg$',
|
||||||
|
'duration': 264,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,6 +43,7 @@ def _real_extract(self, url):
|
||||||
r"<h1\s+class='headline'>(.*?)</a>",
|
r"<h1\s+class='headline'>(.*?)</a>",
|
||||||
webpage, 'uploader', fatal=False)
|
webpage, 'uploader', fatal=False)
|
||||||
description = self._html_search_meta('description', webpage)
|
description = self._html_search_meta('description', webpage)
|
||||||
|
duration = parse_duration(self._html_search_meta('duration', webpage))
|
||||||
|
|
||||||
raw_title = self._html_search_meta('title', webpage, fatal=True)
|
raw_title = self._html_search_meta('title', webpage, fatal=True)
|
||||||
title = raw_title.partition(' : ')[2]
|
title = raw_title.partition(' : ')[2]
|
||||||
|
@ -105,6 +108,7 @@ def _add_format(name, cfg_url, quality):
|
||||||
'title': title,
|
'title': title,
|
||||||
'thumbnail': self._og_search_thumbnail(webpage),
|
'thumbnail': self._og_search_thumbnail(webpage),
|
||||||
'description': description,
|
'description': description,
|
||||||
|
'duration': duration,
|
||||||
}
|
}
|
||||||
|
|
||||||
if self._downloader.params.get('include_ads') and ad_formats:
|
if self._downloader.params.get('include_ads') and ad_formats:
|
||||||
|
|
Loading…
Reference in a new issue