aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUnknown <blackjack4494@web.de>2020-10-29 01:56:55 +0100
committerUnknown <blackjack4494@web.de>2020-10-29 01:56:55 +0100
commit0704d2224b328caeafbce6a029904472628d12bd (patch)
tree89b4db564773eb2ac68d023d9a5b809fe8ed4e9e
parentddb77f30ee597aa5d23079fe6654b7e2e4a91656 (diff)
downloadhypervideo-pre-0704d2224b328caeafbce6a029904472628d12bd.tar.lz
hypervideo-pre-0704d2224b328caeafbce6a029904472628d12bd.tar.xz
hypervideo-pre-0704d2224b328caeafbce6a029904472628d12bd.zip
[core] be able to hand over id and title using url_result
-rw-r--r--youtube_dlc/YoutubeDL.py9
-rw-r--r--youtube_dlc/extractor/bandcamp.py2
2 files changed, 8 insertions, 3 deletions
diff --git a/youtube_dlc/YoutubeDL.py b/youtube_dlc/YoutubeDL.py
index fc351db0d..f959a4e47 100644
--- a/youtube_dlc/YoutubeDL.py
+++ b/youtube_dlc/YoutubeDL.py
@@ -801,7 +801,7 @@ class YoutubeDL(object):
for key, value in extra_info.items():
info_dict.setdefault(key, value)
- def extract_info(self, url, download=True, ie_key=None, extra_info={},
+ def extract_info(self, url, download=True, ie_key=None, info_dict=None, extra_info={},
process=True, force_generic_extractor=False):
'''
Returns a list with a dictionary for each video we find.
@@ -836,6 +836,11 @@ class YoutubeDL(object):
'_type': 'compat_list',
'entries': ie_result,
}
+ if info_dict:
+ if info_dict.get('id'):
+ ie_result['id'] = info_dict['id']
+ if info_dict.get('title'):
+ ie_result['title'] = info_dict['title']
self.add_default_extra_info(ie_result, ie, url)
if process:
return self.process_ie_result(ie_result, download, extra_info)
@@ -898,7 +903,7 @@ class YoutubeDL(object):
# We have to add extra_info to the results because it may be
# contained in a playlist
return self.extract_info(ie_result['url'],
- download,
+ download, info_dict=ie_result,
ie_key=ie_result.get('ie_key'),
extra_info=extra_info)
elif result_type == 'url_transparent':
diff --git a/youtube_dlc/extractor/bandcamp.py b/youtube_dlc/extractor/bandcamp.py
index 7d29481c0..0e7492764 100644
--- a/youtube_dlc/extractor/bandcamp.py
+++ b/youtube_dlc/extractor/bandcamp.py
@@ -332,7 +332,7 @@ class BandcampAlbumIE(BandcampBaseIE):
entries = [
self.url_result(
compat_urlparse.urljoin(url, track['title_link']),
- ie=BandcampIE.ie_key(),
+ ie=BandcampIE.ie_key(), video_id=track['id'],
video_title=track['title'])
for track in tracks
if track.get('duration')]