DIYgod / RSSHub

🧡 Everything is RSSible
https://docs.rsshub.app
MIT License
33.47k stars 7.49k forks source link

Decode Google News URLs #17412

Open jstride opened 1 week ago

jstride commented 1 week ago

Routes

/google/news/:category/:locale

Full routes

https://rsshub.app/google/news/Top stories/hl=en-US&gl=US&ceid=US:en

Related documentation

https://docs.rsshub.app/routes/new-media#news-2

What is expected?

It would be great if the encoded URLs could be returned as the final URLs. So the route would return https://www.foxnews.com/politics/harris-trump-hold-dueling-final-rallies-crucial-blue-wall-battleground instead of the https://news.google.com/read/xxxx URL below.

What is actually happening?

https://news.google.com/read/CBMipgFBVV95cUxQQVZoMVE4R1VHUG1hYzlFVHFKZ0gwVWRNVm5YT1lGZnJWTEVqdDVJcm44YUhXYS1zYTJmS1QyWnJxaDc2bkd3Q21pYUktbnN4SXM0eXpFNnQxamxMUkN0OE5pbGRiQ1VEX19KcjBNcXhtZXpJZ1p6NXVhRkR5c1A3UnZxZUdrM2xLZ1V1UUpZY3BBbTRHaHNoZ2Z6MXBCYTBBaHN6NVZ30gGrAUFVX3lxTE9nSk8yMHhocVJHT2YwOVZnZldscFlwNXhSbDVpTkUxVDV6Y1BUYy13VHdSOGJVVlNkZTdSTHhvZ1pZZGtZY0N3SE5xanZnd3kwMnBkVThhZ25EQUxzWGtCQ3J5ci1hUUZjQzZULXh5UTZwSGdENG1HWUFxVnNmQVVEajl2ZUMzME82cndtUlVNX1FYMmVwODB3Qk1QVFNCNjFKOUo0TjE2bEtXRQ?hl=en-AU&gl=AU&ceid=AU%3Aen is returned which requires javascript to manage the redirect which most RSS tools don't have.

Deployment information

RSSHub demo (https://rsshub.app)

Deployment information (for self-hosted)

No response

Additional info

https://github.com/SSujitX/google-news-url-decoder/blob/main/googlenewsdecoder/new_decoderv1.py shows how to decode the URL

This is not a duplicated issue

github-actions[bot] commented 1 week ago
Searching for maintainers:

To maintainers: if you are not willing to be disturbed, list your username in scripts/workflow/test-issue/call-maintainer.js. In this way, your username will be wrapped in an inline code block when tagged so you will not be notified.

If all routes can not be found, the issue will be closed automatically. Please use NOROUTE for a route-irrelevant issue or leave a comment if it is a mistake. 如果所有路由都无法匹配,issue 将会被自动关闭。如果 issue 和路由无关,请使用 NOROUTE 关键词,或者留下评论。我们会重新审核。

pseudoyu commented 6 days ago

Yes it can be decoded to target url, however the decoding process needs extra requests to google news api for each item and may easily reach rate limit.

And I fixed the title, content and author fields of this api so I think it's enough for RSS reader? You can try it.

jstride commented 6 days ago

Thanks - that fix works for the titles/etc. The decoding the URL can be done in a batch (rather than individual requests). I was thining of the use case of using your RSS reader offline where it downloads the article content.

pseudoyu commented 5 days ago

Thanks - that fix works for the titles/etc. The decoding the URL can be done in a batch (rather than individual requests). I was thining of the use case of using your RSS reader offline where it downloads the article content.

okay I'm working on it.