From 61c54899d81a13a4e4a95b718c62d0a846f23df1 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Thu, 2 Sep 2021 21:30:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E9=87=8D=E5=91=BD=E5=90=8D?= =?UTF-8?q?=EF=BC=8C=E9=81=BF=E5=85=8D=E6=97=A0=E7=94=A8=E5=8D=A0=E7=94=A8?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E9=95=BF=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- auto_rename_video.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/auto_rename_video.py b/auto_rename_video.py index e69de29..e6ad01c 100644 --- a/auto_rename_video.py +++ b/auto_rename_video.py @@ -0,0 +1,19 @@ +from glob import glob +import os + + +key_rep = [ + ["通关", ""], + ["教学", ""], + ["三国", ""], + ["_", " "], +] + +for file in glob("*.mp4"): + new_file = file[:] + for (search, replace) in key_rep: + new_file = new_file.replace(search, replace) + if file == new_file: + continue + print(file, "->", new_file) + os.rename(file, new_file) \ No newline at end of file