diff options
author | Remita Amine <remitamine@gmail.com> | 2017-05-07 09:31:14 +0100 |
---|---|---|
committer | Remita Amine <remitamine@gmail.com> | 2017-05-07 09:31:14 +0100 |
commit | 52294cdda761ad08785e7118ae8e121ceef257ec (patch) | |
tree | eee60845f265fdd829c580730dae1d519ca081e2 | |
parent | 2eeb588efe9a7df4b2dcd90de9e461e8ff4a40fa (diff) |
[nbc] remove unused imports and extract permalink from modified urls
-rw-r--r-- | youtube_dl/extractor/nbc.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/youtube_dl/extractor/nbc.py b/youtube_dl/extractor/nbc.py index 3b31ca3ef..62db70b43 100644 --- a/youtube_dl/extractor/nbc.py +++ b/youtube_dl/extractor/nbc.py @@ -5,10 +5,8 @@ import re from .common import InfoExtractor from .theplatform import ThePlatformIE from .adobepass import AdobePassIE -from ..compat import compat_urllib_parse_urlparse from ..utils import ( find_xpath_attr, - lowercase_escape, smuggle_url, unescapeHTML, update_url_query, @@ -17,7 +15,7 @@ from ..utils import ( class NBCIE(AdobePassIE): - _VALID_URL = r'https?://(?:www\.)?nbc\.com/[^/]+/video/[^/]+/(?P<id>n?\d+)' + _VALID_URL = r'(?P<permalink>https?://(?:www\.)?nbc\.com/[^/]+/video/[^/]+/(?P<id>n?\d+))' _TESTS = [ { @@ -73,10 +71,10 @@ class NBCIE(AdobePassIE): ] def _real_extract(self, url): - video_id = self._match_id(url) + permalink, video_id = re.match(self._VALID_URL, url).groups() video_data = self._download_json( 'https://api.nbc.com/v3/videos', video_id, query={ - 'filter[permalink]': url, + 'filter[permalink]': permalink, })['data'][0]['attributes'] query = { 'mbr': 'true', |