Skip to content

Instantly share code, notes, and snippets.

@NO-ob
Created March 12, 2021 09:11
Show Gist options
  • Save NO-ob/88641e7a7f6c763f1a64271b17818df0 to your computer and use it in GitHub Desktop.
Save NO-ob/88641e7a7f6c763f1a64271b17818df0 to your computer and use it in GitHub Desktop.
Converts all cbr in current dir to cbz
#!/usr/bin/python
import sys, os
os.system("mkdir tmp")
for filename in os.listdir("."):
if filename.endswith(".cbr"):
workingdir = os.path.abspath(".")
os.system("unrar x '" + os.path.abspath(filename) + "' " + workingdir + "/tmp")
os.system("cd tmp && zip -r '../" + filename.split(".")[0]+"'.cbz *")
os.system("rm -rf tmp/*")
os.system("rm \"" + filename + "\"")
os.system("rm -rf tmp/")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment