From b67b4411089f44fe68923a6aca56f2a0b1875c76 Mon Sep 17 00:00:00 2001 From: SpiderRiderGit Date: Fri, 25 Dec 2020 12:59:26 -0500 Subject: [PATCH] [TasVideos] Add new extractor --- youtube_dl/extractor/extractors.py | 1 + youtube_dl/extractor/tasvideos.py | 32 ++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 youtube_dl/extractor/tasvideos.py diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index bf34ae6b7..e31e62874 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -1128,6 +1128,7 @@ from .tagesschau import ( TagesschauIE, ) from .tass import TassIE +from .tasvideos import TasVideosIE from .tbs import TBSIE from .tdslifeway import TDSLifewayIE from .teachable import ( diff --git a/youtube_dl/extractor/tasvideos.py b/youtube_dl/extractor/tasvideos.py new file mode 100644 index 000000000..4ef199e12 --- /dev/null +++ b/youtube_dl/extractor/tasvideos.py @@ -0,0 +1,32 @@ +from __future__ import unicode_literals + +from .common import InfoExtractor + + +class TasVideosIE(InfoExtractor): + _VALID_URL = r'http://tasvideos.org/(?P\d+M)\.html' + _TEST = { + 'url': 'http://tasvideos.org/4352M.html', + 'md5': '92b08f544beb6ee905030609c7251cd1', + 'info_dict': { + 'id': '4352M', + 'ext': 'mkv', + 'title': 'C64 L\'Abbaye des Morts', + } + } + + def _real_extract(self, url): + video_id = self._match_id(url) + webpage = self._download_webpage(url, video_id) + video_url = "http://www." + self._search_regex( + r']+(?Parchive\.org\/download[^<]+(?:mkv|mp4))[^<]+<\/a>', + webpage, 'video url') + title = self._search_regex( + r'(?P[^<]+)<\/span>', webpage, + 'title') + + return { + 'id': video_id, + 'title': title, + 'url': video_url, + }