mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-06 01:22:35 +00:00
[xvideos] Add video duration
This commit is contained in:
parent
b07ea5eaec
commit
13081db1f5
@ -8,6 +8,7 @@ from ..utils import (
|
|||||||
clean_html,
|
clean_html,
|
||||||
ExtractorError,
|
ExtractorError,
|
||||||
determine_ext,
|
determine_ext,
|
||||||
|
parse_duration,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -20,6 +21,7 @@ class XVideosIE(InfoExtractor):
|
|||||||
'id': '4588838',
|
'id': '4588838',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'Biker Takes his Girl',
|
'title': 'Biker Takes his Girl',
|
||||||
|
'duration': 120,
|
||||||
'age_limit': 18,
|
'age_limit': 18,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -36,6 +38,8 @@ 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(
|
||||||
|
r'<span class="duration">.*?(\d[^<]+)', webpage, 'duration', fatal=False))
|
||||||
|
|
||||||
formats = []
|
formats = []
|
||||||
|
|
||||||
@ -67,6 +71,7 @@ class XVideosIE(InfoExtractor):
|
|||||||
'id': video_id,
|
'id': video_id,
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
'title': video_title,
|
'title': video_title,
|
||||||
|
'duration': video_duration,
|
||||||
'thumbnail': video_thumbnail,
|
'thumbnail': video_thumbnail,
|
||||||
'age_limit': 18,
|
'age_limit': 18,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user