plysytsya / ebooktranslator Goto Github PK
View Code? Open in Web Editor NEWSimple ebook translator using GCP translate API or scraping www.deepl.com/translator
Simple ebook translator using GCP translate API or scraping www.deepl.com/translator
Hi, thanks for the project is extremely useful. It would be great if you could post a few lines about the usage commands. I figured out from the ebook_translator.py there is a way to eidt the last block in order to change the language and file parameters for what I need but ran into these problems:
Reading text into memory.
Tokenizing text into sentences.
Starting translation from the beginning.
Initializing DeepL translator
Traceback (most recent call last):
File "./scripts/ebook_translator.py", line 64, in
ebook_translator = EbookTranslator(path, "de", "en", engine="DeepL")
File "./scripts/ebook_translator.py", line 17, in init
self.translator = Translator(source_language, target_language, engine)
File "C:\Users\Netadmin\Documents\GitHub\EbookTranslator\scripts\translator.py", line 14, in init
self.set_engine(engine)
File "C:\Users\Netadmin\Documents\GitHub\EbookTranslator\scripts\translator.py", line 22, in set_engine
self.engine = DeepLEngine(self.source_language, self.target_language)
File "C:\Users\Netadmin\Documents\GitHub\EbookTranslator\scripts\translator.py", line 58, in init
self.browser = Browser(headless=True)
File "C:\Users\Netadmin\Documents\GitHub\EbookTranslator\scripts\browser.py", line 38, in init
self.start()
File "C:\Users\Netadmin\Documents\GitHub\EbookTranslator\scripts\browser.py", line 41, in start
chrome_binary = self.choose_browser_binary()[0]
TypeError: 'NoneType' object is not subscriptable
Do you know why?
Thanks,
Radu
Hi again, if using a German text with special characters as source language and Google as engine it comes to this error:
Reading text into memory.
Tokenizing text into sentences.
Starting translation from the beginning.
Initializing Google translator
0%|โ | 16/4290 [00:03<17:36, 4.05it/s]
Traceback (most recent call last):
File "./scripts/ebook_translator.py", line 65, in
ebook_translator.translate()
File "./scripts/ebook_translator.py", line 23, in translate
self.write_to_file(both_sentences, self.out_path)
File "./scripts/ebook_translator.py", line 42, in write_to_file
file.write(text)
File "C:\Radu\Miniconda3\envs\purr2\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 18-19: character maps to
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.