mirror of
https://github.com/ytdl-org/ytdl-nightly.git
synced 2024-12-23 05:23:32 +01:00
[xvideos] Extract og:duration (closes #12828)
This commit is contained in:
parent
13081db1f5
commit
6ec371cd9e
@ -6,8 +6,9 @@ from .common import InfoExtractor
|
|||||||
from ..compat import compat_urllib_parse_unquote
|
from ..compat import compat_urllib_parse_unquote
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
clean_html,
|
clean_html,
|
||||||
ExtractorError,
|
|
||||||
determine_ext,
|
determine_ext,
|
||||||
|
ExtractorError,
|
||||||
|
int_or_none,
|
||||||
parse_duration,
|
parse_duration,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -21,7 +22,7 @@ class XVideosIE(InfoExtractor):
|
|||||||
'id': '4588838',
|
'id': '4588838',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'Biker Takes his Girl',
|
'title': 'Biker Takes his Girl',
|
||||||
'duration': 120,
|
'duration': 108,
|
||||||
'age_limit': 18,
|
'age_limit': 18,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -38,8 +39,11 @@ class XVideosIE(InfoExtractor):
|
|||||||
r'<title>(.*?)\s+-\s+XVID', webpage, 'title')
|
r'<title>(.*?)\s+-\s+XVID', webpage, 'title')
|
||||||
video_thumbnail = self._search_regex(
|
video_thumbnail = self._search_regex(
|
||||||
r'url_bigthumb=(.+?)&', webpage, 'thumbnail', fatal=False)
|
r'url_bigthumb=(.+?)&', webpage, 'thumbnail', fatal=False)
|
||||||
video_duration = parse_duration(self._search_regex(
|
video_duration = int_or_none(self._og_search_property(
|
||||||
r'<span class="duration">.*?(\d[^<]+)', webpage, 'duration', fatal=False))
|
'duration', webpage, default=None)) or parse_duration(
|
||||||
|
self._search_regex(
|
||||||
|
r'<span[^>]+class=["\']duration["\'][^>]*>.*?(\d[^<]+)',
|
||||||
|
webpage, 'duration', fatal=False))
|
||||||
|
|
||||||
formats = []
|
formats = []
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user