How to rename downloaded files for clean filenames?

General Rules

  • This Forum Rules:
    1. No asking for course requests or download links.
    2. Don't share links to other websites for downloads or references.
    3. Avoid controversial topics in discussions.

    4. Use an appropriate thread title that matches your content, not just a word.

    Other Forum Rules Can Be Found Here

one3osk

🐧
TutFlixer
Jul 12, 2021
71
69
13
Air Temple
Hi, I found the downloaded files/folders have names like
Code:
You don't have permission to view the code content. Log in or register now.

Anyway to remove those "---[TutFlix.ORG]---" from filenames for clean filenames? Any script or something would be cool to automate the process.
 

hogwarts_dropout

Well-known member
TutFlixer
Dec 8, 2020
115
793
52
Mars

import osfiles = os.listdir()for file in files: if "---[TutFlix.ORG]---" in file: os.rename(file, file.replace("---[TutFlix.ORG]---",""))



-> Just create a file named " parser.py " in the directory with filenames you want to change...

-> copy/Paste the Above code in that file...

-> open Terminal and go to that directory and run " python parser.py "
 

one3osk

🐧
TutFlixer
Jul 12, 2021
71
69
13
Air Temple
files = os.listdir()
I am curious will it only work on folders? Since, I tested with files and it seems it didn't work on those.
Also, can I add additional terms to be removed besides "tutflix"? Which code should I edit for that?

Basically, I just add list of terms and the script simply removes those from filenames. Thank you in advance.
 

hogwarts_dropout

Well-known member
TutFlixer
Dec 8, 2020
115
793
52
Mars
I am curious will it only work on folders? Since, I tested with files and it seems it didn't work on those.
Also, can I add additional terms to be removed besides "tutflix"? Which code should I edit for that?

Basically, I just add list of terms and the script simply removes those from filenames. Thank you in advance.
It works with folders and files...

Just move the " paser.py " file into that folder

Just Change " os.rename(file, file.replace(" <What You want to Remove > ", "")) "
 

Latest resources