[tvanouvelles] Changed the regex. Also kept the original text encoding for the description and title.
This commit is contained in:
parent
e12ade612f
commit
7ca31fa7f6
@ -1,18 +1,19 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
|
|
||||||
|
|
||||||
class TVANouvellesIE(InfoExtractor):
|
class TVANouvellesIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://(www\.|)tvanouvelles\.(ca|com|qc)/.*.?/(?P<id>[^/]+)'
|
_VALID_URL = r'https?://[[\w].*]?tvanouvelles\.ca/.*?/(?P<id>[^/]+)/?$'
|
||||||
|
|
||||||
_TEST = {
|
_TEST = {
|
||||||
'url': 'http://www.tvanouvelles.ca/videos/5117035533001',
|
'url': 'http://www.tvanouvelles.ca/videos/5117035533001',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '5117035533001',
|
'id': '5117035533001',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'L\u2019industrie du taxi d\xe9nonce l\u2019entente entre Qu\xe9bec et Uber: explications',
|
'title': 'L’industrie du taxi dénonce l’entente entre Québec et Uber - explications',
|
||||||
'description': 'L\u2019industrie du taxi a unanimement a d\xe9nonc\xe9 l\u2019entente avec le gouvernement du Qu\xe9bec qui permet \xe0 l\u2019entreprise de covoiturage Uber de faire des affaires l\xe9galement dans le cadre d\u2019un projet pilote d\u2019un an.',
|
'description': '"L’industrie du taxi a unanimement a dénoncé l’entente avec le gouvernement du Québec qui permet à l’entreprise de covoiturage Uber de faire des affaires légalement dans le cadre d’un projet pilote d’un an.',
|
||||||
'uploader_id': '1741764581',
|
'uploader_id': '1741764581',
|
||||||
'timestamp': 1473352030,
|
'timestamp': 1473352030,
|
||||||
'upload_date': '20160908',
|
'upload_date': '20160908',
|
||||||
@ -26,5 +27,5 @@ class TVANouvellesIE(InfoExtractor):
|
|||||||
program_name = self._match_id(url)
|
program_name = self._match_id(url)
|
||||||
webpage = self._download_webpage(url, program_name)
|
webpage = self._download_webpage(url, program_name)
|
||||||
brightcove_id = self._search_regex(
|
brightcove_id = self._search_regex(
|
||||||
r'data-video-id\=(.+[0-9]?)', 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)
|
return self.url_result(self.BRIGHTCOVE_URL_TEMPLATE % brightcove_id, 'BrightcoveNew', brightcove_id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user