Pixiv图片下载

添加一个按钮🤤来下载图片

< 脚本Pixiv图片下载的反馈

评价:一般 - 脚本能用,但还有一些问题

§
发表于:2025-02-07

在ViolentMonkey v2.30.0下无法下载多图,报错

Error: Can't read the data of 'the loaded zip file'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?

研究后发现是response.response类型不对,修改XMLHTTPRequestresponseTypearraybuffer可解决:

--- old 2025-02-07 05:08:25.346056640 +0000
+++ new 2025-02-07 05:07:33.166095813 +0000
@@ -201,7 +201,7 @@
                   GM_xmlhttpRequest({
                     method: 'GET',
                     url: link,
-                    responseType: 'blob',
+                    responseType: 'arraybuffer',
                     headers:{referer:"https://i.pximg.net/*"},
                       onprogress: function(event) {
         if (event.lengthComputable) {
@@ -269,7 +269,7 @@
                   GM_xmlhttpRequest({
                     method: 'GET',
                     url: link,
-                    responseType: 'blob',
+                    responseType: 'arraybuffer',
                     headers:{referer:"https://i.pximg.net/*"},
                       onprogress: function(event) {
         if (event.lengthComputable) {

发表回复

登录以发表回复。