From 407ae733ab24dbe4fdbd5b996aef6438f16834a2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jaime=20Marqui=CC=81nez=20Ferra=CC=81ndiz?= Date: Wed, 22 Jan 2014 11:06:03 +0100 Subject: [PATCH] =?utf8?q?[cspan]=20Make=20=E2=80=98www=E2=80=99=20optiona?= =?utf8?q?l=20and=20improve=20the=20regex=20for=20extracting=20the=20id=20?= =?utf8?q?(fixes=20#2194)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- youtube_dl/extractor/cspan.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/youtube_dl/extractor/cspan.py b/youtube_dl/extractor/cspan.py index a2cbd4d8d..521bbdee0 100644 --- a/youtube_dl/extractor/cspan.py +++ b/youtube_dl/extractor/cspan.py @@ -10,7 +10,7 @@ from ..utils import ( class CSpanIE(InfoExtractor): - _VALID_URL = r'http://www\.c-spanvideo\.org/program/(.*)' + _VALID_URL = r'http://(?:www\.)?c-spanvideo\.org/program/(?P.*)' IE_DESC = 'C-SPAN' _TEST = { 'url': 'http://www.c-spanvideo.org/program/HolderonV', @@ -24,9 +24,9 @@ class CSpanIE(InfoExtractor): def _real_extract(self, url): mobj = re.match(self._VALID_URL, url) - prog_name = mobj.group(1) + prog_name = mobj.group('name') webpage = self._download_webpage(url, prog_name) - video_id = self._search_regex(r'programid=(.*?)&', webpage, 'video id') + video_id = self._search_regex(r'prog(?:ram)?id=(.*?)&', webpage, 'video id') title = self._html_search_regex( r'\n\s*]*>(.*?)', webpage, 'title') -- 2.22.2