1
0
Fork 0
mirror of https://github.com/blackjack4494/yt-dlc.git synced 2024-12-23 00:07:49 +00:00

[traileraddict]: Support clips urls and more trailer urls

This commit is contained in:
Jaime Marquínez Ferrándiz 2013-07-24 10:43:44 +02:00
parent 32a09b4382
commit 16484d4923

View file

@ -4,7 +4,7 @@ from .common import InfoExtractor
class TrailerAddictIE(InfoExtractor): class TrailerAddictIE(InfoExtractor):
_VALID_URL = r'(?:http://)?(?:www\.)?traileraddict\.com/trailer/([^/]+)/(?:[^/]*trailer[^/]*)' _VALID_URL = r'(?:http://)?(?:www\.)?traileraddict\.com/(?:trailer|clip)/(?P<movie>.+?)/(?P<trailer_name>.+)'
_TEST = { _TEST = {
u'url': u'http://www.traileraddict.com/trailer/prince-avalanche/trailer', u'url': u'http://www.traileraddict.com/trailer/prince-avalanche/trailer',
u'file': u'76184.mp4', u'file': u'76184.mp4',
@ -17,8 +17,8 @@ class TrailerAddictIE(InfoExtractor):
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(1) name = mobj.group('movie') + '/' + mobj.group('trailer_name')
webpage = self._download_webpage(url, video_id) webpage = self._download_webpage(url, name)
title = self._search_regex(r'<title>(.+?)</title>', title = self._search_regex(r'<title>(.+?)</title>',
webpage, 'video title').replace(' - Trailer Addict','') webpage, 'video title').replace(' - Trailer Addict','')