projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
13081db
)
[xvideos] Extract og:duration (closes #12828)
author
Sergey M․
<dstftw@gmail.com>
Sun, 30 Apr 2017 11:11:29 +0000
(18:11 +0700)
committer
Sergey M․
<dstftw@gmail.com>
Sun, 30 Apr 2017 11:14:01 +0000
(18:14 +0700)
youtube_dl/extractor/xvideos.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/xvideos.py
b/youtube_dl/extractor/xvideos.py
index ce3a05e419dfa773b7bae2cc3035a407f0e48318..eca603028d9ac91cf98e3da6c3651444f1653730 100644
(file)
--- a/
youtube_dl/extractor/xvideos.py
+++ b/
youtube_dl/extractor/xvideos.py
@@
-6,8
+6,9
@@
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote
from ..utils import (
clean_html,
from ..compat import compat_urllib_parse_unquote
from ..utils import (
clean_html,
- ExtractorError,
determine_ext,
determine_ext,
+ ExtractorError,
+ int_or_none,
parse_duration,
)
parse_duration,
)
@@
-21,7
+22,7
@@
class XVideosIE(InfoExtractor):
'id': '4588838',
'ext': 'mp4',
'title': 'Biker Takes his Girl',
'id': '4588838',
'ext': 'mp4',
'title': 'Biker Takes his Girl',
- 'duration': 1
20
,
+ 'duration': 1
08
,
'age_limit': 18,
}
}
'age_limit': 18,
}
}
@@
-38,8
+39,11
@@
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))
+ video_duration = int_or_none(self._og_search_property(
+ 'duration', webpage, default=None)) or parse_duration(
+ self._search_regex(
+ r'<span[^>]+class=["\']duration["\'][^>]*>.*?(\d[^<]+)',
+ webpage, 'duration', fatal=False))
formats = []
formats = []