403Webshell
Server IP : 45.94.215.241  /  Your IP : 216.73.216.243
Web Server : Apache/2.4.66 (Ubuntu)
System : Linux srv2937474766 7.0.0-28-generic #28-Ubuntu SMP PREEMPT_DYNAMIC Sun Jun 21 01:01:36 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.5.4
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/IMDB/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/IMDB/series_subtitle_renamer2.py
import glob
import os
from os import system, name 
import shutil

base_dir = r"C:\Users\nikoofar\Downloads\Video\HMT"


os.chdir(base_dir)
def clear(): 
	_ = system('clear') 

#clear()
files = glob.glob("*.mkv") + glob.glob("*.mp4") + glob.glob("*.avi") 
files_srt = glob.glob("*.srt")
files.sort()
files_srt.sort()
print(files)
print(files_srt)


if (len(files)!=len(files_srt)):
    print("Error")
else:
    i=0
    for i in range(len(files)):
        file = files[i]
        last_dot_idx = file.rfind(".")
        filename = file[0:last_dot_idx]
        new_filename = filename + ".srt"
        old_filename = files_srt[i]
        os.rename(os.path.join(base_dir, old_filename),os.path.join(base_dir, new_filename))

        command = 'mv "%s" "%s"' %(old_filename,new_filename)
        print(command)
        i = i+1

Youez - 2016 - github.com/yon3zu
LinuXploit