From 0d709f8b9068b4fea1a3709d399ec8148ffc5db4 Mon Sep 17 00:00:00 2001 From: TRox1972 Date: Sun, 22 May 2016 17:26:28 +0200 Subject: [PATCH] [Pix11] add new extractor --- youtube_dl/extractor/extractors.py | 1 + youtube_dl/extractor/pix11.py | 32 ++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 youtube_dl/extractor/pix11.py diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index c93cd2765..24b364089 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -581,6 +581,7 @@ from .philharmoniedeparis import PhilharmonieDeParisIE from .phoenix import PhoenixIE from .photobucket import PhotobucketIE from .pinkbike import PinkbikeIE +from .pix11 import Pix11IE from .pladform import PladformIE from .played import PlayedIE from .playfm import PlayFMIE diff --git a/youtube_dl/extractor/pix11.py b/youtube_dl/extractor/pix11.py new file mode 100644 index 000000000..b287ac6cb --- /dev/null +++ b/youtube_dl/extractor/pix11.py @@ -0,0 +1,32 @@ +# coding: utf-8 +from __future__ import unicode_literals + +import re + +from .common import InfoExtractor +from .ooyala import OoyalaIE + + +class Pix11IE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?pix11\.com/\d{4}/(?:\d{2}/){2}(?P[a-z0-9-]+)' + _TEST = { + 'url': 'http://pix11.com/2016/05/05/donald-trump-on-cinco-de-mayo-i-love-hispanics/', + 'info_dict': { + 'id': 'hqbXBiMzE6O3im1B98VpANYppaJMcuY9', + 'ext': 'mp4', + 'title': 'Donald Trump on Cinco de Mayo: `I love Hispanics!`', + 'duration': 53.62, + }, + 'params': { + # m3u8 download + 'skip_download': True, + } + } + + def _real_extract(self, url): + mobj = re.match(self._VALID_URL, url) + display_id = mobj.group('display_id') + webpage = self._download_webpage(url, display_id) + + return OoyalaIE._build_url_result(self._search_regex( + r'"ooyalaplayer-1",\s*"(\w{32})"', webpage, 'ooyala id'))