Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -134,12 +134,6 @@ import shutil
|
|
| 134 |
|
| 135 |
def convert_cbr_to_cbz(cbr_path):
|
| 136 |
temp_dir = tempfile.mkdtemp()
|
| 137 |
-
try:
|
| 138 |
-
with rarfile.RarFile(cbr_path) as archive:
|
| 139 |
-
archive.extractall(temp_dir)
|
| 140 |
-
except rarfile.RarCannotExec:
|
| 141 |
-
raise RuntimeError("Cannot extract CBR. 'unrar' tool not found. Install 'unrar' or 'unrar-free'.")
|
| 142 |
-
|
| 143 |
cbz_path = cbr_path.replace('.cbr', '.cbz')
|
| 144 |
with zipfile.ZipFile(cbz_path, 'w') as zipf:
|
| 145 |
for root, _, files in os.walk(temp_dir):
|
|
|
|
| 134 |
|
| 135 |
def convert_cbr_to_cbz(cbr_path):
|
| 136 |
temp_dir = tempfile.mkdtemp()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
cbz_path = cbr_path.replace('.cbr', '.cbz')
|
| 138 |
with zipfile.ZipFile(cbz_path, 'w') as zipf:
|
| 139 |
for root, _, files in os.walk(temp_dir):
|