projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b07ea5e
)
[xvideos] Add video duration
author
Sander
<sander@plex.tv>
Sun, 23 Apr 2017 21:49:41 +0000
(23:49 +0200)
committer
Sergey M․
<dstftw@gmail.com>
Sun, 30 Apr 2017 11:10:49 +0000
(18:10 +0700)
youtube_dl/extractor/xvideos.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/xvideos.py
b/youtube_dl/extractor/xvideos.py
index 30825daae956e12f450e32bc66aea737a5c293e0..ce3a05e419dfa773b7bae2cc3035a407f0e48318 100644
(file)
--- a/
youtube_dl/extractor/xvideos.py
+++ b/
youtube_dl/extractor/xvideos.py
@@
-8,6
+8,7
@@
from ..utils import (
clean_html,
ExtractorError,
determine_ext,
clean_html,
ExtractorError,
determine_ext,
+ parse_duration,
)
)
@@
-20,6
+21,7
@@
class XVideosIE(InfoExtractor):
'id': '4588838',
'ext': 'mp4',
'title': 'Biker Takes his Girl',
'id': '4588838',
'ext': 'mp4',
'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')
video_thumbnail = self._search_regex(
r'url_bigthumb=(.+?)&', webpage, 'thumbnail', fatal=False)
r'<title>(.*?)\s+-\s+XVID', webpage, 'title')
video_thumbnail = self._search_regex(
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,
'formats': formats,
'title': video_title,
'id': video_id,
'formats': formats,
'title': video_title,
+ 'duration': video_duration,
'thumbnail': video_thumbnail,
'age_limit': 18,
}
'thumbnail': video_thumbnail,
'age_limit': 18,
}