Skip to content
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

template2的script有BUG,但高清图的获取有现成代码 #20

Open
XDcedar opened this issue Nov 2, 2024 · 0 comments
Open

template2的script有BUG,但高清图的获取有现成代码 #20

XDcedar opened this issue Nov 2, 2024 · 0 comments

Comments

@XDcedar
Copy link

XDcedar commented Nov 2, 2024

现在 template2.html 是内嵌 <script> 替换 url 来获得高清图片,但是这个代码只能产生一大堆类似 https://D:/path/to/img 的错误本地路径的链接。
然而实际上获取贴吧高清图片的代码已经有大佬实现了,只要两行JS,能不能做进功能里,不要通过 template 来实现?

let m = url.match(/^(https?):\/\/(?:imgsrc|imgsa|\w+\.hiphotos)\.(?:bdimg|baidu)\.com\/(?:forum|album)\/.+\/(\w+\.(?:jpg|jpeg|gif|png|bmp|webp))(?:\?.+)?$/i);
if(m) {
  document.location = m[1] + "://imgsrc.baidu.com/forum/pic/item/" + m[2];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant