Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

这2个功能到底怎么用?image_hotlink_template 和 multimedia_hotlink_template #10135

Closed
1 task done
Whichbfj28 opened this issue Jul 5, 2022 · 1 comment
Closed
1 task done
Labels
question We may find it useful or that's what we missing

Comments

@Whichbfj28
Copy link

What feature is it?

下面是官方说明。介绍了原理。但是没给出完整实例。看得我一脸懵逼。


image_hotlink_template 和 multimedia_hotlink_template 允许用户提供链接模版用于替换媒体 URL。特定的路由和阅读器组合可能导致用户需要这些功能,但不是非常普遍。敏感字符将被自动转义,不会发生 XSS 攻击。替换范围仅限于媒体元素,即使注入脚本 URL 也不会被加载而造成 XSS。用户能且仅能控制的是「媒体从哪里来」。该功能通常不会带来副作用,如果需要开启这两个参数,请将 ALLOW_USER_HOTLINK_TEMPLATE 环境变量设置为 true

image_hotlink_template: 用于处理描述中图片的 URL,绕过防盗链等限制,留空不生效。用法参考 #2769 (opens new window)。可以使用 URL (opens new window)的所有属性(加上后缀 _ue 则会对其进行 URL 编码),格式为 JS 变量模板。例子:${protocol}//${host}${pathname}, https://i3.wp.com/${host}${pathname}, https://images.weserv.nl?url=${href_ue}

What problem does this feature solve?

来几个完整示例?

Additional description

No response

This is not a duplicated feature request

  • I have searched existing issues to ensure this feature has not already been requested
@Whichbfj28 Whichbfj28 added the RSS enhancement New feature or request to existing RSS label Jul 5, 2022
@TonyRL TonyRL added question We may find it useful or that's what we missing and removed RSS enhancement New feature or request to existing RSS labels Jul 5, 2022
@TonyRL
Copy link
Collaborator

TonyRL commented Jul 5, 2022

/bilibili/bangumi/media/9192?image_hotlink_template=https://images.weserv.nl?url=${href_ue}
/bilibili/bangumi/media/9192?image_hotlink_template=https://i3.wp.com/${host}${pathname}
...

@TonyRL TonyRL closed this as completed Jul 5, 2022
Repository owner locked and limited conversation to collaborators Mar 2, 2023
@TonyRL TonyRL converted this issue into discussion #12005 Mar 2, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question We may find it useful or that's what we missing
Projects
None yet
Development

No branches or pull requests

2 participants