From 51c510ce1ea8d7e0e830573197a14df3b4a53559 Mon Sep 17 00:00:00 2001 From: razzle01 Date: Tue, 5 May 2020 23:24:01 +0200 Subject: [PATCH] Add CSGOAnime Extractor --- youtube_dl/extractor/csgoanime.py | 34 ++++++++++++++++++++++++++++++ youtube_dl/extractor/extractors.py | 2 ++ 2 files changed, 36 insertions(+) create mode 100644 youtube_dl/extractor/csgoanime.py diff --git a/youtube_dl/extractor/csgoanime.py b/youtube_dl/extractor/csgoanime.py new file mode 100644 index 000000000..a12aeccdc --- /dev/null +++ b/youtube_dl/extractor/csgoanime.py @@ -0,0 +1,34 @@ +# coding: utf-8 +from __future__ import unicode_literals + + +from .common import InfoExtractor + + +class CSGOAnimeIE(InfoExtractor): + _VALID_URL = r'(?:https?://)?(?:www\.)?csgoani\.me/(?P[0-9A-Za-z]+)(?:/[0-9A+Za+z])*' + _TEST = { + 'url': 'https://csgoani.me/valorant', + 'md5': 'feca224e0fd505403206f28da862601d', + 'info_dict': { + 'id': 'valorant', + 'ext': 'webm', + 'title': 'CSGOAnime', + 'uploader': 'thrice', + 'url': 'https://csgoani.me/uploads/alorant.webm' + } + } + + def _real_extract(self, url): + video_id = self._match_id(url) + webpage = self._download_webpage(url, video_id) + + video_url = self._og_search_url(webpage) + + return { + 'id': video_id, + 'ext': 'webm', + 'title': 'CSGOAnime', + 'uploader': 'thrice', + 'url': video_url + } \ No newline at end of file diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index 4b3092028..35f847ae8 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -1516,3 +1516,5 @@ from .zattoo import ( from .zdf import ZDFIE, ZDFChannelIE from .zingmp3 import ZingMp3IE from .zype import ZypeIE + +from .csgoanime import CSGOAnimeIE \ No newline at end of file