mirror of
https://github.com/ihabunek/twitch-dl
synced 2024-08-30 18:32:25 +00:00
Increase default limit for compact mode
This commit is contained in:
parent
4d19f09065
commit
cacf921923
@ -52,7 +52,7 @@ twitch-dl videos <channel_name> [FLAGS] [OPTIONS]
|
||||
|
||||
<tr>
|
||||
<td class="code">-l, --limit</td>
|
||||
<td>Number of videos to fetch. Defaults to 10.</td>
|
||||
<td>Number of videos to fetch. Defaults to 40 in copmpact mode, 10 otherwise.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
@ -7,8 +7,12 @@ from twitchdl.output import print_out, print_paged_videos, print_video, print_js
|
||||
|
||||
def videos(args):
|
||||
game_ids = _get_game_ids(args.game)
|
||||
|
||||
# Set different defaults for limit for compact display
|
||||
limit = args.limit or (40 if args.compact else 10)
|
||||
|
||||
# Ignore --limit if --pager or --all are given
|
||||
max_videos = sys.maxsize if args.all or args.pager else args.limit
|
||||
max_videos = sys.maxsize if args.all or args.pager else limit
|
||||
|
||||
total_count, generator = twitch.channel_videos_generator(
|
||||
args.channel_name, max_videos, args.sort, args.type, game_ids=game_ids)
|
||||
|
@ -80,9 +80,8 @@ COMMANDS = [
|
||||
"type": str,
|
||||
}),
|
||||
(["-l", "--limit"], {
|
||||
"help": "Number of videos to fetch. Defaults to 10.",
|
||||
"help": "Number of videos to fetch. Defaults to 40 in copmpact mode, 10 otherwise.",
|
||||
"type": pos_integer,
|
||||
"default": 10,
|
||||
}),
|
||||
(["-a", "--all"], {
|
||||
"help": "Fetch all videos, overrides --limit",
|
||||
|
Loading…
Reference in New Issue
Block a user