Skip to content

Commit

Permalink
Move directory check out of loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Fittiboy committed Mar 25, 2021
1 parent f257211 commit d021ca9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions clipper.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,15 +240,15 @@ def dl_progress(count, block_size, total_size):
end="\r")

print(f"Clips created on {datestring}: " + str(len(all_urls)))
base_path = pjoin(filedir, "clips", args.streamer)
if not isdir(base_path):
makedirs(base_path, exist_ok=True)
exist_clips = listdir(base_path)
exist_ids = [filename.split(" _ ")[-1] for filename in exist_clips]

for url in all_urls:
total += 1
dl_url = url[1]
base_path = pjoin(filedir, "clips", args.streamer)
if not isdir(base_path):
makedirs(base_path, exist_ok=True)
exist_clips = listdir(base_path)
exist_ids = [filename.split(" _ ")[-1] for filename in exist_clips]
file_name = url[0]
clip_id = file_name.split(" _ ")[-1]
if sys.platform.startswith("win"):
Expand Down

0 comments on commit d021ca9

Please sign in to comment.