api/reddit: add support for mobile links & bunch of other links (#1098)

* api/reddit: extract params from a mobile share link

* api/reddit: add support for a bunch of links & update the api endpoint

also fixed "undefined" in a filename when downloading a user post

* api/service-patterns: fix reddit id pattern
This commit is contained in:
wukko
2025-02-10 00:17:48 +06:00
committed by GitHub
parent 5306760890
commit a0f227d68b
4 changed files with 43 additions and 14 deletions

View File

@@ -20,8 +20,10 @@ export const testers = {
pattern.id?.length <= 128 || pattern.shortLink?.length <= 32,
"reddit": pattern =>
(pattern.sub?.length <= 22 && pattern.id?.length <= 10)
|| (pattern.user?.length <= 22 && pattern.id?.length <= 10),
pattern.id?.length <= 16 && !pattern.sub && !pattern.user
|| (pattern.sub?.length <= 22 && pattern.id?.length <= 16)
|| (pattern.user?.length <= 22 && pattern.id?.length <= 16)
|| (pattern.sub?.length <= 22 && pattern.shareId?.length <= 16),
"rutube": pattern =>
(pattern.id?.length === 32 && pattern.key?.length <= 32) ||