Commit Graph

14 Commits

Author SHA1 Message Date
github-actions[bot] a28890a135 style: auto format 2025-11-27 02:55:46 +00:00
Tony f68f81c49d
fix(utils/common-config): import parseDate and timezone functions for date handling (#19023) 2025-05-06 02:07:35 +08:00
COxDE 2962c6f64f
feat(middleware): process feed title and description using LLM (#16464)
* feat(middleware): add title translation using LLM

* refactor: combine title and description

* fix: camelCase for variables

* refactor: try to update the test case

---------
2024-08-22 02:15:00 +08:00
Tony 41c6861d88
fix(got): posting form as x-www-form-urlencoded (#15348) 2024-04-24 00:10:53 +08:00
Rongrong f3cf86cd72
fix(core/utils/wechat-mp): empty description when request blocked by WAF (#15294)
* fix(core/utils/wechat-mp): empty description when request blocked by WAF

Silently falling back to the fallback method would generate empty
description. Fixed by throwing an error when failed to extract
item_show_type from the page.

Some misc warnings are also added to make bug reporting easier.

Signed-off-by: Rongrong <i@rong.moe>

* fix(core/utils/wechat-mp): err msg for unknown page

Signed-off-by: Rongrong <i@rong.moe>

* test(core/utils/wechat-mp): fix coverage

Signed-off-by: Rongrong <i@rong.moe>

* fix(core/utils/wechat-mp): ESLint no-await-in-loop

Signed-off-by: Rongrong <i@rong.moe>

* fix(core/utils/wechat-mp): normalizeUrl: &amp; -> &

Signed-off-by: Rongrong <i@rong.moe>

* feat(core/utils/wechat-mp): do not prompt raising an issue when blocked
by WAF

Signed-off-by: Rongrong <i@rong.moe>

* feat(core/utils/wechat-mp): recognize deleted page

Signed-off-by: Rongrong <i@rong.moe>

* feat(core/utils/wechat-mp): log when error

Prevent errors from being completely suppressed if the caller catches
them.

Signed-off-by: Rongrong <i@rong.moe>

---------

Signed-off-by: Rongrong <i@rong.moe>
2024-04-22 02:19:33 +08:00
Rongrong a99b35f257
feat(core/utils/wechat-mp): major rewrite (#15276)
* feat(core/utils/wechat-mp): major rewrite

* Support more `item_show_type`: `APP_MSG_PAGE`, `VIDEO_SHARE_PAGE`,
`AUDIO_SHARE_PAGE`, and `IMG_SHARE_PAGE`. Previously only the first one
could be parsed properly. There are still some other known types waiting
for live examples for further adaptation. If this is the case, a
fallback method will try to generate entries using mostly OpenGraph
metadata. Meanwhile, the administrator of self-hosted instances will see
warnings in the log, asking them to report the URL as a new live
example. Still, `VIDEO_SHARE_PAGE` explicitly uses the fallback method
without any warning, as there is no possible approach to generate a
video/iframe URL from page metadata.

* Show audio and videos in `APP_MSG_PAGE`. However, not all videos
can be shown due to the same reason as `VIDEO_SHARE_PAGE`.

* Show the location where the article is sent.

* Some bugs, mostly due to outdated cheerio selector, are fixed.

* Add a new sub-route `wechat-mp` to `/test` to make things easier.

* All changes are well-tested.

Signed-off-by: Rongrong <i@rong.moe>

* style(core/utils/wechat-mp): fix ESLint & CodeQL errors

Signed-off-by: Rongrong <i@rong.moe>

* style(core/utils/wechat-mp): fix a DeepScan issue

Signed-off-by: Rongrong <i@rong.moe>

* style(core/utils/wechat-mp): fix ESLint error

Another try w/ pre-commit hook disabled.

Signed-off-by: Rongrong <i@rong.moe>

---------

Signed-off-by: Rongrong <i@rong.moe>
2024-04-18 22:05:32 +08:00
DIYgod bf4e5dd78f
test: fix caces 2024-03-31 23:13:22 +08:00
DIYgod bec0ba0705
test: request headers 2024-03-30 18:29:38 +08:00
DIYgod 2a366ef56d
test: rss-parser test 2024-03-27 16:18:37 +08:00
DIYgod a87ec36450
test: got test 2024-03-27 16:15:39 +08:00
DIYgod bcd5f6ff8b
test: rand-user-agent test 2024-03-27 15:37:51 +08:00
DIYgod 3016a2f44f
test: fix wechat-mp test 2024-03-27 14:53:43 +08:00
DIYgod 760f48b8cf
test: fix common-config test 2024-03-27 14:49:43 +08:00
DIYgod eec2a71953
test: setup msw 2024-03-27 14:26:20 +08:00