mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-09-10 00:58:17 +02:00
Remove video_result helper method
Calling it was more complex then actually including the type in the video info
This commit is contained in:
parent
81082e046e
commit
690e872c51
@ -48,6 +48,7 @@ def _real_extract(self, url):
|
|||||||
formats.sort(key=lambda fdata: fdata['file_size'])
|
formats.sort(key=lambda fdata: fdata['file_size'])
|
||||||
|
|
||||||
info = {
|
info = {
|
||||||
|
'_type': 'video',
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': title,
|
'title': title,
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
@ -63,4 +64,4 @@ def _real_extract(self, url):
|
|||||||
info['url'] = formats[-1]['url']
|
info['url'] = formats[-1]['url']
|
||||||
info['ext'] = determine_ext(formats[-1]['url'])
|
info['ext'] = determine_ext(formats[-1]['url'])
|
||||||
|
|
||||||
return self.video_result(info)
|
return info
|
@ -169,11 +169,6 @@ def report_login(self):
|
|||||||
self.to_screen(u'Logging in')
|
self.to_screen(u'Logging in')
|
||||||
|
|
||||||
#Methods for following #608
|
#Methods for following #608
|
||||||
#They set the correct value of the '_type' key
|
|
||||||
def video_result(self, video_info):
|
|
||||||
"""Returns a video"""
|
|
||||||
video_info['_type'] = 'video'
|
|
||||||
return video_info
|
|
||||||
def url_result(self, url, ie=None):
|
def url_result(self, url, ie=None):
|
||||||
"""Returns a url that points to a page that should be processed"""
|
"""Returns a url that points to a page that should be processed"""
|
||||||
#TODO: ie should be the class used for getting the info
|
#TODO: ie should be the class used for getting the info
|
||||||
|
@ -67,6 +67,7 @@ def _sortkey(format):
|
|||||||
formats.sort(key=_sortkey)
|
formats.sort(key=_sortkey)
|
||||||
|
|
||||||
info = {
|
info = {
|
||||||
|
'_type': 'video',
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': video_title,
|
'title': video_title,
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
@ -81,4 +82,4 @@ def _sortkey(format):
|
|||||||
info['url'] = formats[-1]['url']
|
info['url'] = formats[-1]['url']
|
||||||
info['ext'] = determine_ext(formats[-1]['url'])
|
info['ext'] = determine_ext(formats[-1]['url'])
|
||||||
|
|
||||||
return self.video_result(info)
|
return info
|
Loading…
Reference in New Issue
Block a user