From 2d15981b4c0d05cbda023ca4230f983ee77e15f5 Mon Sep 17 00:00:00 2001 From: Dan Date: Tue, 7 Mar 2023 20:23:43 +0000 Subject: [PATCH] Added support for Bunkr.is --- youtube_dl/extractor/bunkr.py | 30 ++++++++++++++++++++++++++++++ youtube_dl/extractor/extractors.py | 1 + 2 files changed, 31 insertions(+) create mode 100644 youtube_dl/extractor/bunkr.py diff --git a/youtube_dl/extractor/bunkr.py b/youtube_dl/extractor/bunkr.py new file mode 100644 index 000000000..e8f67fa05 --- /dev/null +++ b/youtube_dl/extractor/bunkr.py @@ -0,0 +1,30 @@ +# coding: utf-8 +from __future__ import unicode_literals + +from .common import InfoExtractor + + +class BunkrExtractor(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?media-files.bunkr\.ru/(?P[0-9]+)' + _TEST = { + 'url': ' https://media-files.bunkr.ru/miera2000-(18)-xXmlmXQU.mp4', + 'md5': 'TODO: md5 sum of the first 10241 bytes of the video file (use --test)', + 'info_dict': { + 'id': '42', + 'ext': 'mp4', + 'title': 'miera2000-(18)-xXmlmXQU', + 'thumbnail': r're:^https?://.*\.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') + return { + 'id': video_id, + 'title': title, + 'description': self._og_search_description(webpage), + 'uploader': self._search_regex(r']+id="uploader"[^>]*>([^<]+)<', webpage, 'uploader', fatal=False), + } \ No newline at end of file diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index 3a87f9e33..73e3c5420 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -1682,3 +1682,4 @@ from .pr0gramm import ( Pr0grammIE, Pr0grammStaticIE, ) +from .bunkr import BunkrExtractor