Merge pull request #5772 from frenchy1983/fix_tnaflix_regex

[TNAFlix] Allow dot (and more) in cat_id and display_id
This commit is contained in:
Sergey M. 2015-05-24 17:54:25 +05:00
commit b700055ba4
2 changed files with 34 additions and 26 deletions

View File

@ -10,7 +10,8 @@ class EMPFlixIE(TNAFlixIE):
_DESCRIPTION_REGEX = r'name="description" value="([^"]*)"' _DESCRIPTION_REGEX = r'name="description" value="([^"]*)"'
_CONFIG_REGEX = r'flashvars\.config\s*=\s*escape\("([^"]+)"' _CONFIG_REGEX = r'flashvars\.config\s*=\s*escape\("([^"]+)"'
_TEST = { _TESTS = [
{
'url': 'http://www.empflix.com/videos/Amateur-Finger-Fuck-33051.html', 'url': 'http://www.empflix.com/videos/Amateur-Finger-Fuck-33051.html',
'md5': 'b1bc15b6412d33902d6e5952035fcabc', 'md5': 'b1bc15b6412d33902d6e5952035fcabc',
'info_dict': { 'info_dict': {
@ -23,3 +24,4 @@ class EMPFlixIE(TNAFlixIE):
'age_limit': 18, 'age_limit': 18,
} }
} }
]

View File

@ -10,13 +10,14 @@ from ..utils import (
class TNAFlixIE(InfoExtractor): class TNAFlixIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?tnaflix\.com/(?P<cat_id>[\w-]+)/(?P<display_id>[\w-]+)/video(?P<id>\d+)' _VALID_URL = r'https?://(?:www\.)?tnaflix\.com/(?P<cat_id>[^/]+)/(?P<display_id>[^/]+)/video(?P<id>\d+)'
_TITLE_REGEX = r'<title>(.+?) - TNAFlix Porn Videos</title>' _TITLE_REGEX = r'<title>(.+?) - TNAFlix Porn Videos</title>'
_DESCRIPTION_REGEX = r'<h3 itemprop="description">([^<]+)</h3>' _DESCRIPTION_REGEX = r'<h3 itemprop="description">([^<]+)</h3>'
_CONFIG_REGEX = r'flashvars\.config\s*=\s*escape\("([^"]+)"' _CONFIG_REGEX = r'flashvars\.config\s*=\s*escape\("([^"]+)"'
_TEST = { _TESTS = [
{
'url': 'http://www.tnaflix.com/porn-stars/Carmella-Decesare-striptease/video553878', 'url': 'http://www.tnaflix.com/porn-stars/Carmella-Decesare-striptease/video553878',
'md5': 'ecf3498417d09216374fc5907f9c6ec0', 'md5': 'ecf3498417d09216374fc5907f9c6ec0',
'info_dict': { 'info_dict': {
@ -29,7 +30,12 @@ class TNAFlixIE(InfoExtractor):
'duration': 91, 'duration': 91,
'age_limit': 18, 'age_limit': 18,
} }
},
{
'url': 'https://www.tnaflix.com/amateur-porn/bunzHD-Ms.Donk/video358632',
'matching_only': True,
} }
]
def _real_extract(self, url): def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url) mobj = re.match(self._VALID_URL, url)