From f884efcc54b062a9527d1fcc1a9e5b11b223bd96 Mon Sep 17 00:00:00 2001 From: SpiderRider067 <36859584+SpiderRider067@users.noreply.github.com> Date: Sun, 27 Dec 2020 20:10:07 -0500 Subject: [PATCH] return 'formats' instead of url --- youtube_dl/extractor/tasvideos.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/youtube_dl/extractor/tasvideos.py b/youtube_dl/extractor/tasvideos.py index e8a408be5..19b1a8e10 100644 --- a/youtube_dl/extractor/tasvideos.py +++ b/youtube_dl/extractor/tasvideos.py @@ -1,6 +1,7 @@ from __future__ import unicode_literals from .common import InfoExtractor +import re class TASVideosIE(InfoExtractor): @@ -18,15 +19,22 @@ class TASVideosIE(InfoExtractor): 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( + video_urls = re.findall( r']+(?Parchive\.org\/download[^<]+\.(?:mkv|mp4|avi))[^<]+<\/a>', - webpage, 'video url') + webpage) title = self._search_regex( r'(?P[^<]+)<\/span>', webpage, 'title') + formats = [] + + for url in video_urls: + format_entry = {'url': "http://www." + url} + formats.append(format_entry) + + self._sort_formats(formats) return { 'id': video_id, 'title': title, - 'url': video_url, + 'formats': formats, }