![]() |
1
NewYear 130 天前
不可以拼接。
imgur 这种 URL 有两种,一种是单个图片,一种是多图片(虽然也可能只放了 1 个图)。 单图片理论上拼接后缀名可以成功,但要猜测后缀名难咯。 我的解决办法是通过 API 获取原图 URL 。 你去看看吧,API 没有门槛的,直接可以用。 |
![]() |
2
NewYear 130 天前
"单图片理论上拼接后缀名可以成功,但要猜测后缀名难咯。"
单个图片 URL ,直接拼后缀可以,但要猜测后缀名。 多图片 URL (但页面可能也显示为单图片),则要通过 API 获取“原图 URL”,多图方式的图片文件名和 URL 是无关的。 |
![]() |
3
tomorrow092 OP 单个图片 URL ,直接拼后缀可以,但要猜测后缀名。
后缀名随便写,写错了也没关系. imgurl 是不关心后缀名的. i.imgur 链接直接指向图像,而 imgur.com 链接指向 imgur 页面,该页面还显示图片、带宽和其他图片。 任何 imgur 链接都可以替换为 i.imgur ,您将看到没有其他信息的图片。 ![]() |
![]() |
4
tomorrow092 OP |
![]() |
5
tomorrow092 OP |
![]() |
6
tomorrow092 OP |
![]() |
7
NewYear 129 天前
@tomorrow092 #5
如果你懒,就按照我说的方法最简单。 如果你很勤快,看一眼他家的 API ,直接写一个也很容易,事实上我就是写过一次了,不过我的是套件,不适合拿出来。 如果你又懒又勤快,可以发给 AI 帮你解决,它都可以做到。 |
![]() |
8
tomorrow092 OP @NewYear #7
我现在写了个热字符串脚本 /** * 使用 Default 语法发图片 Imgur ,域名为 i.imgur.com,且带有格式后缀 */ :*:v2defaultimg:: { genV2_DefaultImg() } :*:v2img:: { genV2_DefaultImg() } genV2_DefaultImg() { ; Trim clipboard content tempClipboard := Trim(A_Clipboard) ; Check if clipboard is empty or not a URL if (tempClipboard = "" || !RegExMatch(tempClipboard, "^https?://")) { commonShowNotify("info", "剪贴板为空或者不是 url", 6) return } commonShowNotify("info", ".", 6) ; Process each line in the clipboard urls := StrSplit(tempClipboard, "`n", "`r") for url in urls { trimUrl := Trim(url) if (trimUrl != "") { ; 检查 URL 是否以 https://imgur.com/ 开头 if (InStr(trimUrl, "https://imgur.com/", CaseSensitive := false) == 1) { ; 对于 imgur 图片链接,转换为 i.imgur.com 并添加 .png 后缀 imgurId := SubStr(trimUrl, StrLen("https://imgur.com/") + 1) defaultImgUrl := "https://i.imgur.com/" . imgurId . ".png" SendText(defaultImgUrl) } else { ; 对于其他链接,直接使用标准 Markdown 链接格式 SendText(trimUrl) } SendEvent "{End}{Enter}" } } } |
![]() |
9
NewYear 129 天前
|