mirror of
https://github.com/flibusta-apps/books_downloader.git
synced 2025-12-06 15:05:37 +01:00
Fix transliterate language detection error
This commit is contained in:
@@ -6,6 +6,7 @@ from typing import Optional
|
||||
import zipfile
|
||||
|
||||
import transliterate
|
||||
import transliterate.exceptions
|
||||
|
||||
from app.services.book_library import Book, BookAuthor
|
||||
|
||||
@@ -101,7 +102,10 @@ def get_filename(book_id: int, book: Book, file_type: str) -> str:
|
||||
|
||||
filename = "".join(filename_parts)
|
||||
|
||||
try:
|
||||
filename = transliterate.translit(filename, reversed=True)
|
||||
except transliterate.exceptions.LanguageDetectionError:
|
||||
pass
|
||||
|
||||
for c in "(),….’!\"?»«':":
|
||||
filename = filename.replace(c, "")
|
||||
|
||||
Reference in New Issue
Block a user