From 27095000579be2d1d033d7fb9ff34b6a6ddea7b7 Mon Sep 17 00:00:00 2001 From: ngld Date: Fri, 2 Oct 2015 01:04:03 +0200 Subject: [PATCH 1/2] [sfdebris] Added new extractor --- youtube_dl/extractor/__init__.py | 1 + youtube_dl/extractor/sfdebris.py | 35 ++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 youtube_dl/extractor/sfdebris.py diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py index a73a1317e..fc05c46cd 100644 --- a/youtube_dl/extractor/__init__.py +++ b/youtube_dl/extractor/__init__.py @@ -534,6 +534,7 @@ from .senateisvp import SenateISVPIE from .servingsys import ServingSysIE from .sexu import SexuIE from .sexykarma import SexyKarmaIE +from .sfdebris import SfDebrisIE from .shahid import ShahidIE from .shared import SharedIE from .sharesix import ShareSixIE diff --git a/youtube_dl/extractor/sfdebris.py b/youtube_dl/extractor/sfdebris.py new file mode 100644 index 000000000..a0097aaaa --- /dev/null +++ b/youtube_dl/extractor/sfdebris.py @@ -0,0 +1,35 @@ +# encoding: utf-8 +from __future__ import unicode_literals + +from .common import InfoExtractor + + +class SfDebrisIE(InfoExtractor): + _VALID_URL = r'http://sfdebris\.com/videos/[a-z]+/(?P[a-z0-9\-]+)\.php' + _TEST = { + 'url': 'http://sfdebris.com/videos/animation/transformerss1e01.php', + 'info_dict': { + 'id': 'sfdebris-560c327f4d852', + 'ext': 'mp4', + 'title': 'Transformers: More Than Meets the Eye 1' + } + } + + def _real_extract(self, url): + display_id = self._match_id(url) + webpage = self._download_webpage(url, display_id) + + playerdata_url = self._search_regex( + r"src='(http://player\d?\.screenwavemedia\.com/(?:play/)?[a-zA-Z]+\.php\?[^']*\bid=.+?)'", + webpage, 'player data URL') + + video_title = self._html_search_regex( + r'
\s*

(?P.+?)</h1>\s*</div>', + webpage, 'title') + + return { + '_type': 'url_transparent', + 'display_id': display_id, + 'title': video_title, + 'url': playerdata_url, + } From ac1a0dec978ef0b6a0fce2ae221a9be191ce1d5a Mon Sep 17 00:00:00 2001 From: ngld <ngld@tproxy.de> Date: Fri, 2 Oct 2015 01:08:02 +0200 Subject: [PATCH 2/2] [sfdebris] The extractor can now grab thumbnails. --- youtube_dl/extractor/sfdebris.py | 1 + 1 file changed, 1 insertion(+) diff --git a/youtube_dl/extractor/sfdebris.py b/youtube_dl/extractor/sfdebris.py index a0097aaaa..bd811a289 100644 --- a/youtube_dl/extractor/sfdebris.py +++ b/youtube_dl/extractor/sfdebris.py @@ -32,4 +32,5 @@ class SfDebrisIE(InfoExtractor): 'display_id': display_id, 'title': video_title, 'url': playerdata_url, + 'thumbnail': 'http://sfdebris.com/images/links/%s.png' % display_id }