Created
July 15, 2016 07:24
-
-
Save tanaypratap/10217be43024f7deaa83b839be553060 to your computer and use it in GitHub Desktop.
This file contains 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
## When downloaded some serials have long names like DareDevil.S02.E09 | |
## This program removes the statring Daredevil.S02. from the filename as it is already there on the folder. | |
import os | |
folder_path = "D:\\marvel daredevil\\" | |
file_extension = ".mp4" | |
episode_number_at_index = 2 | |
for file in os.listdir(folder_path): | |
name_array = file.split(".") | |
os.rename(folder_path + file, folder_path + episode_number_at_index + file_extension) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment