fcangialosi / naver_tts

Download mp3 pronunciation of Korean phrases using public Naver TTS API (no API key required)
4 stars 2 forks source link

It not work on python 3.12 :( #1

Open anwikipedia opened 8 months ago

anwikipedia commented 8 months ago

I install pip3 install requests. But it still show error : = RESTART: C:\Users\ADMIN\Desktop\naver_tts-master\naver.py Traceback (most recent call last): File "C:\Users\ADMIN\Desktop\naver_tts-master\naver.py", line 29, in text = unicode(sys.argv[1], 'utf-8') NameError: name 'unicode' is not defined. Did you mean: 'encode'?

When i try replace unicode with encode it show another error :

Traceback (most recent call last): File "C:\Users\ADMIN\Desktop\naver_tts-master\naver.py", line 29, in text = encode(sys.argv[1], 'utf-8') IndexError: list index out of range

Please someone good at python help community korean learn language.

fcangialosi commented 7 months ago

hi @anwikipedia, I just pushed a commit that fixes this issue directly. unfortunately, it seems naver/papago changed their API, so the script will no longer work, regardless of python version, without a fix for this.

unfortunately i don't have time to work on this right now, but it should be fairly straight forward if someone sees this and wants to fix it in the future:

originally the naver makeID API was stateless, but now it requires a session cookie. so you'd have to do the following:

  1. issue a request to get a cookie
  2. supply that cookie to the makeID POST call

hope this helps, and sorry i'm unable to fix it fully at the moment!

anwikipedia commented 7 months ago

Thanks for trying!

On Fri, Jan 12, 2024, 9:38 PM Frank Cangialosi @.***> wrote:

hi @anwikipedia https://github.com/anwikipedia, I just pushed a commit that fixes this issue directly. unfortunately, it seems naver/papago changed their API, so the script will no longer work, regardless of python version, without a fix for this.

unfortunately i don't have time to work on this right now, but it should be fairly straight forward if someone sees this and wants to fix it in the future:

originally the naver makeID API was stateless, but now it requires a session cookie. so you'd have to do the following:

  1. issue a request to get a cookie
  2. supply that cookie to the makeID POST call

hope this helps, and sorry i'm unable to fix it fully at the moment!

— Reply to this email directly, view it on GitHub https://github.com/fcangialosi/naver_tts/issues/1#issuecomment-1889383171, or unsubscribe https://github.com/notifications/unsubscribe-auth/BBFGW2HPHGPTLZUNT57S6ELYOFDGDAVCNFSM6AAAAABAHKFQUGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBZGM4DGMJXGE . You are receiving this because you were mentioned.Message ID: @.***>