{"_id":"pixiv-token-getter","_rev":"10-b7a7ba8ec947a33ac7d4b76839832650","name":"pixiv-token-getter","dist-tags":{"latest":"2.6.1"},"versions":{"2.0.0":{"name":"pixiv-token-getter","version":"2.0.0","keywords":["pixiv","token","puppeteer","login","oauth","cli","authentication","api","sdk","pixiv-api"],"author":"","license":"MIT","_id":"pixiv-token-getter@2.0.0","maintainers":[{"name":"zoidberg-xgd","email":"tidered911@gmail.com"}],"homepage":"https://github.com/zoidberg-xgd/pixiv-token-getter#readme","bugs":{"url":"https://github.com/zoidberg-xgd/pixiv-token-getter/issues"},"bin":{"ptg":"cli.js","pixiv-token-getter":"cli.js"},"dist":{"shasum":"03938cf1ad79904fd6713a6ea014bdd7e22e889d","tarball":"https://registry.npmjs.org/pixiv-token-getter/-/pixiv-token-getter-2.0.0.tgz","fileCount":10,"integrity":"sha512-kKRlZcjvCIZWFZa3kU/Exk77dhnx4gF7Tqbt2NFci19RExlDBV7yw9dsaq+p5Wzx5Ng8YC6KEFuXzASkfA3cAA==","signatures":[{"sig":"MEUCIHqDxf3I19BoFowrFGOe9+HYctBhLMibkM521IGRQWQ/AiEA5ecfqeTXjU7+ccewgkGWRO/hX3wFciWZ5krYeDwWm3s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":44905},"main":"index.js","types":"index.d.ts","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js","require":"./index.js"},"./cli":"./cli.js","./lib":{"types":"./index.d.ts","require":"./lib/index.js"}},"gitHead":"9e4cc39a080a8d6ea981304ba71724ff63624c27","scripts":{"start":"node cli.js","example":"node examples/basic-usage.js","headless":"node cli.js --headless","interactive":"node cli.js --interactive"},"_npmUser":{"name":"zoidberg-xgd","email":"tidered911@gmail.com"},"repository":{"url":"git+https://github.com/zoidberg-xgd/pixiv-token-getter.git","type":"git"},"_npmVersion":"10.9.2","description":"A Node.js library and CLI tool to get Pixiv login tokens using Puppeteer. Easy to integrate into your projects.","directories":{},"_nodeVersion":"23.10.0","dependencies":{"axios":"^1.6.0","puppeteer":"^24.15.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/pixiv-token-getter_2.0.0_1762746712928_0.8665392253377762","host":"s3://npm-registry-packages-npm-production"}},"2.1.0":{"name":"pixiv-token-getter","version":"2.1.0","keywords":["pixiv","token","puppeteer","login","oauth","cli","authentication","api","sdk","pixiv-api"],"author":{"name":"redtidev1918"},"license":"MIT","_id":"pixiv-token-getter@2.1.0","maintainers":[{"name":"zoidberg-xgd","email":"tidered911@gmail.com"},{"name":"redtidev1918","email":"redtidev1918@gmail.com"}],"homepage":"https://github.com/redtidev1918/pixiv-token-getter#readme","bugs":{"url":"https://github.com/redtidev1918/pixiv-token-getter/issues"},"bin":{"ptg":"cli.js","pixiv-token-getter":"cli.js"},"dist":{"shasum":"d10cb0a15f3580de9299251523de39a0bc363462","tarball":"https://registry.npmjs.org/pixiv-token-getter/-/pixiv-token-getter-2.1.0.tgz","fileCount":10,"integrity":"sha512-WXp6uygsux7RB9v42chBfczVc1OOVDzqID6+j/gjhV/lqR7vxX+5ittm/jgV8OhPfsA8j2nknlAz0MgRN+aamA==","signatures":[{"sig":"MEUCIBRRtOkMXrx0xPm89qaHhfHzQR7dbFA7RZN9YWwHwFZ/AiEAmqFRCdLnMAXScR9wCxNZYsFhFw6dF0Vfe3PXRUG/EFM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/pixiv-token-getter@2.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":46723},"main":"index.js","types":"index.d.ts","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js","require":"./index.js"},"./cli":"./cli.js","./lib":{"types":"./index.d.ts","require":"./lib/index.js"}},"gitHead":"f8c120f3c6521e5cc1cdd19281caee94ea586d1e","scripts":{"start":"node cli.js","example":"node examples/basic-usage.js","headless":"node cli.js --headless","interactive":"node cli.js --interactive"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:90b51e47-8202-4157-ab63-15de53e94bf7"}},"repository":{"url":"git+https://github.com/redtidev1918/pixiv-token-getter.git","type":"git"},"_npmVersion":"12.0.2","description":"A Node.js library and CLI tool to get Pixiv login tokens using Puppeteer. Easy to integrate into your projects.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.2","dependencies":{"axios":"^1.6.0","puppeteer":"^24.15.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/pixiv-token-getter_2.1.0_1787842262296_0.9735508219046103","host":"s3://npm-registry-packages-npm-production"}},"2.2.0":{"name":"pixiv-token-getter","version":"2.2.0","keywords":["pixiv","token","puppeteer","login","oauth","cli","authentication","api","sdk","pixiv-api"],"author":{"name":"redtidev1918"},"license":"MIT","_id":"pixiv-token-getter@2.2.0","maintainers":[{"name":"zoidberg-xgd","email":"tidered911@gmail.com"},{"name":"redtidev1918","email":"redtidev1918@gmail.com"}],"homepage":"https://github.com/redtidev1918/pixiv-token-getter#readme","bugs":{"url":"https://github.com/redtidev1918/pixiv-token-getter/issues"},"bin":{"ptg":"cli.js","pixiv-token-getter":"cli.js"},"dist":{"shasum":"f23970737567239a27040fcc4390a0d8d0a61262","tarball":"https://registry.npmjs.org/pixiv-token-getter/-/pixiv-token-getter-2.2.0.tgz","fileCount":10,"integrity":"sha512-Z1A00zg2cweTJ8Z7ggd+OQoIm+nygjONZsVaKnNGpn82knB11ZUxjY3F4Fg/YHWpcuSFoKXYp7+wDLn+/alDXQ==","signatures":[{"sig":"MEUCIGybzlbz2uM07r51fBWe/YdYxgwJx0iIv2Qqn76ZA8shAiEA5iy2NbwyO+AHRELhM4lLjKnUoCSEKpbPSQnz1rpFoWM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/pixiv-token-getter@2.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":49562},"main":"index.js","types":"index.d.ts","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js","require":"./index.js"},"./cli":"./cli.js","./lib":{"types":"./index.d.ts","require":"./lib/index.js"}},"gitHead":"e8b72b9f4b83603d6b54d50f1ee6c83fa40c1ffe","scripts":{"start":"node cli.js","example":"node examples/basic-usage.js","headless":"node cli.js --headless","interactive":"node cli.js --interactive"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:90b51e47-8202-4157-ab63-15de53e94bf7"}},"repository":{"url":"git+https://github.com/redtidev1918/pixiv-token-getter.git","type":"git"},"_npmVersion":"12.0.2","description":"A Node.js library and CLI tool to get Pixiv login tokens using Puppeteer. Easy to integrate into your projects.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.2","dependencies":{"axios":"^1.6.0","puppeteer":"^24.15.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/pixiv-token-getter_2.2.0_1787843165098_0.7761497987104065","host":"s3://npm-registry-packages-npm-production"}},"2.2.1":{"name":"pixiv-token-getter","version":"2.2.1","keywords":["pixiv","token","puppeteer","login","oauth","cli","authentication","api","sdk","pixiv-api"],"author":{"name":"redtidev1918"},"license":"MIT","_id":"pixiv-token-getter@2.2.1","maintainers":[{"name":"zoidberg-xgd","email":"tidered911@gmail.com"},{"name":"redtidev1918","email":"redtidev1918@gmail.com"}],"homepage":"https://github.com/redtidev1918/pixiv-token-getter#readme","bugs":{"url":"https://github.com/redtidev1918/pixiv-token-getter/issues"},"bin":{"ptg":"cli.js","pixiv-token-getter":"cli.js"},"dist":{"shasum":"e290978cf58b2a254acd142b2fccd23b56b12c94","tarball":"https://registry.npmjs.org/pixiv-token-getter/-/pixiv-token-getter-2.2.1.tgz","fileCount":10,"integrity":"sha512-YfCYGUEqoWWQJA2LdtYtcaK3bhTvSEEtvDE66bTakpnIGaNN+81SWLGcWgJ58YLQ7WmdfXM8NDbRAjwPSu1Tbw==","signatures":[{"sig":"MEUCIQCygrIOTQTolCWer5/G1a+bx/ehEB5AKf7Lrqk4ooyuVQIgHqM7stZLEM70BYSAkgo5l0k5Dme0TnZXoI8sLea6Sok=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/pixiv-token-getter@2.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":49807},"main":"index.js","types":"index.d.ts","engines":{"node":">=22.12.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js","require":"./index.js"},"./cli":"./cli.js","./lib":{"types":"./index.d.ts","require":"./lib/index.js"}},"gitHead":"fc1b1d99f0be0b963b35c133bdaa6ecd3d19f95e","scripts":{"start":"node cli.js","example":"node examples/basic-usage.js","headless":"node cli.js --headless","interactive":"node cli.js --interactive"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:90b51e47-8202-4157-ab63-15de53e94bf7"}},"repository":{"url":"git+https://github.com/redtidev1918/pixiv-token-getter.git","type":"git"},"_npmVersion":"12.0.2","description":"Get Pixiv API access & refresh tokens from Node.js - library and CLI (ptg) with PKCE OAuth login (interactive or headless). TypeScript types included.","directories":{},"sideEffects":false,"_nodeVersion":"24.19.0","dependencies":{"axios":"^1.6.0","puppeteer":"^25.9.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/pixiv-token-getter_2.2.1_1788253372547_0.5510465740813899","host":"s3://npm-registry-packages-npm-production"}},"2.3.0":{"name":"pixiv-token-getter","version":"2.3.0","keywords":["pixiv","token","puppeteer","login","oauth","cli","authentication","api","sdk","pixiv-api"],"author":{"name":"redtidev1918"},"license":"MIT","_id":"pixiv-token-getter@2.3.0","maintainers":[{"name":"zoidberg-xgd","email":"tidered911@gmail.com"},{"name":"redtidev1918","email":"redtidev1918@gmail.com"}],"homepage":"https://github.com/redtidev1918/pixiv-token-getter#readme","bugs":{"url":"https://github.com/redtidev1918/pixiv-token-getter/issues"},"bin":{"ptg":"cli.js","pixiv-token-getter":"cli.js"},"dist":{"shasum":"043909d1c5ea82252c61f06d0729febb6b46675d","tarball":"https://registry.npmjs.org/pixiv-token-getter/-/pixiv-token-getter-2.3.0.tgz","fileCount":10,"integrity":"sha512-w+/iuq8zJILib8an4m7yQvKQflOcCaGZo6S/W+g6no3GOLffOiB+3UO/v8gExAFfRCSyh6IKe/bVlCLcv6/bnA==","signatures":[{"sig":"MEUCIFzgwH08H+PdWALiDNsBO8Kr7oN113qSbvv1IKazB10RAiEAxVy3brmNicvO0GsEfLmprBWAlovl8DOk9y5I4XkNHSo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQDS62BK+SVNkU0MkUtz2/V8jo+YkZmPqeP27jwwmLSi7wIgIX8narMPUUoabkBz0bFuzTog3IgdI7veamhztgmAqyk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/pixiv-token-getter@2.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":53709},"main":"index.js","types":"index.d.ts","engines":{"node":">=22.12.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js","require":"./index.js"},"./cli":"./cli.js","./lib":{"types":"./index.d.ts","require":"./lib/index.js"}},"gitHead":"06f30db7a41fe8f24319d7b6d5d87c7753e29310","scripts":{"start":"node cli.js","example":"node examples/basic-usage.js","headless":"node cli.js --headless","interactive":"node cli.js --interactive"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:90b51e47-8202-4157-ab63-15de53e94bf7"}},"repository":{"url":"git+https://github.com/redtidev1918/pixiv-token-getter.git","type":"git"},"_npmVersion":"12.0.2","description":"Get Pixiv API access & refresh tokens from Node.js - library and CLI (ptg) with PKCE OAuth login (interactive or headless). TypeScript types included.","directories":{},"sideEffects":false,"_nodeVersion":"24.20.0","dependencies":{"axios":"^1.6.0","puppeteer":"^25.9.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/pixiv-token-getter_2.3.0_1788682730198_0.11542766204780697","host":"s3://npm-registry-packages-npm-production"}},"2.4.0":{"name":"pixiv-token-getter","version":"2.4.0","keywords":["pixiv","token","credential-manager","refresh-token","puppeteer","login","oauth","pkce","cli","authentication","api","sdk","pixiv-api","gppt"],"author":{"name":"redtidev1918"},"license":"MIT","_id":"pixiv-token-getter@2.4.0","maintainers":[{"name":"zoidberg-xgd","email":"tidered911@gmail.com"},{"name":"redtidev1918","email":"redtidev1918@gmail.com"}],"homepage":"https://redtidev1918.github.io/pixiv-token-getter/","bugs":{"url":"https://github.com/redtidev1918/pixiv-token-getter/issues"},"bin":{"ptg":"cli.js","pixiv-token-getter":"cli.js"},"dist":{"shasum":"71bdc9de20e35006d2d23de7ab7920781b6f708c","tarball":"https://registry.npmjs.org/pixiv-token-getter/-/pixiv-token-getter-2.4.0.tgz","fileCount":38,"integrity":"sha512-OST3qIZ37dKuidcSJMte2D8SDW7IGUkXk32sQWGY4Swry2t9kqJyHinJQ+YQtIAuRj0eFwCF8W6V5C8OXSyArw==","signatures":[{"sig":"MEUCIGs8P4ZEUiBrvlkKCrZ1tVNWP+kZ9x0PMp00MfhWGcxOAiEAx3zy6n/haXAzDEHjoZsAKy0+ADb25tLfwB1Pqd7CjWY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIH2nWqU+MNRR3lpQnvmvvEKVEu2nkFvLosyeqTSNMuXgAiEAl8uOhSpx259H6HFS7E6Ucj7SnwY2f7V66sSmwnFNYjk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/pixiv-token-getter@2.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":213397},"main":"index.js","types":"index.d.ts","engines":{"node":">=22.12.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js","require":"./index.js"},"./cli":"./cli.js","./lib":{"types":"./index.d.ts","require":"./lib/index.js"}},"gitHead":"0b6f8cba8f3fab154946edbc7f094abc02d35229","scripts":{"test":"node --test","start":"node cli.js","example":"node examples/basic-usage.js","headless":"node cli.js --headless","interactive":"node cli.js --interactive","example:lifecycle":"node examples/credential-lifecycle.js"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:90b51e47-8202-4157-ab63-15de53e94bf7"}},"repository":{"url":"git+https://github.com/redtidev1918/pixiv-token-getter.git","type":"git"},"_npmVersion":"11.19.0","description":"Node.js Pixiv credential manager and authentication facade - token cache, refresh-token lifecycle, profiles, PKCE OAuth + Puppeteer login, optional gppt interoperability. Library and CLI (ptg). TypeScript types included.","directories":{},"sideEffects":false,"_nodeVersion":"24.20.0","dependencies":{"axios":"^1.6.0","puppeteer":"^25.9.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/pixiv-token-getter_2.4.0_1789108853857_0.9477186280046601","host":"s3://npm-registry-packages-npm-production"}},"2.5.0":{"name":"pixiv-token-getter","version":"2.5.0","keywords":["pixiv","token","credential-manager","refresh-token","puppeteer","login","oauth","pkce","cli","authentication","api","sdk","pixiv-api","gppt"],"author":{"name":"redtidev1918"},"license":"MIT","_id":"pixiv-token-getter@2.5.0","maintainers":[{"name":"zoidberg-xgd","email":"tidered911@gmail.com"},{"name":"redtidev1918","email":"redtidev1918@gmail.com"}],"homepage":"https://redtidev1918.github.io/pixiv-token-getter/","bugs":{"url":"https://github.com/redtidev1918/pixiv-token-getter/issues"},"bin":{"ptg":"cli.js","pixiv-token-getter":"cli.js"},"dist":{"shasum":"c3e9f3f5319ef41c3f5f4d07cd4efa58c4ffaf78","tarball":"https://registry.npmjs.org/pixiv-token-getter/-/pixiv-token-getter-2.5.0.tgz","fileCount":41,"integrity":"sha512-FF/cSkNOWPrssDolvTFIp30laQ9b0STegz9fHE09kSTUUym74sl66XL+AhHozGDkj49CPNAj/vfQCI54ECrM6Q==","signatures":[{"sig":"MEUCIF+oq7xZPrq7sb8l9EMKhfOa+yxe0EoOcfnAHtIiGsQYAiEA8xCZinPhQufoDwmjsAtZLKg6KPieZ1kX63LRgE+XxgI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQDmvPp5D55ZcEd3Z3p0YGcQcjSlKarJNmKD4UBv4tLDgwIhAMMX2mgYtADUFoU79mHNJV0fggOFuyKt50PS3VLGNHtz","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/pixiv-token-getter@2.5.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":230365},"main":"index.js","types":"index.d.ts","engines":{"node":">=22.12.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js","require":"./index.js"},"./cli":"./cli.js","./lib":{"types":"./index.d.ts","require":"./lib/index.js"}},"gitHead":"b7ab4c3e8574a494973c1e2525791ad05dc6c32a","scripts":{"test":"node --test","start":"node cli.js","example":"node examples/basic-usage.js","headless":"node cli.js --headless","interactive":"node cli.js --interactive","example:lifecycle":"node examples/credential-lifecycle.js"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:90b51e47-8202-4157-ab63-15de53e94bf7"}},"repository":{"url":"git+https://github.com/redtidev1918/pixiv-token-getter.git","type":"git"},"_npmVersion":"11.19.0","description":"Node.js Pixiv credential manager and authentication facade - token cache, refresh-token lifecycle, profiles, PKCE OAuth + Puppeteer login, optional gppt interoperability. Library and CLI (ptg). TypeScript types included.","directories":{},"sideEffects":false,"_nodeVersion":"24.20.0","dependencies":{"axios":"^1.6.0","puppeteer-core":"^25.9.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/pixiv-token-getter_2.5.0_1789143393668_0.6854336164539891","host":"s3://npm-registry-packages-npm-production"}},"2.6.0":{"name":"pixiv-token-getter","version":"2.6.0","keywords":["pixiv","token","credential-manager","refresh-token","puppeteer","login","oauth","pkce","cli","authentication","api","sdk","pixiv-api","gppt"],"author":{"name":"redtidev1918"},"license":"MIT","_id":"pixiv-token-getter@2.6.0","maintainers":[{"name":"zoidberg-xgd","email":"tidered911@gmail.com"},{"name":"redtidev1918","email":"redtidev1918@gmail.com"}],"homepage":"https://redtidev1918.github.io/pixiv-token-getter/","bugs":{"url":"https://github.com/redtidev1918/pixiv-token-getter/issues"},"bin":{"ptg":"cli.js","pixiv-token-getter":"cli.js"},"dist":{"shasum":"af234badd4e6cccc0aeed50d85f350af486ee605","tarball":"https://registry.npmjs.org/pixiv-token-getter/-/pixiv-token-getter-2.6.0.tgz","fileCount":41,"integrity":"sha512-mDjZgc0AYNOq1fVVzk4GjhHMsMI3UGiZgQ18Pt/rJvnFkJjoIZ41WGHK8f5nD2FpIG6/XuSijnlVBr2+iUCZxw==","signatures":[{"sig":"MEQCIBr/PENd0rha9JJs+Lvr5TjCF7oiNqbcE9U5f0AgQ+y5AiBoSBsXvblsKVuVgs547RN+QAU6ehPE2jD3pQrTVLPbkw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIAKCasSBp+HYn2XvBF5SJ1EMrOpZzNV2f3MIw/jQWgU1AiEAjURLrL5pP5e7TTQJv5wbXkcbaZXbYzZ4ZQ+HnSYfpDw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/pixiv-token-getter@2.6.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":230636},"main":"index.js","types":"index.d.ts","engines":{"node":">=22.12.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js","require":"./index.js"},"./cli":"./cli.js","./lib":{"types":"./index.d.ts","require":"./lib/index.js"}},"gitHead":"bc132fd3414adbf8cc9be9c8197fba2bdf5b71f0","scripts":{"test":"node --test","start":"node cli.js","example":"node examples/basic-usage.js","headless":"node cli.js --headless","interactive":"node cli.js --interactive","example:lifecycle":"node examples/credential-lifecycle.js"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:90b51e47-8202-4157-ab63-15de53e94bf7"}},"repository":{"url":"git+https://github.com/redtidev1918/pixiv-token-getter.git","type":"git"},"_npmVersion":"11.19.0","description":"Node.js Pixiv credential manager and authentication facade - token cache, refresh-token lifecycle, profiles, PKCE OAuth + Puppeteer login, optional gppt interoperability. Library and CLI (ptg). TypeScript types included.","directories":{},"sideEffects":false,"_nodeVersion":"24.20.0","dependencies":{"axios":"^1.6.0","puppeteer-core":"^25.9.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/pixiv-token-getter_2.6.0_1789144019755_0.3540104539172144","host":"s3://npm-registry-packages-npm-production"}},"2.6.1":{"_id":"pixiv-token-getter@2.6.1","bin":{"ptg":"cli.js","pixiv-token-getter":"cli.js"},"bugs":{"url":"https://github.com/redtidev1918/pixiv-token-getter/issues"},"dist":{"shasum":"943791c9df89ff8d3e8468f504d9a767a6a13166","tarball":"https://registry.npmjs.org/pixiv-token-getter/-/pixiv-token-getter-2.6.1.tgz","fileCount":41,"integrity":"sha512-hicfmIOXzrlQ/mBIb3M/t7DirTPbI/jf0F2Ih+PaMayHmgAy+il53Y2fy8Smlkvpapv9mUc8fO3h0iIWVlgfuw==","signatures":[{"sig":"MEQCIGWR+NWFZQDB4O0n9U4jMlInXzwa19Eq3PcQSfHlMTMbAiAXpp3Y7jD868uLrYES0SRF9+oD78bgGJR3/Gu6XHD0hw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEKiQ9SO5uFZKn7GGHJ/EsFaxkLP8pobca3a4SUNQrL0AiBbi0MWBem08QajzInfYGeZ7YHtaBFHUC+fMZgQIx7TKA=="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/pixiv-token-getter@2.6.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":231058},"main":"index.js","name":"pixiv-token-getter","types":"index.d.ts","author":{"name":"redtidev1918"},"engines":{"node":">=22.12.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js","require":"./index.js"},"./cli":"./cli.js","./lib":{"types":"./index.d.ts","require":"./lib/index.js"}},"gitHead":"c2d92b138c18b034e183e9038e6db643e5155032","license":"MIT","scripts":{"test":"node --test","start":"node cli.js","example":"node examples/basic-usage.js","headless":"node cli.js --headless","interactive":"node cli.js --interactive","example:lifecycle":"node examples/credential-lifecycle.js"},"version":"2.6.1","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:90b51e47-8202-4157-ab63-15de53e94bf7"}},"homepage":"https://redtidev1918.github.io/pixiv-token-getter/","keywords":["pixiv","token","credential-manager","refresh-token","puppeteer","login","oauth","pkce","cli","authentication","api","sdk","pixiv-api","gppt"],"repository":{"url":"git+https://github.com/redtidev1918/pixiv-token-getter.git","type":"git"},"_npmVersion":"11.19.0","description":"Node.js Pixiv credential manager and authentication facade - token cache, refresh-token lifecycle, profiles, PKCE OAuth + Puppeteer login, optional gppt interoperability. Library and CLI (ptg). TypeScript types included.","directories":{},"maintainers":[{"name":"zoidberg-xgd","email":"tidered911@gmail.com"},{"name":"redtidev1918","email":"redtidev1918@gmail.com"}],"sideEffects":false,"_nodeVersion":"24.20.0","dependencies":{"axios":"^1.6.0","puppeteer-core":"^25.9.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pixiv-token-getter_2.6.1_1789144797489_0.711330361082585"}}},"time":{"created":"2025-11-10T03:51:52.927Z","modified":"2026-09-11T16:39:57.869Z","2.0.0":"2025-11-10T03:51:53.139Z","2.1.0":"2026-08-27T14:51:02.434Z","2.2.0":"2026-08-27T15:06:05.246Z","2.2.1":"2026-09-01T09:02:52.690Z","2.3.0":"2026-09-06T08:18:50.287Z","2.4.0":"2026-09-11T06:40:53.935Z","2.5.0":"2026-09-11T16:16:33.765Z","2.6.0":"2026-09-11T16:26:59.855Z","2.6.1":"2026-09-11T16:39:57.571Z"},"bugs":{"url":"https://github.com/redtidev1918/pixiv-token-getter/issues"},"author":{"name":"redtidev1918"},"license":"MIT","homepage":"https://redtidev1918.github.io/pixiv-token-getter/","keywords":["pixiv","token","credential-manager","refresh-token","puppeteer","login","oauth","pkce","cli","authentication","api","sdk","pixiv-api","gppt"],"repository":{"url":"git+https://github.com/redtidev1918/pixiv-token-getter.git","type":"git"},"description":"Node.js Pixiv credential manager and authentication facade - token cache, refresh-token lifecycle, profiles, PKCE OAuth + Puppeteer login, optional gppt interoperability. Library and CLI (ptg). TypeScript types included.","maintainers":[{"name":"zoidberg-xgd","email":"tidered911@gmail.com"},{"name":"redtidev1918","email":"redtidev1918@gmail.com"}],"readme":"# Pixiv Token Getter\n\n> **Node.js 的 Pixiv 凭据管理器与认证门面** —— 令牌缓存、refresh token 生命周期、多 profile，以及浏览器 / 原生登录，并可选支持 [gppt](https://github.com/eggplants/get-pixivpy-token) 互操作。\n\n**简称：** `ptg`（CLI 命令别名）\n\n[![Node.js](https://img.shields.io/badge/Node.js-%3E%3D22.12.0-brightgreen)](https://nodejs.org/)\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\n**语言 / Language:** 中文 · [English](README.en.md)\n\n---\n\n## 这是什么（以及变化了什么）\n\n这个包以前是\"一次性获取 token\"的工具，现在是一个**凭据生命周期管理器**：\n\n```\n缓存令牌 ──有效──▶ 直接复用\n      │\n      ├── 存在 refresh_token ──▶ 刷新 ──▶ 原子写入 ──▶ 使用\n      │\n      └── 否则 ──▶ 登录（原生浏览器 / 原生 PKCE / gppt）──▶ 原子写入 ──▶ 使用\n```\n\n你不再需要每次都重新登录。**在本地登录一次**，生产 / CI 运行时只需要刷新即可。\n\n```js\nconst { getToken } = require('pixiv-token-getter');\n\n// 缓存 → 刷新 → 登录，然后持久化。推荐的入口。\nconst token = await getToken({ profile: 'default' });\n```\n\n## 特性\n\n- ✅ **凭据生命周期** —— `getToken()` 缓存 → 刷新 → 登录，并持久化绝对过期时间\n- ✅ **Refresh token 支持** —— `refreshToken()`、`refreshStoredToken()`，且**轮换安全**\n- ✅ **多 profile** —— `--profile main`、`--profile alt`；令牌、偏好与浏览器数据相互隔离\n- ✅ **原生 PKCE OAuth** —— 原有的第一方实现（保留并重构，而非替换）\n- ✅ **Puppeteer 浏览器登录** —— 支持交互式 *与* 自动化（`e2e`），可选 TOTP 二次验证\n- ✅ **持久化浏览器 profile** —— 通常多次运行之间保持已登录状态\n- ✅ **网页会话 Cookie** —— 为 Pixiv **网页**抓取捕获 `PHPSESSID`（仅原生 provider）\n- ✅ **gppt 互操作（可选）** —— 导入 gppt 凭据，**无需任何 Python 依赖**\n- ✅ **原子化、0600 权限的凭据存储** —— 写入失败绝不会截断一个可用的令牌\n- ✅ **稳定错误模型** —— 通过 `error.code` 分支处理，而非解析错误文案\n- ✅ **TypeScript 类型** —— 新 API 与旧 API 均有完整 `.d.ts`\n\n## 安装\n\n```bash\nnpm install pixiv-token-getter\n```\n\n> **不需要 Python。** `gppt` 只是*可选的*适配器，原生 provider 可独立工作。\n\n## 快速开始\n\n### CLI\n\n```bash\nnpm install -g pixiv-token-getter\n\nptg login        # 首次：打开 Pixiv 登录页，保存 refresh token\nptg status       # 之后：查看状态（绝不会打印密钥）\n```\n\n首次登录成功：\n\n```\n[+] Logged in as your_name (ID: 123456)\n    Profile:        default\n    Provider:       native (oauth)\n    Access token:   ********cd12\n    Refresh token:  ********ab34\n    Expires at:     2026-09-11T12:34:56.000Z (in 59m)\n    Web session:    PHPSESSID available\n[+] Refresh token saved securely.\n```\n\n```\n$ ptg status\nProfile:        default\nProvider:       native (oauth)\nUser:           your_name (ID: 123456)\nAccess token:   valid (expires 2026-09-11T12:34:56.000Z)\nExpires in:     58m\nRefresh token:  present\nWeb session:    PHPSESSID available\nToken file:     ~/.config/pixiv-token-getter/tokens/default.token.json\n```\n\n### 作为库使用\n\n```js\nconst { getToken } = require('pixiv-token-getter');\n\nconst token = await getToken({\n  profile: 'default',\n  provider: 'native',   // native | gppt | auto   （默认：native）\n  method: 'oauth',      // oauth | browser | e2e | import\n  force: false,         // true → 跳过缓存与刷新，重新登录\n});\n```\n\n这就是全部集成。`PixivFlow`（以及任何其它 Node 使用方）只需要这一个调用。\n\n## 使用指南\n\n### 原生登录\n\n同一 provider 提供两种机制：\n\n| `method` | 作用 | 适用场景 |\n| --- | --- | --- |\n| `oauth` / `browser` | 打开 Pixiv 登录页，**由你**登录。二者互为别名。 | 常规、最可靠（**推荐**） |\n| `e2e` | 自动填写用户名 / 密码表单（默认无头） | 无人值守初始化；可能被判定为自动化 |\n\n```bash\nptg login                          # 等价于 --method oauth\nptg login --method browser\nPIXIV_USERNAME=user PIXIV_PASSWORD=pass ptg login --method e2e\n```\n\n旧参数继续可用，并映射到上述命令：\n\n```bash\nptg --interactive              # → ptg login --method browser   （已弃用）\nptg --headless user pass       # → ptg login --method e2e       （已弃用）\nptg --interactive --output=f.json\n```\n\n### 刷新\n\n```bash\nptg refresh                 # 刷新默认 profile 已存储的令牌\nptg refresh --profile main\n```\n\n```js\nconst { refreshToken, refreshStoredToken } = require('pixiv-token-getter');\n\n// 刷新任意一个 refresh token（不涉及存储）：\nconst renewed = await refreshToken('the-refresh-token');\n\n// 刷新某个 profile 已存储的令牌（显式刷新，即使仍然有效）：\nconst stored = await refreshStoredToken({ profile: 'main' });\n```\n\n**轮换已被正确处理。** Pixiv 可能返回一个*新的* refresh token；新值总会被持久化，空值绝不会覆盖一个有效值。\n\n### 多 Profile\n\n```bash\nptg configure --profile main --provider native --method oauth\nptg login     --profile main\nptg status    --profile main\n\nptg configure --list\n```\n\n```js\nconst token = await getToken({ profile: 'main' });\n```\n\n状态目录布局（XDG）：\n\n```\n$XDG_CONFIG_HOME/pixiv-token-getter/     （回退：~/.config/pixiv-token-getter/）\n├── profiles/<name>.json          非敏感偏好（绝不保存密码）\n├── tokens/<name>.token.json      密钥，0600，原子写入\n└── browser/<name>/               持久化 Chrome profile，0700\n```\n\n从 `2.3` 升级时，旧的 `profile/` 目录会自动迁移到 `browser/default/`，因此已有登录状态得以保留。\n\n### gppt 互操作（可选）\n\n[gppt](https://github.com/eggplants/get-pixivpy-token) 是一个**可选的互操作 provider**，而不是依赖项。\n\n```bash\npip install gppt\ngppt configure\ngppt login\n```\n\n之后可以在需要时导入其凭据（推荐）：\n\n```bash\nptg import gppt\nptg import gppt --profile main --source-profile default\n```\n\n或者显式委托其登录：\n\n```bash\nptg login --provider gppt\nptg login --provider gppt --method e2e    # 替你运行 `gppt login`\n```\n\n```js\nawait importGppt({ profile: 'main' });   // 读取 ~/.config/gppt/<profile>.token.json\n```\n\n我们**刻意不做**的事：\n\n- ❌ 解析 gppt stdout / 用正则抓取密钥\n- ❌ 要求 Python 才能使用核心功能\n- ❌ 为 gppt 令牌伪造 `web_cookies`（见下文）\n\n凭据查找顺序：`$GPPT_CONFIG_DIR` → `$XDG_CONFIG_HOME/gppt` → `~/.config/gppt`；文件名 `<profile>.token.json`（默认 profile 也接受裸 `.token.json`）。会对 `~` 做展开（gppt 自身并不会）。\n\n### 网页 Cookie（`PHPSESSID`）\n\n两种凭据，两种用途 —— 不要混用：\n\n| 凭据 | 用途 | 来源 |\n| --- | --- | --- |\n| OAuth `access_token` | Pixiv **App API**（`app-api.pixiv.net`） | 任意 provider |\n| `web_cookies.PHPSESSID` | Pixiv **网站 / 网页会话** | 仅原生浏览器登录 |\n\n```js\nconst token = await getToken();\nconsole.log(token.web_cookies); // { PHPSESSID: '...' } —— 仅原生\n```\n\ngppt 导入的令牌**没有** `web_cookies`：该字段被直接省略，而非伪造。刷新会保留已有 cookie（刷新响应本身不携带 cookie）。\n\n### 代理\n\n单一解析器同时作用于 **OAuth / 令牌请求**与 Puppeteer，浏览器与令牌交换永远不会不一致：\n\n```bash\nexport HTTPS_PROXY=http://127.0.0.1:8080\nptg login\n```\n\n```js\nawait getToken({ proxy: 'http://user:pass@proxy:8080' });  // 显式指定\nawait getToken({ proxy: false });                          // 强制禁用代理\n```\n\n优先级：显式选项 → `ALL_PROXY` → `HTTPS_PROXY` → `HTTP_PROXY`。代理密码在所有日志与错误信息中都会被脱敏。\n\n### 服务器 / 无头运行时（CI、Docker、Fly、Actions）\n\n**不要**在服务器上执行登录。在本地登录一次，之后只刷新：\n\n```js\nconst token = await getToken({ profile: 'main', refreshOnly: true });\n```\n\n`refreshOnly: true` 绝不会启动浏览器：若 refresh token 缺失 / 过期，它会抛出 `RefreshError`，让任务**明显地失败**，而不是循环启动 Chromium。\n\n## API\n\n### 高层 API（推荐）\n\n| 函数 | 说明 |\n| --- | --- |\n| `getToken(options?)` | 缓存 → 刷新 → 登录，然后持久化 |\n| `resolveToken(options?)` | 同 `getToken`，额外返回 `source`（`cache` / `refresh` / `login`） |\n| `login(options?)` | 强制重新登录（`force: true`）并持久化 |\n| `refreshStoredToken(options?)` | 刷新某个 profile 已存储的令牌 |\n| `refreshToken(refreshToken, options?)` | 刷新任意 refresh token |\n| `status(options?)` | 查看状态 —— **绝不**包含密钥 |\n| `logout(options?)` | 删除凭据（`purge: true` 同时清除 profile 与浏览器数据） |\n| `importGppt(options?)` | 导入 gppt 凭据 |\n| `getProvider(id)` / `providerPlan(id)` | provider 选择（进阶） |\n\n```js\nconst {\n  getToken, login, refreshToken, refreshStoredToken,\n  status, logout, importGppt,\n  loadProfile, saveProfile, listProfiles,\n  FileTokenStore, MemoryTokenStore,\n} = require('pixiv-token-getter');\n```\n\n### Provider\n\n```ts\ninterface AuthProvider {\n  readonly id: string;\n  readonly methods: AuthMethod[];\n  login(options: LoginOptions): Promise<TokenInfo>;\n  refresh?(refreshToken: string, options?: RefreshOptions): Promise<TokenInfo>;\n  isAvailable?(): Promise<boolean>;\n}\n```\n\n- `native` —— Puppeteer + PKCE。方法：`oauth` / `browser` / `e2e`。唯一能捕获网页 cookie 的 provider。\n- `gppt` —— 可选。方法：`import`（读取令牌文件）/ `e2e`（运行 `gppt login`）。\n\n**回退策略：** `provider: 'native'` 或 `'gppt'` 只使用该 provider —— 没有隐式回退。只有 `provider: 'auto'` 才会依次尝试 `[native, gppt]`，每个**至多一次**，并在确定的认证失败时停止。不会出现登录风暴。\n\n### 令牌存储\n\n```ts\ninterface TokenStore {\n  load(profile: string): Promise<TokenInfo | null>;\n  save(profile: string, token: TokenInfo): Promise<void>;\n  remove(profile: string): Promise<void>;\n}\n```\n\n`FileTokenStore` 是默认实现。写入是原子的（`写临时文件 → fsync → rename → chmod 0600`），因此被中断的进程绝不会留下空或写了一半的令牌文件，保存失败也会保留原凭据。`MemoryTokenStore` 用于测试 / 临时场景。\n\n### `TokenInfo`\n\n```ts\ninterface TokenInfo {\n  access_token: string;\n  refresh_token: string;\n  expires_in: number;\n  expires_at?: string;   // 带时区的绝对 ISO-8601 —— 优先使用\n  obtained_at?: string;  // 带时区的绝对 ISO-8601\n  token_type?: string;\n  scope?: string;\n  user?: { id?: string; name?: string; account?: string };\n  web_cookies?: Record<string, string>;  // 仅原生浏览器登录\n  provider?: 'native' | 'gppt' | 'auto';\n  method?: 'oauth' | 'browser' | 'e2e' | 'import';\n  last_refreshed_at?: string;\n}\n```\n\n辅助函数：`isTokenExpired(token, skewMs?)`（默认安全余量 **5 分钟**）、`msUntilExpiry(token)`、`normalizeTokenInfo(raw)`。\n\n### 错误\n\n通过 `error.code` 分支处理 —— 不要解析文案：\n\n| 类 | `code` | 典型处理 |\n| --- | --- | --- |\n| `AuthError` | `AUTH_ERROR` | 基类 |\n| `LoginError` | `LOGIN_ERROR` | 提示用户重新登录 |\n| `TokenExchangeError` | `TOKEN_EXCHANGE_ERROR` | 退避重试 |\n| `RefreshError` | `REFRESH_ERROR` | 需要重新登录 |\n| `ProviderUnavailableError` | `PROVIDER_UNAVAILABLE` | 换 provider / 安装依赖 |\n| `ProfileError` | `PROFILE_ERROR` | 修正配置 |\n| `TokenStoreError` | `TOKEN_STORE_ERROR` | 磁盘 / 权限问题 |\n| `TwoFactorRequiredError` | `TWO_FACTOR_REQUIRED` | 提示输入 TOTP 验证码 |\n\n```js\nconst { RefreshError } = require('pixiv-token-getter');\n\ntry {\n  await getToken({ refreshOnly: true });\n} catch (error) {\n  if (error instanceof RefreshError) notifyUserToLogInAgain();\n  else throw error;\n}\n```\n\n### 旧 API（仍然支持）\n\n没有删除任何东西。以下函数保持原有签名：\n\n```js\nconst {\n  getTokenInteractive, getTokenHeadless,\n  loginInteractive, loginHeadless,\n  collectWebCookies, DEFAULT_USER_DATA_DIR,\n} = require('pixiv-token-getter');\n```\n\n与 `2.3` 有两处有意的差异：\n\n1. `DEFAULT_USER_DATA_DIR` 现在是 `.../browser/default`（自动迁移，无需操作）。\n2. CLI 在输出中**遮蔽**令牌，而非直接打印；如确实需要原始值，请使用 `ptg token --show-secret`。\n\n完整的分步指南见 [MIGRATION.md](./MIGRATION.md)。\n\n## CLI 参考\n\n```\nptg login     [--profile] [--provider] [--method] [--username] [--password]\n              [--totp-code] [--force] [--output=<file>] [--proxy] [--json] [--quiet]\nptg refresh   [--profile] [--json]\nptg status    [--profile] [--json]\nptg configure [--profile] [--provider] [--method] [--user-data-dir] [--proxy] [--list]\nptg logout    [--profile] [--purge]\nptg import gppt [--profile] [--source-profile] [--json]\nptg token     [--profile] [--json] [--show-secret]\nptg --help | --version\n```\n\n退出码：`0` 成功 · `1` 错误 · `2` 用法错误 · `3` provider 不可用 · `4` 无 / 无效凭据状态。\n\n**密钥输出策略。** `access_token`、`refresh_token` 与 `PHPSESSID` **默认被遮蔽**（`********abcd`）。`--json` 同样遮蔽；只有显式 `--show-secret` 才会打印原始值。默认情况下凭据绝不会写入终端回滚缓冲或 CI 日志。\n\n**环境变量**\n\n| 变量 | 用途 |\n| --- | --- |\n| `PIXIV_USERNAME` / `PIXIV_PASSWORD` | `--method e2e` 凭据（避免密码进入 shell 历史） |\n| `PIXIV_TOKEN_GETTER_CONFIG_DIR` | 覆盖整个状态目录 |\n| `PIXIV_TOKEN_GETTER_GPPT_BIN` | 自定义 gppt 可执行文件（例如 venv 包装脚本） |\n| `GPPT_CONFIG_DIR`、`XDG_CONFIG_HOME` | gppt 配置查找 |\n| `ALL_PROXY` / `HTTPS_PROXY` / `HTTP_PROXY` | 浏览器与令牌请求共用的代理 |\n\n## 安全\n\n- 密钥保存在 `tokens/<profile>.token.json`，权限为 **`0600`**；目录为 **`0700`**。\n- 写入是原子的；登录 / 刷新失败会**保留原有的令牌文件**。\n- 默认**绝不**持久化密码（`configure` 只保存非敏感偏好）。\n- TOTP 密钥为**可选**（`--totp-secret` / `totpSecret`），不会被自动保存。\n- 抛出的错误与日志输出中不包含令牌值；HTTP 错误响应体会被脱敏。\n- gppt stdout **绝不**被持久化或解析。\n- 代理凭据会被脱敏（`http://user:***@host`）。\n- Windows 上没有 POSIX `chmod`：文件继承用户私有目录的 ACL，因此我们将状态保存在 `%USERPROFILE%` 下。\n\n请将这些加入你的 `.gitignore`：`pixiv-token.json`、`*.token.json`、`.config/pixiv-token-getter/`。\n\n## 要求\n\n- **Node.js >= 22.12.0**（与 `package.json#engines` 一致）\n- Puppeteer（作为依赖安装；Chromium 会自动下载）\n- *可选：* Python + `gppt`，仅在需要 gppt 互操作 provider 时\n\n## 致谢\n\n凭据生命周期设计（profile → 缓存令牌 → 有效性 → 刷新 → 回退登录，以及 `expires_at` 处理、profile 概念与 OAuth/E2E 拆分）**受** [eggplants/get-pixivpy-token (gppt)](https://github.com/eggplants/get-pixivpy-token) **启发**，后者为 MIT 许可。未复制任何 gppt 源码；Node.js 实现为原创。详见 [ACKNOWLEDGMENTS.md](./ACKNOWLEDGMENTS.md)。\n\n## 常见问题\n\n**需要 Python 吗？** 不需要。仅当你明确想使用 gppt 互操作 provider（`ptg import gppt` / `--provider gppt`）时才需要。\n\n**令牌会过期吗？** 会。`access_token` 是短期的；`getToken()` 会用存储的 `refresh_token` 自动刷新。\n\n**为什么推荐 `getToken()` 而不是 `getTokenInteractive()`？** 旧辅助函数总是执行一次登录。`getToken()` 会优先复用缓存，其次刷新，最后才登录。\n\n**refresh token 会轮换吗？** 可能会。新的 refresh token 总会被持久化；空响应绝不会覆盖有效值。\n\n**可以在 CI 中使用吗？** 可以 —— 在本地保存凭据，然后使用 `getToken({ refreshOnly: true })`。切勿在 CI 中登录。\n\n**`PHPSESSID` 和 access token 是一回事吗？** 不是。access token 用于 App API；`PHPSESSID` 用于 Pixiv 网站会话。只有原生浏览器登录才能产生它。\n\n## 相关链接\n\n- [Pixiv API 文档](https://www.pixiv.net/help/article/3629)\n- [Puppeteer 文档](https://pptr.dev/)\n- [gppt（可选互操作）](https://github.com/eggplants/get-pixivpy-token)\n- [迁移指南](./MIGRATION.md)\n- [致谢](./ACKNOWLEDGMENTS.md)\n\n如有问题，请提交 [Issue](https://github.com/redtidev1918/pixiv-token-getter/issues)。\n","readmeFilename":"README.md"}