X-Git-Url: https://git.rapsys.eu/youtubedl/blobdiff_plain/b8d8e13c1f9e4d3cdd7d41c5c9d711a36dd5f9c3..5a9d00a5190582368d533f12db7638e735d7f7c8:/youtube_dl/extractor/tnaflix.py?ds=sidebyside
diff --git a/youtube_dl/extractor/tnaflix.py b/youtube_dl/extractor/tnaflix.py
index 7e6ec34..0c2f8f1 100644
--- a/youtube_dl/extractor/tnaflix.py
+++ b/youtube_dl/extractor/tnaflix.py
@@ -21,6 +21,8 @@ class TNAFlixNetworkBaseIE(InfoExtractor):
r'flashvars\.config\s*=\s*escape\("([^"]+)"',
r']+name="config\d?" value="([^"]+)"',
]
+ _HOST = 'tna'
+ _VKEY_SUFFIX = ''
_TITLE_REGEX = r']+name="title" value="([^"]+)"'
_DESCRIPTION_REGEX = r']+name="description" value="([^"]+)"'
_UPLOADER_REGEX = r']+name="username" value="([^"]+)"'
@@ -72,7 +74,13 @@ class TNAFlixNetworkBaseIE(InfoExtractor):
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('id')
- display_id = mobj.group('display_id') if 'display_id' in mobj.groupdict() else video_id
+ for display_id_key in ('display_id', 'display_id_2'):
+ if display_id_key in mobj.groupdict():
+ display_id = mobj.group(display_id_key)
+ if display_id:
+ break
+ else:
+ display_id = video_id
webpage = self._download_webpage(url, display_id)
@@ -81,8 +89,8 @@ class TNAFlixNetworkBaseIE(InfoExtractor):
if not cfg_url:
inputs = self._hidden_inputs(webpage)
- cfg_url = ('https://cdn-fck.tnaflix.com/tnaflix/%s.fid?key=%s&VID=%s&premium=1&vip=1&alpha'
- % (inputs['vkey'], inputs['nkey'], video_id))
+ cfg_url = ('https://cdn-fck.%sflix.com/%sflix/%s%s.fid?key=%s&VID=%s&premium=1&vip=1&alpha'
+ % (self._HOST, self._HOST, inputs['vkey'], self._VKEY_SUFFIX, inputs['nkey'], video_id))
cfg_xml = self._download_xml(
cfg_url, display_id, 'Downloading metadata',
@@ -91,7 +99,8 @@ class TNAFlixNetworkBaseIE(InfoExtractor):
formats = []
def extract_video_url(vl):
- return re.sub(r'speed=\d+', 'speed=', unescapeHTML(vl.text))
+ # Any URL modification now results in HTTP Error 403: Forbidden
+ return unescapeHTML(vl.text)
video_link = cfg_xml.find('./videoLink')
if video_link is not None:
@@ -192,18 +201,21 @@ class TNAFlixNetworkEmbedIE(TNAFlixNetworkBaseIE):
webpage)]
-class TNAFlixIE(TNAFlixNetworkBaseIE):
+class TNAEMPFlixBaseIE(TNAFlixNetworkBaseIE):
+ _DESCRIPTION_REGEX = r'(?s)>Description:[^>]+>(.+?)<'
+ _UPLOADER_REGEX = r'by\s*]+\bhref=["\']/profile/[^>]+>([^<]+)<'
+ _CATEGORIES_REGEX = r'(?s)]*>Categories:(.+?)'
+
+
+class TNAFlixIE(TNAEMPFlixBaseIE):
_VALID_URL = r'https?://(?:www\.)?tnaflix\.com/[^/]+/(?P[^/]+)/video(?P\d+)'
_TITLE_REGEX = r'(.+?) - (?:TNAFlix Porn Videos|TNAFlix\.com)'
- _DESCRIPTION_REGEX = r'(?s)>Description:[^>]+>(.+?)<'
- _UPLOADER_REGEX = r'\s*Verified Member\s*\s*(.+?)<'
- _CATEGORIES_REGEX = r'(?s)]*>Categories:(.+?)'
_TESTS = [{
# anonymous uploader, no categories
'url': 'http://www.tnaflix.com/porn-stars/Carmella-Decesare-striptease/video553878',
- 'md5': 'ecf3498417d09216374fc5907f9c6ec0',
+ 'md5': '7e569419fe6d69543d01e6be22f5f7c4',
'info_dict': {
'id': '553878',
'display_id': 'Carmella-Decesare-striptease',
@@ -228,7 +240,7 @@ class TNAFlixIE(TNAFlixNetworkBaseIE):
'duration': 164,
'age_limit': 18,
'uploader': 'bobwhite39',
- 'categories': ['Amateur Porn', 'Squirting Videos', 'Teen Girls 18+'],
+ 'categories': list,
}
}, {
'url': 'https://www.tnaflix.com/amateur-porn/bunzHD-Ms.Donk/video358632',
@@ -236,14 +248,15 @@ class TNAFlixIE(TNAFlixNetworkBaseIE):
}]
-class EMPFlixIE(TNAFlixNetworkBaseIE):
- _VALID_URL = r'https?://(?:www\.)?empflix\.com/videos/(?P.+?)-(?P[0-9]+)\.html'
+class EMPFlixIE(TNAEMPFlixBaseIE):
+ _VALID_URL = r'https?://(?:www\.)?empflix\.com/(?:videos/(?P.+?)-|[^/]+/(?P[^/]+)/video)(?P[0-9]+)'
- _UPLOADER_REGEX = r']+class="infoTitle"[^>]*>Uploaded By:(.+?)'
+ _HOST = 'emp'
+ _VKEY_SUFFIX = '-1'
_TESTS = [{
'url': 'http://www.empflix.com/videos/Amateur-Finger-Fuck-33051.html',
- 'md5': 'b1bc15b6412d33902d6e5952035fcabc',
+ 'md5': 'bc30d48b91a7179448a0bda465114676',
'info_dict': {
'id': '33051',
'display_id': 'Amateur-Finger-Fuck',
@@ -259,6 +272,9 @@ class EMPFlixIE(TNAFlixNetworkBaseIE):
}, {
'url': 'http://www.empflix.com/videos/[AROMA][ARMD-718]-Aoi-Yoshino-Sawa-25826.html',
'only_matching': True,
+ }, {
+ 'url': 'https://www.empflix.com/amateur-porn/Amateur-Finger-Fuck/video33051',
+ 'only_matching': True,
}]