[tnaflixnetwork:embed] Add extractor

This commit is contained in:
Sergey M․ 2016-02-27 16:58:11 +06:00
parent f7f2e53a0a
commit d6e9c2706f
2 changed files with 26 additions and 1 deletions

View File

@ -737,6 +737,7 @@
TMZArticleIE, TMZArticleIE,
) )
from .tnaflix import ( from .tnaflix import (
TNAFlixNetworkEmbedIE,
TNAFlixIE, TNAFlixIE,
EMPFlixIE, EMPFlixIE,
MovieFapIE, MovieFapIE,

View File

@ -71,7 +71,7 @@ def get_child(elem, names):
def _real_extract(self, url): def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url) mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('id') video_id = mobj.group('id')
display_id = mobj.group('display_id') display_id = mobj.group('display_id') if 'display_id' in mobj.groupdict() else video_id
webpage = self._download_webpage(url, display_id) webpage = self._download_webpage(url, display_id)
@ -152,6 +152,30 @@ def extract_field(pattern, name):
} }
class TNAFlixNetworkEmbedIE(TNAFlixNetworkBaseIE):
_VALID_URL = r'https?://player\.(?:tna|emp)flix\.com/video/(?P<id>\d+)'
_TITLE_REGEX = r'<title>([^<]+)</title>'
_TESTS = [{
'url': 'https://player.tnaflix.com/video/6538',
'info_dict': {
'id': '6538',
'display_id': '6538',
'ext': 'mp4',
'title': 'Educational xxx video',
'thumbnail': 're:https?://.*\.jpg$',
'age_limit': 18,
},
'params': {
'skip_download': True,
},
}, {
'url': 'https://player.empflix.com/video/33051',
'only_matching': True,
}]
class TNAFlixIE(TNAFlixNetworkBaseIE): class TNAFlixIE(TNAFlixNetworkBaseIE):
_VALID_URL = r'https?://(?:www\.)?tnaflix\.com/[^/]+/(?P<display_id>[^/]+)/video(?P<id>\d+)' _VALID_URL = r'https?://(?:www\.)?tnaflix\.com/[^/]+/(?P<display_id>[^/]+)/video(?P<id>\d+)'