Skip to content

Commit dbbbb5d

Browse files
Update main.py
1 parent 82a2c18 commit dbbbb5d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

main.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,27 @@ def get_download_path():
2525
downloads_path = get_download_path()
2626

2727
def extractor(file):
28-
if ".crdownload" in file:
28+
if ".crdownload" in file or ".tmp" in file:
2929
return
3030
formatted_file = file.split(sep)[-1].split(".")[0]
3131
destination_name = f"Extracted {formatted_file}"
3232
destination = downloads_path+sep+destination_name
33-
sleep(0.5)
3433
try:
3534
unpack_archive(
3635
file,
3736
destination)
3837

38+
sleep(0.5)
39+
3940
send2trash(file)
4041

4142
except:
4243
try:
4344
with SevenZipFile(file, mode='r') as archive:
4445
archive.extractall(path=destination)
4546

47+
sleep(0.5)
48+
4649
send2trash(file)
4750
except:
4851
pass
@@ -68,6 +71,6 @@ def on_modified(self, event):
6871

6972
event_handler = EventHandler()
7073
observer = Observer()
71-
observer.schedule(event_handler, downloads_path, recursive=True)
74+
observer.schedule(event_handler, downloads_path, recursive=False)
7275
observer.start()
7376
observer.join()

0 commit comments

Comments
 (0)