From 50e7402c92a46ddaa8c2065532b701b0edebbb93 Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Wed, 24 Jul 2024 17:51:53 +0300 Subject: [PATCH] add depth arg --- funkwlplay.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/funkwlplay.py b/funkwlplay.py index cfd4411..4ec6b41 100644 --- a/funkwlplay.py +++ b/funkwlplay.py @@ -15,6 +15,7 @@ parser.add_argument('-s', '--search') parser.add_argument('-t', '--tag') parser.add_argument('-i', '--instance') parser.add_argument('-r', '--recursion', type=int, default=0) +parser.add_argument('-d', '--depth', type=int, default=5) args = parser.parse_args() if args.instance: instances = [args.instance] @@ -60,7 +61,7 @@ def search_tracks_on_instance(instance, tag='', query='', recursion=args.recursi recursion_limit = 0 while tracks['next']: try: - if recursion_limit >= 5: + if recursion_limit >= args.depth: break new_tracks = requests.get(tracks['next']).json() tracks['results'] += new_tracks['results']