From ab0c9d8376aceecf077260b9aaba02ec6ae46c9b Mon Sep 17 00:00:00 2001 From: ealgase Date: Wed, 21 Nov 2018 11:55:35 -0500 Subject: [PATCH 1/2] [cpac] Add new extractor --- youtube_dl/extractor/extractors.py | 1 + 1 file changed, 1 insertion(+) diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index 87c7d8b0c..6ccbc62e5 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -230,6 +230,7 @@ from .commonprotocols import ( ) from .condenast import CondeNastIE from .corus import CorusIE +from .cpac import CpacIE from .cracked import CrackedIE from .crackle import CrackleIE from .criterion import CriterionIE From 6d5bf93a9ef4d214dba03f452e7e296e0792228f Mon Sep 17 00:00:00 2001 From: ealgase Date: Wed, 21 Nov 2018 12:00:50 -0500 Subject: [PATCH 2/2] [cpac] improve flake8 compliance --- youtube_dl/extractor/cpac.py | 37 ++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 youtube_dl/extractor/cpac.py diff --git a/youtube_dl/extractor/cpac.py b/youtube_dl/extractor/cpac.py new file mode 100644 index 000000000..b0a1adcde --- /dev/null +++ b/youtube_dl/extractor/cpac.py @@ -0,0 +1,37 @@ +# coding: utf-8 +from __future__ import unicode_literals + +from .common import InfoExtractor + +import json + + +class CpacIE(InfoExtractor): + IE_NAME = 'cpac' + _VALID_URL = r'https?://(?:www\.)?cpac\.ca/(.*)/programs/(.*)/(?P[0-9]+)' + _TEST = { + 'url': 'http://www.cpac.ca/en/programs/primetime-politics/episodes/65490909', + 'md5': 'cdbe2b9a46f24ddc0d137264b8c8b14d', + 'info_dict': { + 'id': '65490909', + 'ext': 'mp4', + 'title': 'Auditor General Targets Fighter Jet Program, CRA – November 20, 2018', + 'description': 'Full coverage of the latest round of auditor general reports on fighter jets, the Canadian Revenue Agency, and more. We hear from officials from the Office of the Auditor General, Defence Minister Harjit Sajjan, MPs, and taxpayers’ ombudsman Sherra Profit. \nWith the price gap growing between Canadian and American oil, we hear about the economic impact from Saskatchewan Energy and Natural Resources Minister Minister Bronwyn Eyre.\n', + } + } + + def _real_extract(self, url): + video_id = self._match_id(url) + webpage = self._download_webpage(url, video_id) + + raw_data = self._html_search_regex(r'