成语大全网 - 汉语词典 - Django怎么调用有道词典或金山词典api获取单词发音?

Django怎么调用有道词典或金山词典api获取单词发音?

下面就是有道字典获取发音的请求头,你只需要将下面hello换成你要查询的单词即可。

GET /dictvoice?audio=hello&type=2 HTTP/1.1

Accept: */*

User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)

Referer: /search?q=hello&keyfrom=fanyi.smartResult

Accept-Language: zh-CN

Accept-Encoding: gzip, deflate

Host: dict.youdao.com

Connection: Keep-Alive