From 9c8236e0c4b72c260e947040550fbdc19dd0f8db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Kr=C3=BCger?= Date: Thu, 22 Jul 2021 13:36:09 +0200 Subject: [PATCH] [vidlox] Add new extractor --- youtube_dl/extractor/extractors.py | 1 + youtube_dl/extractor/vidlox.py | 46 ++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 youtube_dl/extractor/vidlox.py diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index 6e8fc3961..0cf41cc89 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -1427,6 +1427,7 @@ from .videomore import ( from .videopress import VideoPressIE from .vidio import VidioIE from .vidlii import VidLiiIE +from .vidlox import VIDLOXIE from .vidme import ( VidmeIE, VidmeUserIE, diff --git a/youtube_dl/extractor/vidlox.py b/youtube_dl/extractor/vidlox.py new file mode 100644 index 000000000..da72812c5 --- /dev/null +++ b/youtube_dl/extractor/vidlox.py @@ -0,0 +1,46 @@ +# coding: utf-8 +from __future__ import unicode_literals + +from .common import InfoExtractor + + +class VIDLOXIE(InfoExtractor): + IE_NAME = 'vidlox' + IE_DESC = 'vidlox' + _VALID_URL = r'https?://vidlox\.me/(embed-)?(?P[a-z0-9]+).html' + _TEST = { + 'url': 'https://vidlox.me/6wq8gciafziz.html', + 'info_dict': { + 'id': '6wq8gciafziz', + 'title': 'md5:74c82229b059846a82628e60dcc661b5', + 'ext': 'm3u8', + }, + } + + def _real_extract(self, url): + video_id = self._match_id(url) + + webpage = self._download_webpage( + 'https://vidlox.me/%s.html' % video_id, video_id) + + m3u8 = self._search_regex( + r'(https.+m3u8)', + webpage, 'm3u8') + + title = self._search_regex( + r'Watch (?P<title>.+)<\/title>', + webpage, 'title', group='title') + + thumbnail = self._search_regex( + r'spriteSheetUrl = "(?P<thumbnail>https.+)"', + webpage, 'thumbnail', group='thumbnail') + + formats = self._extract_m3u8_formats(m3u8, video_id) + self._sort_formats(formats) + + return { + 'id': video_id, + 'title': title, + 'formats': formats, + 'thumbnail': thumbnail, + }