Open VondeSong opened 1 year ago
The request to Baidu fanyi tts API is blocked by the server.
@xyhp915 It seems this is caused by different HTTP request implementations on mobile platforms and Electron. Only Android fails to request the content.
This is caused by the Referer
header in the HTTP request
> curl -i -H 'Referer: http://localhost/' https://fanyi.baidu.com/gettts\?lan\=uk\&text\=denied\&spd\=3\&source\=web
HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Date: Wed, 01 Mar 2023 15:14:25 GMT
Server: Apache
Set-Cookie: BAIDUID=5F2F0CB214BB8F7FD8B5695618639E9E:FG=1; Path=/; Domain=baidu.com; Max-Age=31536000
Set-Cookie: BAIDUID_BFESS=5F2F0CB214BB8F7FD8B5695618639E9E:FG=1; Path=/; Domain=baidu.com; Max-Age=31536000; Secure; SameSite=None
Tracecode: 08651649272786780426030123
Vary: Accept-Encoding
Content-Length: 0
Also experiencing the same with .webm files. Working okay on desktop, but not able to link to on Android
Is there any type of video file that works?
Same issue with mp4 files. I have tried ones generated by zoom, sharex and handbrake none of them play. All of them plan if opened directly from the assets folder in android.
Search first
What Happened?
In Android, I can't play audio and video. I don't know whether the mobile terminal doesn't support it now, or whether my writing method has problems style of writing [:audio {:controls true :src "https://fanyi.baidu.com/gettts?lan=uk&text=denied&spd=3&source=web"}] ![](../assets/2022-01-23 23-06-03.mp4)
Reproduce the Bug
Desktop 0817
Expected Behavior
No response
Screenshots
Desktop or Mobile Platform Information
No response
Additional Context
No response
Are you willing to submit a PR? If you know how to fix the bug.