From 6d5bf93a9ef4d214dba03f452e7e296e0792228f Mon Sep 17 00:00:00 2001 From: ealgase Date: Wed, 21 Nov 2018 12:00:50 -0500 Subject: [PATCH] [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'