Created
November 14, 2016 03:08
-
-
Save spinningD20/cd7cf5259e25466a86fa6ce64f029c61 to your computer and use it in GitHub Desktop.
needed something quick to go through a media collection, search on youtube if I didn't know what it was, and give the option to skip the file or delete it.
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 fnmatch | |
import os, sys | |
#import pyperclip # for clipboard usage | |
import webbrowser | |
for file in os.listdir('.'): | |
if fnmatch.fnmatch(file, '*'+sys.argv[1]+'*'): | |
print "File: " + file | |
choice = raw_input("Delete? Y/N/L") | |
if choice.upper() == 'L': | |
webbrowser.open_new_tab('https://www.youtube.com/results?search_query='+file) | |
choice = raw_input("Delete? Y/N") | |
if choice.upper() == 'Y': | |
os.remove(file) | |
print('deleted') | |
else: | |
print('skipped') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment