Giter Club home page Giter Club logo

pximg-proxy's Introduction

pximg-proxy

Requirement

Node >= 18 or Bun

In theory, the entry src/app.ts can be used to deploy to various serverless platforms but may need some changes. See Hono's document.

Environment variables

  • PORT Optional. Default is 8080.
  • PROTOCOL
    Optional. Specify the protocol of example URLs on index page. It may be useful when you are using a HTTPS CDN, for example https:.
  • HOST
    Optional. Specify the host of example URLs on index page. Can contain port number.
  • USER_AGENT
    Optional. User-Agent header for Pixiv request. If not provided, the default UA of fetch will be used. Normally, it's OK.
  • HIDE_INDEX
    Optional. If you don't want to show a usage help on index, set this to any non-null value.
  • PIXIV_WEB_COOKIE
    Pixiv website cookie, only the PHPSESSID is required. At least one of PIXIV_WEB_COOKIE and PIXIV_CLIENT_REFRESH_TOKEN need to be set.
  • PIXIV_CLIENT_REFRESH_TOKEN
    You can provide a Pixiv client refresh token to allow it to access the Pixiv client api. In this case, it is recommended to deploy the service in a stateful container. It is not recommended to deploy in serverless, otherwise it may affect your pixiv account.

Get Pixiv client refresh token

You can use any packet capturing tool to grab from the Pixiv mobile application, or log in using the script provided by this project.

Here is how to use the login script:

  1. Node.js is required. Clone this repository.
  2. Run npm i to install dependencies, then run npm run pixiv:login to start the login script.
  3. Open the login URL, but don't log in.
  4. Open browser developer tools F12, switch to the "Network" tab.
  5. Log in, and finally you will get a blank page.
  6. Find the request with the word "login" at the bottom of the network request list.
  7. Switch to the "Payload" tab on right panel, then copy the code.
  8. Paste back into the command line, press Enter.
  9. The refresh token should be printed.

pximg-proxy's People

Contributors

dependabot[bot] avatar tsuk1ko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pximg-proxy's Issues

Feature request

Can you add caching to your script? cause it'll greatly help reduce the amount of requests it makes to pixiv & bandwidth usage especially when you receive heavy traffic

Issue when artwork ID exceeds 100000000

The total number of artworks on pixiv has exceeded 100000000, and the number of digits for the artwork ID has also reached 9 digits. As a result, for example, when trying to get an image with a artwork ID of 100057684, the image with a artwork ID of 10005768 was referenced. I'm not sure if it's a cache affecting issue or a script issue.

通过 {pid}_{p} 爬取时只会获取 {pid}_p0

在正确部署的情况下,通过 {pid}_{p} 获取任意的多页作品时只会获取 {pid}_p0

而通过 {pid}/{p} 则正常,同时也确认了现版本的 i.loli.best 存在相同的问题

api.obfs.dev rate limit

I frequently get rate-limit errors with the api.obfs.dev API, is there a way to use the Pixiv Ajax API?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.