Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASVideos] Add new extractor #27537

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
1 change: 1 addition & 0 deletions youtube_dl/extractor/extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,7 @@
TagesschauIE,
)
from .tass import TassIE
from .tasvideos import TasVideosIE
from .tbs import TBSIE
from .tdslifeway import TDSLifewayIE
from .teachable import (
Expand Down
32 changes: 32 additions & 0 deletions youtube_dl/extractor/tasvideos.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from __future__ import unicode_literals

from .common import InfoExtractor


class TasVideosIE(InfoExtractor):
EdenOvrutskiy marked this conversation as resolved.
Show resolved Hide resolved
_VALID_URL = r'http://tasvideos.org/(?P<id>\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'<a [^>]+(?P<URL>archive\.org\/download[^<]+\.(?:mkv|mp4|avi))[^<]+<\/a>',
webpage, 'video url')
title = self._search_regex(
r'<span title="Movie[^"]+">(?P<TITLE>[^<]+)<\/span>', webpage,
'title')

return {
'id': video_id,
'title': title,
'url': video_url,
}