From e0b31dafc751be8ea91ae9318f4a9c1cefc02ce3 Mon Sep 17 00:00:00 2001 From: Ronni Date: Mon, 20 Feb 2023 20:39:31 +0100 Subject: [PATCH] [erocast] Add new extractor for erocast.me --- youtube_dl/extractor/erocast.py | 48 ++++++++++++++++++++++++++++++ youtube_dl/extractor/extractors.py | 2 ++ 2 files changed, 50 insertions(+) create mode 100644 youtube_dl/extractor/erocast.py diff --git a/youtube_dl/extractor/erocast.py b/youtube_dl/extractor/erocast.py new file mode 100644 index 000000000..8ece447a9 --- /dev/null +++ b/youtube_dl/extractor/erocast.py @@ -0,0 +1,48 @@ +# coding: utf-8 +from __future__ import unicode_literals + +from .common import InfoExtractor + + +class ErocastIE(InfoExtractor): + IE_NAME = 'erocast' + _VALID_URL = r'https?://(?:www\.)?erocast\.me/track/(?P[0-9]+)/(?P[0-9a-zA-Z_-]+)' + _TEST = { + 'url': 'https://erocast.me/track/6508/piano-sample-by-ytdl', + 'md5': '6764726b2d19161e93c9cf3a9a69800a', + 'info_dict': { + 'id': '6508', + 'ext': 'mp4', + 'title': 'Piano sample by ytdl', + 'uploader': 'ytdl', + } + } + + def _real_extract(self, url): + video_id = self._match_id(url) + webpage = self._download_webpage(url, video_id) + + # The Song data is in a script tag with the following format: + # (see https://github.com/ytdl-org/youtube-dl/issues/31203#issuecomment-1259867716) + searchPattern = r'