From f884ab0302496ce56607f141a1b817386c121dd3 Mon Sep 17 00:00:00 2001 From: Tim Schindler Date: Mon, 19 Oct 2015 17:27:16 +0200 Subject: [PATCH] [Oddshot] Add new extractor --- youtube_dl/extractor/__init__.py | 1 + youtube_dl/extractor/oddshot.py | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 youtube_dl/extractor/oddshot.py diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py index bd6eb6ae0..b0a9cb09f 100644 --- a/youtube_dl/extractor/__init__.py +++ b/youtube_dl/extractor/__init__.py @@ -434,6 +434,7 @@ from .nytimes import ( NYTimesArticleIE, ) from .nuvid import NuvidIE +from .oddshot import OddshotIE from .odnoklassniki import OdnoklassnikiIE from .oktoberfesttv import OktoberfestTVIE from .onionstudios import OnionStudiosIE diff --git a/youtube_dl/extractor/oddshot.py b/youtube_dl/extractor/oddshot.py new file mode 100644 index 000000000..a7afdaada --- /dev/null +++ b/youtube_dl/extractor/oddshot.py @@ -0,0 +1,32 @@ +# coding: utf-8 +from __future__ import unicode_literals + +from .common import InfoExtractor + + +class OddshotIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?oddshot\.tv/shot/(?P[0-9a-zA-Z\-]+)' + _TEST = { + 'url': 'http://oddshot.tv/shot/esl-joindotared-2015090519512597', + 'md5': '86011224866356657ea12dc43f2281df', + 'info_dict': { + 'id': 'esl-joindotared-2015090519512597', + 'ext': 'mp4', + 'title': 'ESLOne NY EU qualifiers w/ @DotaCapitalist & @Blitz_Dota - Oddshot', + 'thumbnail': 'https://d301dinc95ec5f.cloudfront.net/thumbs/esl-joindotared-2015090519512597.shot.thumb.jpg' + } + } + + def _real_extract(self, url): + video_id = self._match_id(url) + webpage = self._download_webpage(url, video_id) + + title = self._html_search_regex(r'(.*?)', webpage, 'title') + url = self._html_search_regex(r'