X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2FYoutubeDL.py;h=578c8daf255048b90caaf6caa5f09825e1d2bfe6;hb=4a0132c570e29075e377c8b70d7f61018d1e4479;hp=31531855e8e43294c155c752cda3e0c397e0921a;hpb=4e40de6e2a62b56044a98828bc2df9b93e3dc665;p=youtube-dl diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 31531855e..578c8daf2 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -124,6 +124,7 @@ class YoutubeDL(object): nooverwrites: Prevent overwriting files. playliststart: Playlist item to start at. playlistend: Playlist item to end at. + playlistreverse: Download playlist items in reverse order. matchtitle: Download only matching titles. rejecttitle: Reject downloads for matching titles. logger: Log messages to a logging.Logger instance. @@ -622,15 +623,13 @@ class YoutubeDL(object): ie_result['url'], ie_key=ie_result.get('ie_key'), extra_info=extra_info, download=False, process=False) - new_result = ie_result.copy() - for f in ('_type', 'id', 'url', 'ext', 'player_url', 'formats', - 'entries', 'ie_key', 'duration', - 'subtitles', 'annotations', 'format', - 'thumbnail', 'thumbnails'): - if f in new_result: - del new_result[f] - if f in info: - new_result[f] = info[f] + force_properties = dict( + (k, v) for k, v in ie_result.items() if v is not None) + for f in ('_type', 'url'): + if f in force_properties: + del force_properties[f] + new_result = info.copy() + new_result.update(force_properties) assert new_result.get('_type') != 'url_transparent' @@ -672,6 +671,9 @@ class YoutubeDL(object): "[%s] playlist %s: Downloading %d videos" % (ie_result['extractor'], playlist, n_entries)) + if self.params.get('playlistreverse', False): + entries = entries[::-1] + for i, entry in enumerate(entries, 1): self.to_screen('[download] Downloading video #%s of %s' % (i, n_entries)) extra = {