Skip to content

Commit

Permalink
Add more referer spoofing
Browse files Browse the repository at this point in the history
Based on #2261. For moyu.im/jandan.net, see DIYgod/RSSHub#11528
  • Loading branch information
jvoisin authored and fguillot committed Dec 20, 2024
1 parent 276b2d8 commit bd91e5f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/reader/rewrite/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ func GetRefererForURL(u string) string {
}

switch parsedUrl.Hostname() {
case "moyu.im":
return "https://i.jandan.net"
case "i.pximg.net":
return "https://www.pixiv.net"
case "sp1.piokok.com":
Expand All @@ -60,13 +62,19 @@ func GetRefererForURL(u string) string {
return "https://weibo.com"
case "img.hellogithub.com":
return "https://hellogithub.com"
case "bjp.org.cn":
return "https://bjp.org.cn"
case "appinn.com":
return "https://appinn.com"
}

switch {
case strings.HasSuffix(parsedUrl.Hostname(), ".sinaimg.cn"):
return "https://weibo.com"
case strings.HasSuffix(parsedUrl.Hostname(), ".cdninstagram.com"):
return "https://www.instagram.com"
case strings.HasSuffix(parsedUrl.Hostname(), ".moyu.im"):
return "https://i.jandan.net"
}

return ""
Expand Down

0 comments on commit bd91e5f

Please sign in to comment.