Created
October 10, 2016 11:05
-
-
Save glad1couldkek/062b014779a8aea4cdc3e9ad8cf1adea 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
| #! /usr/bin/python3 | |
| import time | |
| import os | |
| dir= '/home/Anon/Pictures/' | |
| dir_pictures = '/home/Anon/Pictures/dir_pictures/' | |
| dir_webm = '/home/Anon/Videos/' | |
| dir_pepe = '/home/Anon/Pictures/dir_pepe/' | |
| dir_pepe_gif = '/home/Anon/Pictures/dir_pepe_gif/' | |
| dir_gif = '/home/Anon/Pictures/dir_pepe_gif/' | |
| #items = os.listdir(dirp) | |
| while True: | |
| time.sleep(10) | |
| os.chdir(dir) | |
| items = os.listdir(dir) | |
| for i in items: | |
| print(i) | |
| if i.startswith('pepe') and i.endswith('.jpg') or i.startswith('pepe') and i.endswith('.png'): | |
| os.rename(dir + i, dir_pepe + i) | |
| elif i.startswith('pepe') and i.endswith('.gif'): | |
| os.rename(dir + i, dir_pepe_gif + i) | |
| elif i.endswith('.webm') or i.endswith('.mp4'): | |
| os.rename(dir + i, dir_webm + i) | |
| elif i.endswith('.png') or i.endswith('.PNG') or i.endswith('.jpg'): | |
| os.rename(dir + i, dir_pictures + i) | |
| elif i.endswith('.gif'): | |
| os.rename(dir + i, dir_gif + i) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment