Closed jbrepogmailcom closed 5 years ago
@jbrepogmailcom Oh no! I haven't seen this one in forever. Let me investigate. One thing I can suggest right sway though, is to use Python 3 if possible! That should fix it.
Hi @jbrepogmailcom, could you tell me what you're running this on? I was unable to reproduce on Python 2.7(.16) (where this would have likely happened) or Python 3.7.
$ gtts-cli -l cs 'Ahoj, jak se máš?' -o ~/Desktop/test1.mp3 --debug
gtts.lang - DEBUG - langs: {u'el': u'Greek', u'eo': u'Esperanto', u'en': u'English', 'en-au': 'English (Australia)', u'af': u'Afrikaans', u'vi': u'Vietnamese', u'ca': u'Catalan', 'en-us': 'English (US)', 'fr-ca': 'French (Canada)', u'gu': u'Gujarati', 'en-ng': 'English (Nigeria)', u'kn': u'Kannada', u'cy': u'Welsh', u'ar': u'Arabic', 'fr-fr': 'French (France)', u'su': u'Sundanese', u'cs': u'Czech', u'et': u'Estonian', 'es-es': 'Spanish (Spain)', u'id': u'Indonesian', u'es': u'Spanish', 'en-gb': 'English (UK)', u'ru': u'Russian', u'nl': u'Dutch', 'en-ph': 'English (Philippines)', u'pt': u'Portuguese', u'la': u'Latin', 'zh-tw': 'Chinese (Mandarin/Taiwan)', 'en-gh': 'English (Ghana)', u'tr': u'Turkish', u'ne': u'Nepali', u'lv': u'Latvian', u'si': u'Sinhala', u'tl': u'Filipino', u'th': u'Thai', 'en-za': 'English (South Africa)', u'ro': u'Romanian', u'is': u'Icelandic', u'pl': u'Polish', u'ta': u'Tamil', u'fr': u'French', u'hy': u'Armenian', u'mr': u'Marathi', 'en-tz': 'English (Tanzania)', u'hr': u'Croatian', 'en-ie': 'English (Ireland)', u'bn': u'Bengali', u'jw': u'Javanese', u'ko': u'Korean', u'it': u'Italian', 'es-us': 'Spanish (United States)', u'hi': u'Hindi', u'bs': u'Bosnian', u'fi': u'Finnish', u'da': u'Danish', u'ja': u'Japanese', 'en-ca': 'English (Canada)', u'km': u'Khmer', u'te': u'Telugu', 'pt-pt': 'Portuguese (Portugal)', u'sr': u'Serbian', u'sq': u'Albanian', u'no': u'Norwegian', u'sw': u'Swahili', u'sv': u'Swedish', u'mk': u'Macedonian', u'ur': u'Urdu', u'sk': u'Slovak', u'de': u'German', 'en-nz': 'English (New Zealand)', 'en-in': 'English (India)', u'uk': u'Ukrainian', u'ml': u'Malayalam', 'en-uk': 'English (UK)', u'hu': u'Hungarian', u'my': u'Myanmar (Burmese)', 'zh-cn': 'Chinese (Mandarin/China)', 'pt-br': 'Portuguese (Brazil)'}
gtts.tts - DEBUG - lang: cs
gtts.tts - DEBUG - pre_processor_funcs: [<function tone_marks at 0x100c056e0>, <function end_of_line at 0x100c05758>, <function abbreviations at 0x100c057d0>, <function word_sub at 0x100c05848>]
gtts.tts - DEBUG - slow: False
gtts.tts - DEBUG - text: Ahoj, jak se máš?
gtts.tts - DEBUG - tokenizer_func: <bound method Tokenizer.run of <_sre.SRE_Pattern object at 0x7fc16cb2c540> from: [<function tone_marks at 0x100c05938>, <function period_comma at 0x100c059b0>, <function colon at 0x100c05a28>, <function other_punctuation at 0x100c05aa0>]>
gtts.tts - DEBUG - lang_check: False
gtts.tts - DEBUG - pre-processing: <function tone_marks at 0x100c056e0>
gtts.tts - DEBUG - pre-processing: <function end_of_line at 0x100c05758>
gtts.tts - DEBUG - pre-processing: <function abbreviations at 0x100c057d0>
gtts.tts - DEBUG - pre-processing: <function word_sub at 0x100c05848>
gtts.tts - DEBUG - text_parts: 1
gtts.tts - DEBUG - payload-0: {'q': u'Ahoj, jak se m\xe1\u0161?', 'tl': u'cs', 'client': 'tw-ob', 'textlen': 17, 'idx': 0, 'ttsspeed': 1, 'total': 1, 'ie': 'UTF-8', 'tk': '659922.832780'}
gtts.tts - DEBUG - headers-0: {'Connection': 'keep-alive', 'Referer': 'http://translate.google.com/', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36'}
gtts.tts - DEBUG - url-0: https://translate.google.com/translate_tts?q=Ahoj%2C+jak+se+m%C3%A1%C5%A1%3F&tl=cs&client=tw-ob&textlen=17&idx=0&ttsspeed=1&total=1&ie=UTF-8&tk=659922.832780
gtts.tts - DEBUG - status-0: 200
gtts.tts - DEBUG - part-0 written to <open file '~/Desktop/test1.mp3', mode 'wb' at 0x1018085d0>
gtts-cli -l cs 'Ahoj, jak se máš?' | play -t mp3 - - Usage: gtts-cli [OPTIONS]
Error: 'ascii' codec can't decode byte 0xc3 in position 14: ordinal not in range(128) play FAIL formats: can't open input `-':