mirror of
https://github.com/DrewThomasson/ebook2audiobook.git
synced 2026-01-10 06:18:02 -05:00
rebuild test files, moved gnerate_ebooks.py into tools folder
This commit is contained in:
@@ -1,68 +0,0 @@
|
||||
import os
|
||||
from deep_translator import GoogleTranslator
|
||||
import subprocess
|
||||
from tqdm import tqdm
|
||||
|
||||
# Your language mapping dictionary from lang.py
|
||||
from lang import language_mapping
|
||||
|
||||
# Base text to be translated
|
||||
base_text = "This is the test from the result of text file to audiobook conversion."
|
||||
|
||||
# Output directory
|
||||
output_dir = "output"
|
||||
if not os.path.exists(output_dir):
|
||||
os.makedirs(output_dir)
|
||||
|
||||
# Path to your base cover image (adjust the path accordingly)
|
||||
base_cover_image = "base_files/Ebook Base Cover.jpeg"
|
||||
|
||||
# List to keep track of languages that failed
|
||||
failed_languages = []
|
||||
|
||||
# Loop over languages with a progress bar
|
||||
for lang_code, lang_info in tqdm(language_mapping.items(), desc="Processing languages"):
|
||||
try:
|
||||
# Translate the text
|
||||
translated_text = GoogleTranslator(source='en', target=lang_code).translate(base_text)
|
||||
print(f"\nTranslated text for {lang_info['name']} ({lang_code}): {translated_text}")
|
||||
|
||||
# Write the translated text to a txt file
|
||||
txt_filename = f"test_{lang_code}.txt"
|
||||
txt_filepath = os.path.join(output_dir, txt_filename)
|
||||
with open(txt_filepath, 'w', encoding='utf-8') as f:
|
||||
f.write(translated_text)
|
||||
|
||||
# Prepare the ebook-convert command
|
||||
azw3_filename = f"test_{lang_code}.azw3"
|
||||
azw3_filepath = os.path.join(output_dir, azw3_filename)
|
||||
|
||||
title = f"Ebook {lang_info['name']} Test"
|
||||
authors = "Dev Team"
|
||||
language = lang_code
|
||||
|
||||
command = [
|
||||
"ebook-convert",
|
||||
txt_filepath,
|
||||
azw3_filepath,
|
||||
"--cover", base_cover_image,
|
||||
"--title", title,
|
||||
"--authors", authors,
|
||||
"--language", language
|
||||
]
|
||||
|
||||
# Run the ebook-convert command
|
||||
subprocess.run(command)
|
||||
print(f"Ebook generated for {lang_info['name']} at {azw3_filepath}\n")
|
||||
|
||||
except Exception as e:
|
||||
print(f"An error occurred for language {lang_code}: {e}")
|
||||
failed_languages.append(lang_code)
|
||||
continue
|
||||
|
||||
# After processing all languages, output the list of languages that failed
|
||||
if failed_languages:
|
||||
print("\nThe following languages could not be processed:")
|
||||
for lang_code in failed_languages:
|
||||
lang_name = language_mapping[lang_code]['name']
|
||||
print(f"- {lang_name} ({lang_code})")
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
Eyi ne sɔhwɛ a efi nea efi text file mu kɔ audiobook nsakrae mu ba no mu.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
ይህ ከጽሑፍ ፋይል ወደ ኦዲዮ መጽሐፍት ልወጣ የተደረገው ሙከራ ነው።
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
هذا هو الاختبار من نتيجة تحويل ملف نصي إلى كتاب صوتي.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
এইটো হৈছে টেক্সট ফাইলৰ ফলাফলৰ পৰা অডিঅ'বুক ৰূপান্তৰলৈ পৰীক্ষা।
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
Това е тестът от резултата от преобразуването на текстов файл в аудиокнига.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
এটি পাঠ্য ফাইলের ফলাফল থেকে অডিওবুক রূপান্তরের পরীক্ষা।
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
Aquesta és la prova del resultat de la conversió d'un fitxer de text a un audiollibre.
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
Kini ang pagsulay gikan sa resulta sa text file ngadto sa pagkakabig sa audiobook.
|
||||
Kini usa ka pagsulay gikan sa resulta sa text file ngadto sa pagkakabig sa audiobook.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
Toto je test od výsledku převodu textového souboru na audioknihu.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
Dyma'r prawf o ganlyniad ffeil testun i drosi llyfr sain.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
Dies ist der Test des Ergebnisses der Konvertierung einer Textdatei in ein Hörbuch.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
एह् पाठ फाइल दे नतीजे थमां ऑडियोबुक रूपांतरण च परीक्षण ऐ।
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
Αυτή είναι η δοκιμή από το αποτέλεσμα της μετατροπής αρχείου κειμένου σε ηχητικό βιβλίο.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
This is the test from the result of text file to audiobook conversion.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
Esta es la prueba del resultado de la conversión de archivo de texto a audiolibro.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
Testu-fitxategiaren emaitzatik audio-liburu bihurtzerako proba da.
|
||||
Binary file not shown.
Binary file not shown.
@@ -1 +0,0 @@
|
||||
این تست از نتیجه تبدیل فایل متنی به کتاب صوتی است.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
Tämä on testi tekstitiedoston muuntamisen tuloksesta äänikirjaksi.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
Ceci est le test provenant d'un fichier text en livre audio.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
Kóva haꞌehína pe prueba oúva archivo de texto resultado guive audiolibro ñembohasápe.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
આ ટેક્સ્ટ ફાઇલના પરિણામથી ઑડિઓબુક રૂપાંતર સુધીની કસોટી છે.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
Wannan shine gwajin daga sakamakon fayil ɗin rubutu zuwa canjin littafin mai jiwuwa.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
यह टेक्स्ट फ़ाइल से ऑडियोबुक रूपांतरण के परिणाम का परीक्षण है।
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
Sa a se tès la soti nan rezilta a nan dosye tèks konvèsyon liv odyo.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
Ez a teszt a szöveges fájl eredményétől a hangoskönyv-konverzióig.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
Ini adalah pengujian dari hasil konversi file teks ke buku audio.
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
Daytoy ti pagsubok manipud iti resulta ti text file agingga iti audiobook conversion.
|
||||
Daytoy ket maysa a pagsubok manipud iti resulta ti text file agingga iti audiobook conversion.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
Þetta er prófið frá niðurstöðu textaskrár í hljóðbók umbreytingu.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
Questo è il test del risultato della conversione del file di testo in audiolibro.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
これは、テキスト ファイルからオーディオブックへの変換結果のテストです。
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
Бұл мәтіндік файл нәтижесінен аудиокітапты түрлендіруге арналған сынақ.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
នេះគឺជាការសាកល្បងពីលទ្ធផលនៃឯកសារអត្ថបទទៅជាការបំប្លែងសៀវភៅអូឌីយ៉ូ។
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
ಪಠ್ಯ ಫೈಲ್ನಿಂದ ಆಡಿಯೊಬುಕ್ ಪರಿವರ್ತನೆಯ ಫಲಿತಾಂಶದಿಂದ ಇದು ಪರೀಕ್ಷೆಯಾಗಿದೆ.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
이는 텍스트 파일을 오디오북으로 변환한 결과에 대한 테스트입니다.
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
Dis na di tɛst frɔm di rizɔlt fɔ tɛks fayl to ɔdiobuk kɔnvɔshɔn.
|
||||
Dis na tɛst frɔm di rizɔlt fɔ tɛks fayl to ɔdiobuk kɔnvɔshɔn.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
Бул тексттик файлдын жыйынтыгынан аудиокитепке айландыруу сыноосу.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
Hoc est experimentum e eventu electronicarum fasciculi ad conversionem audiobook.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
Kino kye kigezo okuva ku bivudde mu kukyusa fayiro y’ebiwandiiko okudda mu kukyusa ebitabo ebiwulikika.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
ນີ້ແມ່ນການທົດສອບຈາກຜົນໄດ້ຮັບຂອງໄຟລ໌ຂໍ້ຄວາມເພື່ອປ່ຽນ audiobook.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
Šis ir tests no teksta faila rezultāta līdz audiogrāmatas konvertēšanai.
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
इ टेक्स्ट फाइल कें परिणाम सं ऑडियोबुक रूपांतरण कें परीक्षण छै.
|
||||
ई टेक्स्ट फाइल केरऽ परिणाम स॑ ऑडियोबुक रूपांतरण म॑ परीक्षा छै ।
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
ടെക്സ്റ്റ് ഫയലിൻ്റെ ഫലത്തിൽ നിന്ന് ഓഡിയോബുക്കിലേക്കുള്ള പരിവർത്തനത്തിൻ്റെ പരിശോധനയാണിത്.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
Энэ бол текст файлын үр дүнгээс аудио ном хөрвүүлэх туршилт юм.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
मजकूर फाइलच्या निकालापासून ते ऑडिओबुक रूपांतरणापर्यंतची ही चाचणी आहे.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
Ini ialah ujian daripada keputusan fail teks kepada penukaran buku audio.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
၎င်းသည် စာသားဖိုင်မှ အသံစာအုပ်သို့ ပြောင်းလဲခြင်း၏ ရလဒ်စမ်းသပ်မှုဖြစ်သည်။
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
Dit is de test op basis van het resultaat van de conversie van een tekstbestand naar een audioboek.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
Uku ndiye kuyesa kuchokera pazotsatira zamafayilo kupita ku audiobook.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
Kun qormaata bu'aa faayilii barruu irraa gara jijjiirraa kitaaba sagaleeti.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user