From 9dd47ebbd7cbb341483c26031a72229cace1a461 Mon Sep 17 00:00:00 2001 From: carsten demming Date: Fri, 23 Feb 2018 20:01:20 +0100 Subject: [PATCH] - added vidello extractor --- youtube_dl/extractor/extractors.py | 1 + youtube_dl/extractor/vidello.py | 43 ++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 youtube_dl/extractor/vidello.py diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index b2a4893fe..40a66ea03 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -1206,6 +1206,7 @@ from .viceland import VicelandIE from .vidbit import VidbitIE from .viddler import ViddlerIE from .videa import VideaIE +from .vidello import VidelloIE from .videodetective import VideoDetectiveIE from .videofyme import VideofyMeIE from .videomega import VideoMegaIE diff --git a/youtube_dl/extractor/vidello.py b/youtube_dl/extractor/vidello.py new file mode 100644 index 000000000..cdbd0da85 --- /dev/null +++ b/youtube_dl/extractor/vidello.py @@ -0,0 +1,43 @@ +# coding: utf-8 +from __future__ import unicode_literals + +from .common import InfoExtractor + +from ..utils import ( + clean_html +) + +class VidelloIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?embed.vidello\.com/[0-9]/(?P[a-zA-Z0-9]+)/player.html' + _TEST = { + 'url': 'https://embed.vidello.com/2/t1umm637xb1ylgw4/player.html', + 'md5': '7a4d76ac74ef7724af4c6c3ecb5e0042', + 'info_dict': { + 'id': 't1umm637xb1ylgw4', + 'ext': 'mp4', + 'title': 'Vidello Hosting & Marketing', + 'description': "Start marketing your videos more effectively on \x03the web utilising vidello's premium hosting, streaming, \x03analytics & marketing features to grow your \x03online business fast." + } + } + + def _real_extract(self, url): + video_id = self._match_id(url) + webpage = self._download_webpage(url, video_id) + + vidello_settings = self._parse_json(self._search_regex( + r'vidello_'+video_id+'_settings\s*=\s*({.+});', webpage, 'vidello settings'), video_id) + + video_url = "" + video_sources = vidello_settings.get('player').get('clip').get('sources') or {} + for curr_entry in video_sources: + if curr_entry['type'] == "video/mp4": + video_url = "http://"+curr_entry["src"][2:] + title = vidello_settings.get('cta')[0].get('values').get('product_title') + description = clean_html(vidello_settings.get('cta')[0].get('values').get('product_desc')) + + return { + 'id': video_id, + 'title': title, + 'description': description, + 'url': video_url + }