-
-
Save steveway/4c8a13ec8754e7bdd78c71b114bfa516 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| import os | |
| dirdl = '/home/Anon/Downloads/' | |
| dirp = '/home/Anon/Pictures/' | |
| dirv = '/home/Anon/Videos/' | |
| dird = '/home/Anon/Documents/' | |
| dirm = '/home/Anon/Music/' | |
| dirs = [dirp, dirv, dird, dirdl, dirm] | |
| while True: | |
| time.sleep(10) | |
| for u in dirs: | |
| os.chdir(u) | |
| items = os.listdir(u) | |
| for i in items: | |
| if i.endswith('jpg') or i.endswith('png'): | |
| os.rename(u + i, dirp + i) | |
| elif i.endswith('webm') or i.endswith('mp4'): | |
| os.rename(u + i, dirv + i) | |
| elif i.endswith('mp3'): | |
| os.rename(u + i, dirm + i) | |
| elif i.endswith('pdf') or i.endswith('epub'): | |
| os.rename(u + i, dird + i) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment