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

关于对"["和"]"的转义问题 #60

Open
Mrodot opened this issue Apr 9, 2020 · 3 comments
Open

关于对"["和"]"的转义问题 #60

Mrodot opened this issue Apr 9, 2020 · 3 comments
Labels
问题 咨询使用存在的问题

Comments

@Mrodot
Copy link

Mrodot commented Apr 9, 2020

不知道是Pixiv网站又改版了还是其它的原因,之前设置好的下载路径的掩码,最近在下载文件时,路径和名称貌似在方括号的转义上有些问题。

这个是我设置的掩码:
%{illust.user.name}/\[%{illust.id}\]\[%{illust.user.id}\]%{illust.title}\[%{page}\].%{illust.extention}
实现的命名效果举例:
图片id:79087518
作者id:444942
命名效果:
下载文件夹\けいらん@お仕事募集中\[79087518][444942]コッコロママ[0].png
但是实际情况却是:
下载文件夹\けいらん@お仕事募集中\[79087518\]\[444942\]コッコロママ\[0\].png

打开Tampermonkey的储存设置页面后发现,在"savepath"项中之前存储的下载路径的掩码变成了:
%{illust.user.name}/\\[%{illust.id}\\]\\[%{illust.user.id}\\]%{illust.title}\\[%{page}\\].%{illust.extention}

另外在windows和Linux系的系统中,文件路径的分隔符不太一样,不知道在写文件路径掩码这一块时该用\还是/作为文件路径分隔符呢?

@Mapaler
Copy link
Owner

Mapaler commented Apr 9, 2020

在github上发帖默认使用Markdown语言,所以你的转义符都被消除了,需要写在code里面(我已经给你改好了)
图像 1


目前转义符只在掩码内部需要,掩码外部是普通的字符串(所见即所得)。而且掩码内也不需要对`[ ]`进行转义。你用文本输出模式测试一下你的掩码就可以看到输出结果的。

Linux的路径分隔符可以在Windows用,但是反过来不行,所以一律用/就好。

@Mapaler Mapaler added the 问题 咨询使用存在的问题 label Apr 9, 2020
@Mrodot
Copy link
Author

Mrodot commented Apr 12, 2020

感谢您的帮助和回复!
还有一个小问题,不知道能不能加入一个配置文件的导入导出功能,这样能方便把自己的配置文件分享给不懂怎么配置的好友使用

@Mapaler
Copy link
Owner

Mapaler commented Apr 12, 2020

@Mrodot
有计划,但还没开发。目前你可以直接在tampermonkey里把储存复制出来。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
问题 咨询使用存在的问题
Projects
None yet
Development

No branches or pull requests

2 participants