From 7ca31fa7f6eeef9897290f95d461172e63fcbe0a Mon Sep 17 00:00:00 2001 From: Jean-Nicolas Date: Mon, 12 Sep 2016 20:28:12 -0400 Subject: [PATCH] [tvanouvelles] Changed the regex. Also kept the original text encoding for the description and title. --- youtube_dl/extractor/tvanouvelles.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/youtube_dl/extractor/tvanouvelles.py b/youtube_dl/extractor/tvanouvelles.py index 6c522f3dd..0a714810d 100644 --- a/youtube_dl/extractor/tvanouvelles.py +++ b/youtube_dl/extractor/tvanouvelles.py @@ -1,18 +1,19 @@ +# -*- coding: utf-8 -*- from __future__ import unicode_literals from .common import InfoExtractor class TVANouvellesIE(InfoExtractor): - _VALID_URL = r'https?://(www\.|)tvanouvelles\.(ca|com|qc)/.*.?/(?P[^/]+)' + _VALID_URL = r'https?://[[\w].*]?tvanouvelles\.ca/.*?/(?P[^/]+)/?$' _TEST = { 'url': 'http://www.tvanouvelles.ca/videos/5117035533001', 'info_dict': { 'id': '5117035533001', 'ext': 'mp4', - 'title': 'L\u2019industrie du taxi d\xe9nonce l\u2019entente entre Qu\xe9bec 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.', + 'title': 'L’industrie du taxi dénonce l’entente entre Québec et Uber - explications', + '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', 'timestamp': 1473352030, 'upload_date': '20160908', @@ -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'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)