Added TVA Nouvelles to extractors.py. Also added the regex for TVA Nouvelles and added the attribute to get the video id.

This commit is contained in:
Jean-Nicolas Boulay 2016-09-10 19:59:56 -04:00 committed by Jean-Nicolas
parent c8ef47c6e3
commit dff32d0be6
2 changed files with 5 additions and 3 deletions

View File

@ -920,6 +920,7 @@ from .tv2 import (
)
from .tv3 import TV3IE
from .tv4 import TV4IE
from .tvanouvelles import TVANouvellesIE
from .tvc import (
TVCIE,
TVCArticleIE,

View File

@ -1,10 +1,11 @@
from __future__ import unicode_literals
from .common import InfoExtractor
from .youtube import YoutubeIE
class TVANouvellesIE(InfoExtractor):
_VALID_URL = r'https?://www\.tvanouvelles\.com/.*?'
_VALID_URL = r'https?://(www\.|)tvanouvelles\.(ca|com|qc)/.*.?/(?P<id>[^/]+)'
_TEST = {
'url': 'http://www.tvanouvelles.ca/videos/5117035533001',
@ -18,7 +19,7 @@ class TVANouvellesIE(InfoExtractor):
'upload_date': '20140919',
},
'add_ie': ['BrightcoveNew'],
'skip': 'Not accessible from Travis CI server',
}
BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/1741764581/default_default/index.html?videoId=%s'
@ -26,5 +27,5 @@ class TVANouvellesIE(InfoExtractor):
program_name = self._match_id(url)
webpage = self._download_webpage(url, program_name)
brightcove_id = self._search_regex(
r'RenderPagesVideo\(\'(.+?)\'', webpage, 'brightcove id')
r'data-video-id\=(.+[0-9]?)', webpage, 'brightcove id')
return self.url_result(self.BRIGHTCOVE_URL_TEMPLATE % brightcove_id, 'BrightcoveNew', brightcove_id)