From f1100092b9948ab36fcce19e63c0d2a032eb8ffa Mon Sep 17 00:00:00 2001 From: Ludwig Lehnert Date: Sun, 16 Feb 2025 09:27:24 +0100 Subject: [PATCH] added 'only' option --- dl.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dl.py b/dl.py index 9a3c129..f99c956 100644 --- a/dl.py +++ b/dl.py @@ -13,8 +13,11 @@ def parse_args(): help='Output directory', default='./out') parser.add_argument('--starter-url', type=str, help='Starter URL', default="https://www.fau.tv/auth/sso") + parser.add_argument('--start-at', type=int, - help='Skip all previous indices (defaults to 1)', default=1) + help='Skip all previous indices (index starts at 1)', default=1) + parser.add_argument('--only', type=int, + help='Only download the given index') parser.add_argument('--auth-token', type=str) parser.add_argument('--session-id', type=str) @@ -37,7 +40,10 @@ def main(): os.makedirs(args.out_dir, exist_ok=True) for index, clip_id in enumerate(get_course_clip_ids(args.course_id)): - if index < args.start_at - 1: + if args.only is not None: + if index != args.only - 1: + continue + elif index < args.start_at - 1: continue download_clip(