1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-12-02 13:27:56 +01:00
This commit is contained in:
Mark 2017-03-26 22:54:55 -04:00
parent 6a2fa7a8cf
commit 27fe09dfcc
2 changed files with 13 additions and 5 deletions

View File

@ -922,7 +922,10 @@ class YoutubeDL(object):
x_forwarded_for = ie_result.get('__x_forwarded_for_ip') x_forwarded_for = ie_result.get('__x_forwarded_for_ip')
reliably_date_ordered_IEs = ('YoutubeChannelIE, YoutubeUserIE') if self.params.get('date_playlist_order') == 'asc' and not self.params.get('start_from_earliest'):
entries.reverse()
if self.params.get('date_playlist_order') == 'desc' and self.params.get('start_from_earliest'):
entries.reverse()
for i, entry in enumerate(entries, 1): for i, entry in enumerate(entries, 1):
self.to_screen('[download] Downloading video %s of %s' % (i, n_entries)) self.to_screen('[download] Downloading video %s of %s' % (i, n_entries))
@ -953,7 +956,7 @@ class YoutubeDL(object):
entry_result_uploaddate = entry_result.get('upload_date') entry_result_uploaddate = entry_result.get('upload_date')
if entry_result_uploaddate: if entry_result_uploaddate:
if self.params.get('date_ordered_playlist') and entry_result_uploaddate not in self.params.get('daterange'): if self.params.get('date_playlist_order') in ('desc', 'asc') and entry_result_uploaddate not in self.params.get('daterange'):
break break
playlist_results.append(entry_result) playlist_results.append(entry_result)

View File

@ -298,9 +298,14 @@ def parseOpts(overrideArguments=None):
metavar='DATE', dest='dateafter', default=None, metavar='DATE', dest='dateafter', default=None,
help='Download only videos uploaded on or after this date (i.e. inclusive)') help='Download only videos uploaded on or after this date (i.e. inclusive)')
selection.add_option( selection.add_option(
'--date-ordered-playlist', '--date-playlist-order',
metavar='DATE', dest='date_ordered_playlist', default=None, action='store_true', metavar='ORDER', dest='date_playlist_order', default='none',
help='Playlist is known to be in chronologically descending order') type='choice', choices=['asc', 'desc', 'none'],
help='Specify whether a playlist is known to be listed in chronological order. "Asc", "desc" or "none". Descending order is most recent to least, and is the most useful. Default is "none", and is like not using this option at all. Automatically stops after encountering the first video date outside of the date range configured by --date, --datebefore, and --dateafter.')
selection.add_option(
'--start-from-earliest',
metavar='FROM', dest='start_from_earliest',
action='store_true', help='In conjunction with --date-playlist-order, specify whether to start from the earliest videos or the latest. The default behavior is to start from the latest.')
selection.add_option( selection.add_option(
'--min-views', '--min-views',
metavar='COUNT', dest='min_views', default=None, type=int, metavar='COUNT', dest='min_views', default=None, type=int,