1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-11-29 05:32:00 +00:00

return 'formats' instead of url

This commit is contained in:
SpiderRider067 2020-12-27 20:10:07 -05:00 committed by GitHub
parent de3c09e6ac
commit f884efcc54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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'<a [^>]+(?P<URL>archive\.org\/download[^<]+\.(?:mkv|mp4|avi))[^<]+<\/a>',
webpage, 'video url')
webpage)
title = self._search_regex(
r'<span title="Movie[^"]+">(?P<TITLE>[^<]+)<\/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,
}