X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fcbsnews.py;h=79ddc20a09ca067922e25d315bd0fbdb03b0abf9;hb=ed56f260399728f1975dd30f4c8ee110cf106d84;hp=cabf7e73b981103d074486dd35c5b422d3d770da;hpb=874e05975b9dde433dc633f3060c3b9013775343;p=youtube-dl diff --git a/youtube_dl/extractor/cbsnews.py b/youtube_dl/extractor/cbsnews.py index cabf7e73b..79ddc20a0 100644 --- a/youtube_dl/extractor/cbsnews.py +++ b/youtube_dl/extractor/cbsnews.py @@ -1,15 +1,16 @@ # encoding: utf-8 from __future__ import unicode_literals -import re -import json +from .common import InfoExtractor +from .cbs import CBSBaseIE +from ..utils import ( + parse_duration, +) -from .theplatform import ThePlatformIE - -class CBSNewsIE(ThePlatformIE): +class CBSNewsIE(CBSBaseIE): IE_DESC = 'CBS News' - _VALID_URL = r'http://(?:www\.)?cbsnews\.com/(?:[^/]+/)+(?P[\da-z_-]+)' + _VALID_URL = r'https?://(?:www\.)?cbsnews\.com/(?:news|videos)/(?P[\da-z_-]+)' _TESTS = [ { @@ -48,14 +49,13 @@ class CBSNewsIE(ThePlatformIE): ] def _real_extract(self, url): - mobj = re.match(self._VALID_URL, url) - video_id = mobj.group('id') + video_id = self._match_id(url) webpage = self._download_webpage(url, video_id) - video_info = json.loads(self._html_search_regex( + video_info = self._parse_json(self._html_search_regex( r'(?: