aboutsummaryrefslogtreecommitdiffstats
path: root/hypervideo_dl/extractor/xvideos.py
diff options
context:
space:
mode:
Diffstat (limited to 'hypervideo_dl/extractor/xvideos.py')
-rw-r--r--hypervideo_dl/extractor/xvideos.py32
1 files changed, 24 insertions, 8 deletions
diff --git a/hypervideo_dl/extractor/xvideos.py b/hypervideo_dl/extractor/xvideos.py
index 8fc6491..d5261b6 100644
--- a/hypervideo_dl/extractor/xvideos.py
+++ b/hypervideo_dl/extractor/xvideos.py
@@ -19,25 +19,41 @@ class XVideosIE(InfoExtractor):
(?:
(?:[^/]+\.)?xvideos2?\.com/video|
(?:www\.)?xvideos\.es/video|
- flashservice\.xvideos\.com/embedframe/|
+ (?:www|flashservice)\.xvideos\.com/embedframe/|
static-hw\.xvideos\.com/swf/xv-player\.swf\?.*?\bid_video=
)
(?P<id>[0-9]+)
'''
_TESTS = [{
- 'url': 'http://www.xvideos.com/video4588838/biker_takes_his_girl',
+ 'url': 'https://www.xvideos.com/video4588838/motorcycle_guy_cucks_influencer_steals_his_gf',
'md5': '14cea69fcb84db54293b1e971466c2e1',
'info_dict': {
'id': '4588838',
'ext': 'mp4',
- 'title': 'Biker Takes his Girl',
+ 'title': 'Motorcycle Guy Cucks Influencer, Steals his GF',
'duration': 108,
'age_limit': 18,
+ 'thumbnail': r're:^https://img-hw.xvideos-cdn.com/.+\.jpg',
+ }
+ }, {
+ # Broken HLS formats
+ 'url': 'https://www.xvideos.com/video65982001/what_s_her_name',
+ 'md5': 'b82d7d7ef7d65a84b1fa6965f81f95a5',
+ 'info_dict': {
+ 'id': '65982001',
+ 'ext': 'mp4',
+ 'title': 'what\'s her name?',
+ 'duration': 120,
+ 'age_limit': 18,
+ 'thumbnail': r're:^https://img-hw.xvideos-cdn.com/.+\.jpg',
}
}, {
'url': 'https://flashservice.xvideos.com/embedframe/4588838',
'only_matching': True,
}, {
+ 'url': 'https://www.xvideos.com/embedframe/4588838',
+ 'only_matching': True,
+ }, {
'url': 'http://static-hw.xvideos.com/swf/xv-player.swf?id_video=4588838',
'only_matching': True,
}, {
@@ -80,9 +96,7 @@ class XVideosIE(InfoExtractor):
def _real_extract(self, url):
video_id = self._match_id(url)
-
- webpage = self._download_webpage(
- 'https://www.xvideos.com/video%s/' % video_id, video_id)
+ webpage = self._download_webpage(url, video_id)
mobj = re.search(r'<h1 class="inlineError">(.+?)</h1>', webpage)
if mobj:
@@ -125,9 +139,11 @@ class XVideosIE(InfoExtractor):
r'setVideo([^(]+)\((["\'])(http.+?)\2\)', webpage):
format_id = kind.lower()
if format_id == 'hls':
- formats.extend(self._extract_m3u8_formats(
+ hls_formats = self._extract_m3u8_formats(
format_url, video_id, 'mp4',
- entry_protocol='m3u8_native', m3u8_id='hls', fatal=False))
+ entry_protocol='m3u8_native', m3u8_id='hls', fatal=False)
+ self._check_formats(hls_formats, video_id)
+ formats.extend(hls_formats)
elif format_id in ('urllow', 'urlhigh'):
formats.append({
'url': format_url,