1
0
mirror of https://github.com/l1ving/youtube-dl synced 2024-11-20 19:42:59 +08:00

[hellporno] Add support for hellporno.net and improve ext extraction

This commit is contained in:
Andy Savicki 2016-11-20 02:12:22 +03:00 committed by Sergey M․
parent 1d6ae5628f
commit 868630fbe5
No known key found for this signature in database
GPG Key ID: 2C393E0F18A9236D

View File

@ -6,12 +6,13 @@ from .common import InfoExtractor
from ..utils import ( from ..utils import (
js_to_json, js_to_json,
remove_end, remove_end,
determine_ext,
) )
class HellPornoIE(InfoExtractor): class HellPornoIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?hellporno\.com/videos/(?P<id>[^/]+)' _VALID_URL = r'https?://(?:www\.)?hellporno\.(?:com/videos|net/v)/(?P<id>[^/]+)'
_TEST = { _TESTS = [{
'url': 'http://hellporno.com/videos/dixie-is-posing-with-naked-ass-very-erotic/', 'url': 'http://hellporno.com/videos/dixie-is-posing-with-naked-ass-very-erotic/',
'md5': '1fee339c610d2049699ef2aa699439f1', 'md5': '1fee339c610d2049699ef2aa699439f1',
'info_dict': { 'info_dict': {
@ -22,7 +23,10 @@ class HellPornoIE(InfoExtractor):
'thumbnail': 're:https?://.*\.jpg$', 'thumbnail': 're:https?://.*\.jpg$',
'age_limit': 18, 'age_limit': 18,
} }
} }, {
'url': 'http://hellporno.net/v/186271/',
'only_matching': True,
}]
def _real_extract(self, url): def _real_extract(self, url):
display_id = self._match_id(url) display_id = self._match_id(url)
@ -38,7 +42,7 @@ class HellPornoIE(InfoExtractor):
video_id = flashvars.get('video_id') video_id = flashvars.get('video_id')
thumbnail = flashvars.get('preview_url') thumbnail = flashvars.get('preview_url')
ext = flashvars.get('postfix', '.mp4')[1:] ext = determine_ext(flashvars.get('postfix'), 'mp4')
formats = [] formats = []
for video_url_key in ['video_url', 'video_alt_url']: for video_url_key in ['video_url', 'video_alt_url']: