mirror of
https://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2024-11-18 13:13:01 +00:00
add depth arg
This commit is contained in:
parent
c1d53370b2
commit
50e7402c92
@ -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']
|
||||
|
Loading…
Reference in New Issue
Block a user