Browse Source

Try to fix recursion AGAIN

main
fluffy 6 months ago
parent
commit
5a360da43a
1 changed files with 12 additions and 6 deletions
  1. +12
    -6
      zenius.py

+ 12
- 6
zenius.py View File

@@ -167,11 +167,17 @@ if __name__ == "__main__":
os.makedirs(args.zipdir, exist_ok=True)

seen_cats = set()
categories = args.categories
while categories:
for url in categories:
found = mirror(url, args)
pending = queue.Queue()
for url in args.categories:
pending.put(url)

while not pending.empty():
url = pending.get()
if url not in seen_cats:
seen_cats.add(url)
found = mirror(url, args)
if args.recurse:
print(f'Recursively fetching categories: {list(found)}')
categories = (cat for cat in found if cat not in seen_cats)
for url in found:
print(f'Scheduling discovered category {url}')
pending.put(url)


Loading…
Cancel
Save