From 536832c365dac561a1004b9baa59511b7356c644 Mon Sep 17 00:00:00 2001 From: Nathaniel Maman Date: Mon, 30 Jan 2017 01:02:50 +0200 Subject: [PATCH] [reshet] Add new extractor --- youtube_dl/extractor/extractors.py | 1 + youtube_dl/extractor/reshet.py | 35 ++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 youtube_dl/extractor/reshet.py diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index 2590b5e1b2a..4334a52c9fd 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -778,6 +778,7 @@ RENTVIE, RENTVArticleIE, ) +from .reshet import ReshetIE from .restudy import RestudyIE from .reuters import ReutersIE from .reverbnation import ReverbNationIE diff --git a/youtube_dl/extractor/reshet.py b/youtube_dl/extractor/reshet.py new file mode 100644 index 00000000000..c7ac4bdd93b --- /dev/null +++ b/youtube_dl/extractor/reshet.py @@ -0,0 +1,35 @@ +# coding: utf-8 +from .common import InfoExtractor + + +class ReshetIE(InfoExtractor): + _VALID_URL = r'http://(mood\.)?reshet\.tv/' + _TEST = { + 'url': 'http://reshet.tv/item/entertainment/the-voice/branded/skittles/clips/jimmy-47659/', + 'md5': 'b56f1f91915cc931389ad3ea1e90e61f', + 'info_dict': { + 'id': '5235248235001', + 'ext': 'mp4', + 'title': 'The Voice ישראל - הכירו את ג\'ימי החתול | רשת', + 'description': 'יש לנו כתב דיגיטל חדש ופרוע מאחורי הקלעים של The Voice ישראל . תגידו מיאו', + 'thumbnail': 'http://reshet.tv/wp-content/uploads/2016/12/Capture-1.jpg', + } + } + + def _real_extract(self, url): + webpage = self._download_webpage(url, 'video id') + video_id = self._html_search_regex(r'data-video-id=\'(\d+)\'', webpage, 'video id') + m3u8_url = 'http://c.brightcove.com/services/mobile/streaming/index/master.m3u8?videoId=' + video_id + formats = [] + formats.extend(self._extract_m3u8_formats(m3u8_url, video_id, 'mp4')) + title = self._og_search_title(webpage) + description = self._og_search_description(webpage) + thumbnail = self._og_search_thumbnail(webpage) + + return { + 'id': video_id, + 'formats': formats, + 'title': title, + 'description': description, + 'thumbnail': thumbnail + }