from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( sanitized_Request, urlencode_postdata, ) class NFBIE(InfoExtractor): IE_NAME = 'nfb' IE_DESC = 'National Film Board of Canada' _VALID_URL = r'https?://(?:www\.)?(?:nfb|onf)\.ca/film/(?P[\da-z_-]+)' _TEST = { 'url': 'https://www.nfb.ca/film/qallunaat_why_white_people_are_funny', 'info_dict': { 'id': 'qallunaat_why_white_people_are_funny', 'ext': 'mp4', 'title': 'Qallunaat! Why White People Are Funny ', 'description': 'md5:836d8aff55e087d04d9f6df554d4e038', 'duration': 3128, 'uploader': 'Mark Sandiford', 'uploader_id': 'mark-sandiford', }, 'params': { # rtmp download 'skip_download': True, } } def _real_extract(self, url): video_id = self._match_id(url) page = self._download_webpage( 'https://www.nfb.ca/film/%s' % video_id, video_id, 'Downloading film page') uploader_id = self._html_search_regex(r'