Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt latest youdao api #772

Closed
wants to merge 3 commits into from
Closed

Conversation

Rick630
Copy link

@Rick630 Rick630 commented Jan 3, 2025

有道API结构改了,且翻译结果有问题,抓了下新的API
参考:
#769 (comment)

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello Rick630, Thank you for your first PR contribution 🎉 Rick630

@Rick630 Rick630 changed the base branch from main to dev January 3, 2025 10:06
@Rick630 Rick630 marked this pull request as draft January 3, 2025 10:08
@Rick630 Rick630 marked this pull request as ready for review January 3, 2025 10:11
@tisfeng
Copy link
Owner

tisfeng commented Jan 4, 2025

感谢 PR,jsonapi_s 这个接口没问题,看起来是有道词典网页版接口,我以前调试过,只是没找到它的签名算法。

目前项目中使用的有道词典接口,是我很久之前从网上找的野生接口,很古老了,但一直可以使用,就没有改。

你的这个签名,是逆向网页源码找到的吗?如果没问题,感觉可以用 jsonapi_s 接口进行替换这个接口https://github.com/tisfeng/Easydict/pull/774/files#diff-61b09805a5f860812cc4082e99d2c8a9d7bc6fa31642817edd5b9e88ceccfa5bR47 ,我看了下,它们的返回数据结构是一样的。

image

@tisfeng
Copy link
Owner

tisfeng commented Jan 4, 2025

由于我已经使用 Swift 重写了有道服务,因此你这个 PR 就没办法合了,但你可以等这个 PR 合并后,另外提交一个 PR,将 #774 这里面的有道词典接口,使用 jsonapi_s 替换。

旧的词典接口虽然能用,但不确定它哪天会不会实效,我们保持和官网接口一致,这样会更好。

注意一点,有道词典有道翻译 是两个接口,词典接口虽然也能返回翻译结果,但它只支持有限几种文本语言,而翻译接口支持的语言种类更多,我们项目两种接口都支持,会并发请求。

@Rick630
Copy link
Author

Rick630 commented Jan 4, 2025

#774

这个接口的确是在网页https://dict.youdao.com 上扒的,旧接口(OC版) 应该是完全不能用了, 如: #769 (comment)

等你合并后我再发一个PR吧,这个先关闭了 :)

@Rick630 Rick630 closed this Jan 4, 2025
@tisfeng
Copy link
Owner

tisfeng commented Jan 5, 2025

@Rick630 你好,新版本已发布,你可以另外提交 PR 更新有道词典 API 了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants