Gustaf-C / anki-chinese-support-3

Anki add-on providing support for Chinese study
https://ankiweb.net/shared/info/1752008591
GNU General Public License v3.0
26 stars 7 forks source link

send alpn extension in client hello for baidu tts #66

Closed kieranlblack closed 4 months ago

kieranlblack commented 4 months ago

Baidu web server seems to behave nondeterministically when the extension is not supplied, sometimes returning 200 OK but with Content-Length 0. When the extension is sent, the audio/mpeg content is returned as expected. Automatically sending the alpn extension was added in python 3.10 (https://github.com/python/cpython/commit/f97406be4c0a02c1501c7ab8bc8ef3850eddb962), but Anki is still using 3.9.

Close #61.

kieranlblack commented 4 months ago

@tchen9922 are you familiar with installing a custom extension in anki? Curious if this patch fixes the bug for you.

tchen9922 commented 4 months ago

@kieranlblack No sorry, I've never installed a custom extension in anki before. I tried to find a tutorial on YouTube, but nothing popped up :(

Gustaf-C commented 4 months ago

Thanks Kieran, looks good!