神代綺凛

[Pxder] Pixiv 插画下载器
可按根据指定画师 UID 解析并下载插画(包括动图)、一键下载所有你关注的画师的插画或收藏的插画、智能增量更新下载...
扫描右侧二维码阅读全文
24
2018/08

[Pxder] Pixiv 插画下载器

可按根据指定画师 UID 解析并下载插画(包括动图)、一键下载所有你关注的画师的插画或收藏的插画、智能增量更新下载过的画师的插画。

多线程下载,并且支持使用 HTTP 与 SOCKS 代理。

Head Pic: 「五河琴里」/「秋原ノゾミ Sheila」のイラスト [pixiv]

Pxder

由于 Pixiv 已不再支持客户端的登录 API,请更新到 v2.12.0 及以后的版本以使用新的登录方式

运行示例

此项目基于 Node.js,姑且算自己学习的副产物(实际上是不务正业的产物

最大的缺点是没有 GUI,纯命令行操作,不过也并不难用(信我)

安装及使用等说明请直接看 Github 项目文档

注意

因P站域名遭到 GFW 的 SNI 阻断,这意味着只要你在大陆内,即便你改了 Hosts 也无法直接使用 pxder,请记得使用pxder --setting设置代理或启用直连模式

从现在开始所有在评论中询问因未挂代理而产生的问题都将会被无视

搬瓦工VPS优惠套餐,建站稳如狗,支持支付宝,循环出账94折优惠码BWH3HYATVBJW
年付$47CN2线路,1核/1G内存/20G硬盘/1T@1Gbps【点击购买
季付$47CN2 GIA线路,1核/1G内存/20G硬盘/1T@2.5Gbps【点击购买
Last modification:February 12th, 2021 at 05:31 pm
If you think my article is useful to you, please feel free to appreciate

Leave a Comment

412 comments

  1. 飞言  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 116.0.0.0(Google Chrome 116.0.0.0)
    输入pxder --login登录时,根本不会弹出窗口,PC..
    显示:
    Pixiv Login

    Before login, please read this first -> https://git.io/Jt6Lj
    Continue? [y/n]: y

    Login URL: https://app-api.pixiv.net/web/v1/login?code_challenge=ogU5XT6lcdPaTcvMcbadzqyfLxgafZCuDu0-WYcIaEA&code_challenge_method=S256&client=pixiv-android
    code:
    而F12没这一项。

    1. 神代綺凛  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 119.0.0.0(Google Chrome 119.0.0.0)
      @飞言 不弹就手动打开那个网址就好了,之后按其他系统的那个操作来
      1. 飞言  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 120.0.0.0(Google Chrome 120.0.0.0)
        @神代綺凛 是的,是按照其他操作系统来操作的。
        但,F12里面没有 Query String Parameters这一选项。
        最后一项的图标也是一个红色的X
        点了继续登录,返回的的确是“空白页”
        1. 神代綺凛  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 120.0.0.0(Google Chrome 120.0.0.0)
          @飞言 新版的 chrome 界面有改动,你看最上面的 url 那里就行了,是 pixiv:// 开头的,后面会有个参数 code=xxxx,把等号后面的内容复制出来
  2. MORI  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 116.0.0.0(Google Chrome 116.0.0.0)
    Network error! Pause 5 minutes
    上次使用还是在19年,很高兴优秀的工具如今还能使用。
    多次试错,我判断该问题都是出在标题为符号的图片上。
    版本号:2.12.8
    几个例子:(pid81484149)(pid88953328)(pid102507760)
    DEBUG:
    Error: ENOENT: no such file or directory, open 'C:\Users\XXX\AppData\Roaming\pxder\tmp(100961431)?_p2.jpg'
    at Object.openSync (node:fs:602:3)
    at Object.writeFileSync (node:fs:2334:35)
    at Object.download (C:\Users\XXX\AppData\Roaming\npm\node_modules\pxder\src\tools.js:52:9)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async C:\Users\XXX\AppData\Roaming\npm\node_modules\pxder\src\downloader.js:187:5 {
    errno: -4058,
    syscall: 'open',
    code: 'ENOENT',
    path: 'C:\Users\XXX\AppData\Roaming\pxder\tmp\(100961431)?_p2.jpg'
    1. 神代綺凛  Mac OS X 10.15.7(Mac OS X 10.15.7) / Google Chrome 117.0.0.0(Google Chrome 117.0.0.0)
      @MORI node 20.4 开始有这个 bug,降级到 20.3 或更早的版本
      1. MORI  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 119.0.0.0(Google Chrome 119.0.0.0)
        @神代綺凛 感谢大大,降级之后可以正常使用了
  3. 洗胃可乐  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 113.0.0.0(Google Chrome 113.0.0.0)
    上个月还没问题,今天试了下。不管是直连模式还是走代理,都会反复出现Network error! Pause 5 minutes,一张图片都下载不了。
    -f不会产生新关注的文件夹,反复Network error。-u检测到新的进行下载时,也一样。一张都下不了提示Network error。
    尝试使用pxder --debug输出,提示Missing arguments。
    已使用npm i -g pxder更新至最新版本。
    已尝试使用不同的代理节点,已尝试重新登录。
    1. 神代綺凛  Mac OS X 10.15.7(Mac OS X 10.15.7) / Google Chrome 113.0.0.0(Google Chrome 113.0.0.0)
      @洗胃可乐 --debug 参数加到你正常使用的指令后面,pxder -u xxx --debug

      你的 node 版本是多少

      1. 洗胃可乐  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 113.0.0.0(Google Chrome 113.0.0.0)
        @神代綺凛 之前是是16.10版本,出现问题后也尝试更新了新的18.16版本,也不行。
        已尝试重装pxder
        debug出来提示是
        Error: Request failed with status code 522
        at createError (C:\Users\14610\AppData\Roaming\npm\node_modules\pxder\node_modules\axios\lib\core\createError.js:16:15)
        at settle (C:\Users\14610\AppData\Roaming\npm\node_modules\pxder\node_modules\axios\lib\core\settle.js:17:12)
        at IncomingMessage.handleStreamEnd (C:\Users\14610\AppData\Roaming\npm\node_modules\pxder\node_modules\axios\lib\adapters\http.js:293:11)
        at IncomingMessage.emit (node:events:525:35)
        at endReadableNT (node:internal/streams/readable:1359:12)
        1. 神代綺凛  Mac OS X 10.15.7(Mac OS X 10.15.7) / Google Chrome 113.0.0.0(Google Chrome 113.0.0.0)
          @洗胃可乐 哦,知道原因了,我修复一下
          1. 洗胃可乐  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 113.0.0.0(Google Chrome 113.0.0.0)
            @神代綺凛 谢谢大佬
  4. yuanqing  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 70.0.3538.25(Google Chrome 70.0.3538.25)
    不好意思打扰了 想请问一下开了直连模式之后登录还是一直提示Connection reset detected.怎么办呀TT
  5. 刷新球  Windows 10 x64 Edition(Windows 10 x64 Edition) / Firefox 110.0(Firefox 110.0)
    梯子特别卡然后我就关了,结果裸连居然还能下载!还特别快
  6. 刷新球  Windows 10 x64 Edition(Windows 10 x64 Edition) / Firefox 107.0(Firefox 107.0)
    • fetchMetadata: sill resolveWithNewModule pxder@2.12.7 checking installable status 卡在这步了求大佬帮助
  7. Articfact  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 102.0.5005.63(Google Chrome 102.0.5005.63)
    大佬,您好。请问有办法将公开关注的画师和私密关注的画师分开两个文件夹保存吗?
  8. Articfact  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 101.0.4951.41(Google Chrome 101.0.4951.41)
    不管是用-f命令还是后面加--force,都提示
    Collecting your follows
    Progress: 4977ERROR {"error":{"user_message":"","message":"{\"offset\":[\"Offset must be no more than 5000\"]}","reason":"","user_message_details":{}}},是因为关注数太多了吗?
    1. 神代綺凛  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 101.0.4951.54(Google Chrome 101.0.4951.54)
      @Articfact 是的,看起来不能超过5000关注
  9. 洗胃可乐  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 99.0.4844.74(Google Chrome 99.0.4844.74)
    一直提示Rate limit detected是为啥呀,一次性扒太多了吗,换节点也没用
    1. 神代綺凛  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 99.0.4844.84(Google Chrome 99.0.4844.84)
      @洗胃可乐 是的
  10. Rellow  Windows 7 x64 Edition(Windows 7 x64 Edition) / Google Chrome 80.0.3987.132(Google Chrome 80.0.3987.132)
    win7咋办啊嘤嘤嘤OωO
  11. 小谢  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 96.0.4664.110(Google Chrome 96.0.4664.110)
    最近的问题,我开启了VPN,同时也设置了pxder,但是会被P站检测到问题而不让我验证,从而导致我无法登录P站。
    P站的验证系统提示:

    您的计算机或网络可能在发送自动查询内容。为了保护我们的用户,我们目前无法处理您的请求。如需了解更多详情,请访问我们的帮助页面。
    1. 小谢  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 96.0.4664.110(Google Chrome 96.0.4664.110)
      @小谢 然后我关掉了pxder同时再次刷新网页(此时我的vpn还没关闭,P站刷新页面后能正常回到登录还没进入的状态,当我点击验证的时候,验证图片就出来了。)
      1. 小谢  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 96.0.4664.110(Google Chrome 96.0.4664.110)
        @小谢 找到解决方法了,需要通过大佬你给的pxder --login --no-protocol命令进行解决:具体解决方式如下:
        1.按照教程进行操作,直至转到登录界面
        2.可以点击继续登录,这个时候的验证不会被阻拦
        3.验证完点击登录后,按照教程f12会多出一个红色的login?条目,双击该条目会弹出新的空白网页,但是可以复制code=到&via这中间一段的code字符串。然后粘贴,这样登录成功了。
        以上仅仅只是我自己的解决方法,不代表百分百按照教程的来解决,与教程的解决方案有一点不一样,谢谢。
        说的不对的还望指正,谢谢各位ヾ(≧∇≦*)ゝ
  12. Fluquor  Windows 10 x64 Edition(Windows 10 x64 Edition) / Opera 82.0.4227.33(Opera 82.0.4227.33)
    该评论仅登录用户及评论双方可见
    1. 神代綺凛  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 96.0.4664.110(Google Chrome 96.0.4664.110)
      @Fluquor 挺好的,如果愿意的话可以提 pr 过来
      1. Fluquor  Windows 10 x64 Edition(Windows 10 x64 Edition) / Opera 82.0.4227.33(Opera 82.0.4227.33)
        @神代綺凛 好!!!!其实我是觉得我改的不好怕你嫌弃,,
        1. Fluquor  Windows 10 x64 Edition(Windows 10 x64 Edition) / Opera 82.0.4227.33(Opera 82.0.4227.33)
          @Fluquor 第一次用Pull requests,不知道操作对不对。其实我觉得真的一边获取一边写json文件其实挺好的,能保存进度,而且获取的越多写入越慢,本来这是缺点等半天写,但是这样Rate Limit都不咋出现了,笑
          对了想起来一件事,如果画师按以前的名称创建的文件夹和新文件夹同时存在直接重命名会报错,我就很简单的改了一下把旧的文件夹里面的文件移动过去了删除旧文件夹。出现这种情况会输出已存在新文件夹。
          之所以我遇到这个问题,是因为最开始在家里下载了,上学不能下载到家里,就在学校下载了之后之后重新放一起时发现的
          最后,附上几张下载收藏的相关的截图
          1. Fluquor  Windows 10 x64 Edition(Windows 10 x64 Edition) / Opera 82.0.4227.33(Opera 82.0.4227.33)
            @Fluquor !(rename)[http://www.deathggunod.space/img/pxrepo/rename.jpg]
            下载一晚上正好同时遇到自动重命名是否已经存在新文件夹名称的不同情况
            1. Fluquor  Windows 10 x64 Edition(Windows 10 x64 Edition) / Opera 82.0.4227.33(Opera 82.0.4227.33)
              @Fluquor 额,括号写反了
              1. 神代綺凛  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 96.0.4664.110(Google Chrome 96.0.4664.110)
                @Fluquor 好了
          2. 神代綺凛  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 96.0.4664.110(Google Chrome 96.0.4664.110)
            @Fluquor
            该评论仅登录用户及评论双方可见
            1. Fluquor  Windows 10 x64 Edition(Windows 10 x64 Edition) / Opera 82.0.4227.33(Opera 82.0.4227.33)
              @神代綺凛
              该评论仅登录用户及评论双方可见
              1. 神代綺凛  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 96.0.4664.110(Google Chrome 96.0.4664.110)
                @Fluquor
                该评论仅登录用户及评论双方可见
          3. Fluquor  Windows 10 x64 Edition(Windows 10 x64 Edition) / Opera 82.0.4227.33(Opera 82.0.4227.33)
            @Fluquor
            该评论仅登录用户及评论双方可见
          4. Fluquor  Windows 10 x64 Edition(Windows 10 x64 Edition) / Opera 82.0.4227.33(Opera 82.0.4227.33)
            @Fluquor


            所有收藏图片都获取信息储存下来了(没准花了快一个小时>﹏<,但是问题不大,以后不需要再次获取了,直接读取就好,)请不要问我为什么收藏了这么多。(另外获取私有收藏,可以用-B false 表示是否公开为false,获取私有收藏)
            1. Fluquor  Windows 10 x64 Edition(Windows 10 x64 Edition) / Opera 82.0.4227.33(Opera 82.0.4227.33)
              @Fluquor 没想到进程居然被杀了,心好累,获取的bookMark.json太大了出错了,不过算了,至少能证明可以一次性获取所有收藏中途不会终止。然后能正常下载
    2. Fluquor  Windows 10 x64 Edition(Windows 10 x64 Edition) / Opera 82.0.4227.33(Opera 82.0.4227.33)
      @Fluquor
      该评论仅登录用户及评论双方可见
  13. Zynismus16  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 96.0.4664.55(Google Chrome 96.0.4664.55)
    请问登录时获取code浏览器没有专门的code行,我用的文件头,如
    请求 URL: pixiv://account/login?code=m-6LI4A7p4**tw4Uk46BDHSZyfvl38&via=login
    中的code值登录提示
    Login fail! Please check your input or proxy setting.
    是什么问题,确认能访问pixiv
    1. 神代綺凛  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 96.0.4664.45(Google Chrome 96.0.4664.45)
      @Zynismus16 加上 debug 参数,失败时会输出具体错误

      pxder --login --debug
      1. Zynismus16  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 96.0.4664.55(Google Chrome 96.0.4664.55)
        @神代綺凛 感谢!
        是我的code输入错误
        由于没有单独行,我加上了xxxx&via=login内容
        导致code错误。
        再次感谢
  14. Zicki  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 93.0.4577.82(Google Chrome 93.0.4577.82)
    作者大大,如果他就卡在那該怎麼辦呢?
  15. 小谢  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 93.0.4577.63(Google Chrome 93.0.4577.63)
    这些是原图保存吗?还是保存的预览图?
    1. 神代綺凛  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 93.0.4577.63(Google Chrome 93.0.4577.63)
      @小谢 原图
      1. 小谢  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 93.0.4577.63(Google Chrome 93.0.4577.63)
        @神代綺凛 好的,谢谢~
  16. JIN  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 86.0.4240.198(Google Chrome 86.0.4240.198)
    加了-M参数还是会抓取动图呢
    1. 神代綺凛  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 92.0.4515.159(Google Chrome 92.0.4515.159)
      @JIN-M 是不会去抓取动图的详细信息(帧率),但动图还是会下载的
      1. JIN  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 86.0.4240.198(Google Chrome 86.0.4240.198)
        @神代綺凛 就是节省时间,但是下载的动图压缩包还是和没加-M参数的一样?
        1. 神代綺凛  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 92.0.4515.159(Google Chrome 92.0.4515.159)
  17. Admin  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 90.0.4430.93(Google Chrome 90.0.4430.93)
    怎么可以自定义画师文件夹和作品的文件名规则?
    1. 神代綺凛  Mac OS X 10.15.7(Mac OS X 10.15.7) / Google Chrome 91.0.4472.77(Google Chrome 91.0.4472.77)
      @Admin 暂不支持
  18. AkiPolaris  Windows 10 x64 Edition(Windows 10 x64 Edition) / Firefox 88.0(Firefox 88.0)
    换了台电脑登录上了,但是加-f下载和加-U检漏的时候都有概率会出这种错误:
    下载完一个画师的作品,去下载(或者只是检测?)另一个画师的作品的时候可能会出错(当时分心干别的事情去了,遇到报错直接up enter继续了ORZ,下次一定加--debug)

    Collecting illusts of 1/15 uid 11151341 Sagiri
      [0]   1/2      pid 76579696   カフェと待ち合わせ
      [1]   2/2      pid 82126309   お好きな席にどうぞ!
    
    Collecting illusts of 2/15 uid 1160327 奈川トモ
    Error: EPERM: operation not permitted, lstat 'C:\Users\Polaris\AppData\Roaming\pxder\tmp\(76579696)カフェと待ち合わせ.jpg'
        at Object.lstatSync (node:fs:1505:3)
        at Object.lstatSync (C:\Users\Polaris\AppData\Roaming\npm\node_modules\pxder\node_modules\graceful-fs\polyfills.js:312:16)
        at rimrafSync (C:\Users\Polaris\AppData\Roaming\npm\node_modules\pxder\node_modules\fs-extra\lib\remove\rimraf.js:228:18)
        at C:\Users\Polaris\AppData\Roaming\npm\node_modules\pxder\node_modules\fs-extra\lib\remove\rimraf.js:279:39
        at Array.forEach (<anonymous>)
        at rmkidsSync (C:\Users\Polaris\AppData\Roaming\npm\node_modules\pxder\node_modules\fs-extra\lib\remove\rimraf.js:279:26)
        at rmdirSync (C:\Users\Polaris\AppData\Roaming\npm\node_modules\pxder\node_modules\fs-extra\lib\remove\rimraf.js:269:7)
        at fixWinEPERMSync (C:\Users\Polaris\AppData\Roaming\npm\node_modules\pxder\node_modules\fs-extra\lib\remove\rimraf.js:161:5)
        at Object.rimrafSync [as removeSync] (C:\Users\Polaris\AppData\Roaming\npm\node_modules\pxder\node_modules\fs-extra\lib\remove\rimraf.js:251:26)
        at downloadIllusts (C:\Users\Polaris\AppData\Roaming\npm\node_modules\pxder\src\downloader.js:158:35)
    ERROR {
        "message": "EPERM: operation not permitted, lstat 'C:\\Users\\Polaris\\AppData\\Roaming\\pxder\\tmp\\(76579696)カフ ェと待ち合わせ.jpg'",
        "errno": -4048,
        "syscall": "lstat",
        "code": "EPERM",
        "path": "C:\\Users\\Polaris\\AppData\\Roaming\\pxder\\tmp\\(76579696)カフェと待ち合わせ.jpg"
    }
    1. 神代綺凛  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 90.0.4430.85(Google Chrome 90.0.4430.85)
      @AkiPolaris 猜测是杀毒软件之类的实时检测占用了文件,尝试把 C:\Users\Polaris\AppData\Roaming\pxder\ 加到白名单里
  19. AkiPolaris  Windows 10 x64 Edition(Windows 10 x64 Edition) / Firefox 88.0(Firefox 88.0)
    “oauth.secure.pixiv.net 未发送任何数据。” --chromium edge
    白屏无任何可用返回 --firefox
    是我的问题吗QWQ

    另github的release里是不是写错版本号了,一下子从2.12.1跳到2.21.2

    1. 神代綺凜  Mac OS X 10.15.7(Mac OS X 10.15.7) / Google Chrome 89.0.4389.90(Google Chrome 89.0.4389.90)
      @AkiPolaris 你说的是登录吗,你要挂个代理

      确实写错版本号了,已经更正了

      1. AkiPolaris  Windows 10 x64 Edition(Windows 10 x64 Edition) / Firefox 88.0(Firefox 88.0)
        @神代綺凜 代理挂上了(还换了几个),从通过pxder打开的网页输入密码后,网页端也能正常登录。我这的firefox在点击登录,经过一次app-api.pixiv.net请求后,一直在等待oauth.secure.pixiv.net。(同时也没能在开发者工具中查看到pixiv://开头的请求
        1. 神代綺凜  Mac OS X 10.15.7(Mac OS X 10.15.7) / Google Chrome 89.0.4389.90(Google Chrome 89.0.4389.90)
          @AkiPolaris oauth.secure.pixiv.net 请求卡住,除了网络和代理原因之外我也想不到别的了……或者是不是有 DNS 污染问题
  20. JIN  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 86.0.4240.198(Google Chrome 86.0.4240.198)
    有什么代码是可以跳过抓取动图的吗
    1. 神代綺凜  Mac OS X 10.15.7(Mac OS X 10.15.7) / Google Chrome 89.0.4389.82(Google Chrome 89.0.4389.82)
      @JIN -M 参数,你在 -h 里能看到说明
      1. JIN  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 86.0.4240.198(Google Chrome 86.0.4240.198)
        @神代綺凜 懂了,3Q