yihong0618 / duolingo_remember

Automatically send new words from duolingo to telegram
MIT License
167 stars 44 forks source link

Workflow RUN ERROR: KeyError: 'zc' #7

Open HamGuy opened 1 year ago

HamGuy commented 1 year ago
Run python duolingo.py *** ***  --tele_token *** --tele_chat_id *** --latest_number 20
[2](https://github.com/HamGuy/duolingo_remember/actions/runs/4796140553/jobs/8531564656#step:7:2)
  python duolingo.py *** ***  --tele_token *** --tele_chat_id *** --latest_number 20
[3](https://github.com/HamGuy/duolingo_remember/actions/runs/4796140553/jobs/8531564656#step:7:3)
  shell: /usr/bin/bash -e {0}
[4](https://github.com/HamGuy/duolingo_remember/actions/runs/4796140553/jobs/8531564656#step:7:4)
  env:
[5](https://github.com/HamGuy/duolingo_remember/actions/runs/4796140553/jobs/8531564656#step:7:5)
    OPENAI_API_KEY: ***
[6](https://github.com/HamGuy/duolingo_remember/actions/runs/4796140553/jobs/8531564656#step:7:6)
    EDGE_GPT_COOKIE: ***
[7](https://github.com/HamGuy/duolingo_remember/actions/runs/4796140553/jobs/8531564656#step:7:7)
    LATEST_WORDS_NUMBER: 20
[8](https://github.com/HamGuy/duolingo_remember/actions/runs/4796140553/jobs/8531564656#step:7:8)
    pythonLocation: /opt/hostedtoolcache/Python/3.8.16/x64
[9](https://github.com/HamGuy/duolingo_remember/actions/runs/4796140553/jobs/8531564656#step:7:9)
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.8.16/x64/lib/pkgconfig
[10](https://github.com/HamGuy/duolingo_remember/actions/runs/4796140553/jobs/8531564656#step:7:10)
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.8.16/x64
[11](https://github.com/HamGuy/duolingo_remember/actions/runs/4796140553/jobs/8531564656#step:7:11)
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.8.16/x64
[12](https://github.com/HamGuy/duolingo_remember/actions/runs/4796140553/jobs/8531564656#step:7:12)
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.8.16/x64
[13](https://github.com/HamGuy/duolingo_remember/actions/runs/4796140553/jobs/8531564656#step:7:13)
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.8.16/x64/lib
[14](https://github.com/HamGuy/duolingo_remember/actions/runs/4796140553/jobs/8531564656#step:7:15)
Traceback (most recent call last):
[15](https://github.com/HamGuy/duolingo_remember/actions/runs/4796140553/jobs/8531564656#step:7:16)
  File "duolingo.py", line 302, in <module>
[16](https://github.com/HamGuy/duolingo_remember/actions/runs/4796140553/jobs/8531564656#step:7:17)
    main(
[17](https://github.com/HamGuy/duolingo_remember/actions/runs/4796140553/jobs/8531564656#step:7:18)
  File "duolingo.py", line 238, in main
[18](https://github.com/HamGuy/duolingo_remember/actions/runs/4796140553/jobs/8531564656#step:7:19)
    ) = get_duolingo_words_and_save_mp3(tts_url, latest_num=latest_num)
[19](https://github.com/HamGuy/duolingo_remember/actions/runs/4796140553/jobs/8531564656#step:7:20)
  File "duolingo.py", line 206, in get_duolingo_words_and_save_mp3
[20](https://github.com/HamGuy/duolingo_remember/actions/runs/4796140553/jobs/8531564656#step:7:21)
    make_edge_article_tts_mp3(article, language_short)
[21](https://github.com/HamGuy/duolingo_remember/actions/runs/4796140553/jobs/8531564656#step:7:22)
  File "duolingo.py", line 130, in make_edge_article_tts_mp3
[22](https://github.com/HamGuy/duolingo_remember/actions/runs/4796140553/jobs/8531564656#step:7:23)
    language = random.choice(EDGE_TTS_DICT[language_short][gender])
[23](https://github.com/HamGuy/duolingo_remember/actions/runs/4796140553/jobs/8531564656#step:7:24)
KeyError: 'zc'
[24](https://github.com/HamGuy/duolingo_remember/actions/runs/4796140553/jobs/8531564656#step:7:25)
Error: Process completed with exit code 1.
yihong0618 commented 1 year ago

@HamGuy seems edge-tts do not support zc could you tell me what language you are learning that short name is zc?

IlluminateDarkheat commented 1 year ago

@HamGuy seems edge-tts do not support zc could you tell me what language you are learning that short name is zc?

I encountered the same problem.

The language I am learning on Duolingo is Cantonese. It seems that Duolingo has labeled it as zc.

I guess zc here means zh-cht