mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-26 04:02:11 +00:00
return 'formats' instead of url
This commit is contained in:
parent
de3c09e6ac
commit
f884efcc54
1 changed files with 11 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
|
import re
|
||||||
|
|
||||||
|
|
||||||
class TASVideosIE(InfoExtractor):
|
class TASVideosIE(InfoExtractor):
|
||||||
|
@ -18,15 +19,22 @@ class TASVideosIE(InfoExtractor):
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
webpage = self._download_webpage(url, video_id)
|
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>',
|
r'<a [^>]+(?P<URL>archive\.org\/download[^<]+\.(?:mkv|mp4|avi))[^<]+<\/a>',
|
||||||
webpage, 'video url')
|
webpage)
|
||||||
title = self._search_regex(
|
title = self._search_regex(
|
||||||
r'<span title="Movie[^"]+">(?P<TITLE>[^<]+)<\/span>', webpage,
|
r'<span title="Movie[^"]+">(?P<TITLE>[^<]+)<\/span>', webpage,
|
||||||
'title')
|
'title')
|
||||||
|
formats = []
|
||||||
|
|
||||||
|
for url in video_urls:
|
||||||
|
format_entry = {'url': "http://www." + url}
|
||||||
|
formats.append(format_entry)
|
||||||
|
|
||||||
|
self._sort_formats(formats)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': title,
|
'title': title,
|
||||||
'url': video_url,
|
'formats': formats,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue