mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-12-02 05:07:55 +01:00
again
This commit is contained in:
parent
6a2fa7a8cf
commit
27fe09dfcc
@ -922,7 +922,10 @@ class YoutubeDL(object):
|
||||
|
||||
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):
|
||||
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')
|
||||
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
|
||||
|
||||
playlist_results.append(entry_result)
|
||||
|
@ -298,9 +298,14 @@ def parseOpts(overrideArguments=None):
|
||||
metavar='DATE', dest='dateafter', default=None,
|
||||
help='Download only videos uploaded on or after this date (i.e. inclusive)')
|
||||
selection.add_option(
|
||||
'--date-ordered-playlist',
|
||||
metavar='DATE', dest='date_ordered_playlist', default=None, action='store_true',
|
||||
help='Playlist is known to be in chronologically descending order')
|
||||
'--date-playlist-order',
|
||||
metavar='ORDER', dest='date_playlist_order', default='none',
|
||||
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(
|
||||
'--min-views',
|
||||
metavar='COUNT', dest='min_views', default=None, type=int,
|
||||
|
Loading…
Reference in New Issue
Block a user