Skip to content

Instantly share code, notes, and snippets.

@3N4N
Last active March 21, 2019 09:15
Show Gist options
  • Save 3N4N/702d8844ca975f22d0ead6502692fcba to your computer and use it in GitHub Desktop.
Save 3N4N/702d8844ca975f22d0ead6502692fcba to your computer and use it in GitHub Desktop.
# Author: Enan Ajmain
# Email : 3nan.ajmain@gmail.com
# Github: https://github.com/enanajmain
import os
arr = os.listdir(".")
vdo=[]
sub=[]
for i in range(arr.__len__()):
if arr[i].endswith('.mkv'):
vdo.append(arr[i])
elif arr[i].endswith('.srt'):
sub.append(os.path.splitext(arr[i])[0])
for i in range(vdo.__len__()):
os.rename(vdo[i], sub[i]+".mkv")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment