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']