1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2025-01-07 13:47:54 +01:00
Mark 2017-04-07 12:59:05 -04:00
parent 21e8ffb8c7
commit 4f4410d68f

View File

@ -922,11 +922,12 @@ class YoutubeDL(object):
x_forwarded_for = ie_result.get('__x_forwarded_for_ip')
if self.params.get('date_playlist_order') == 'desc' and self.params.get('playlistreverse'):
entries.reverse()
elif self.params.get('date_playlist_order') == 'asc' and not self.params.get('playlistreverse'):
if ((self.params.get('date_playlist_order') == 'desc' and self.params.get('playlistreverse')) or
(self.params.get('date_playlist_order') == 'asc' and not self.params.get('playlistreverse'))):
entries.reverse()
one_vid_within_range = False
for i, entry in enumerate(entries, 1):
self.to_screen('[download] Downloading video %s of %s' % (i, n_entries))
# This __x_forwarded_for_ip thing is a bit ugly but requires
@ -954,11 +955,17 @@ class YoutubeDL(object):
download=download,
extra_info=extra)
if entry_result is not None: # backwards compatibility, lol
if entry_result is not None: # backwards compatibility
entry_result_uploaddate = entry_result.get('upload_date')
if entry_result_uploaddate:
if self.params.get('date_playlist_order') in ('desc', 'asc') and entry_result_uploaddate not in self.params.get('daterange'):
break
if self.params.get('date_playlist_order') in ('desc', 'asc'):
# we've come across at least one video within the specified daterange
if (entry_result_uploaddate in self.params.get('daterange') and
one_vid_within_range == False):
one_vid_within_range = True
elif (entry_result_uploaddate not in self.params.get('daterange') and
one_vid_within_range == True):
break
playlist_results.append(entry_result)