pixivfe/README.md

79 lines
2.8 KiB
Markdown
Raw Normal View History

2023-05-13 03:48:35 +00:00
# PixivFE
A privacy-respecting alternative front-end for Pixiv that doesn't suck
2023-06-01 13:05:02 +00:00
<p>
<a href="https://codeberg.org/vnpower/pixivfe">
<img alt="Get it on Codeberg" src="https://get-it-on.codeberg.org/get-it-on-blue-on-white.png" height="60">
</a>
2023-06-01 13:05:02 +00:00
</p>
2023-05-13 03:48:35 +00:00
2023-08-21 14:34:45 +00:00
Questions? Feedbacks? You can [PM me](https://matrix.to/#/@vnpower:exozy.me) on
Matrix!
You can keep track of this project's development
[here](https://codeberg.org/VnPower/pixivfe/projects/3481).
2023-08-15 13:29:51 +00:00
2023-06-05 13:33:14 +00:00
## Features
2023-05-13 03:48:35 +00:00
2023-06-05 13:33:14 +00:00
- Lightweight - both the interface and the code
- Privacy-first - the server will do the work for you
- No bloat - we only serve HTML and CSS
2023-06-05 13:33:14 +00:00
- Open source - you can trust me!
2023-06-08 11:54:17 +00:00
## Hosting
2023-05-13 12:25:12 +00:00
2023-08-21 14:34:45 +00:00
Check out [this page.](https://codeberg.org/VnPower/pixivfe/wiki/Hosting). We
currently have guides for Docker and Caddy.
2023-08-21 14:34:45 +00:00
Many thanks to [dragongoose](https://codeberg.org/dragongoose) for writing the
Docker guide!
2023-06-05 13:33:14 +00:00
2023-06-04 15:03:03 +00:00
## Instances
2023-08-21 14:34:45 +00:00
| Name | Cloudflare? | URL |
| ------------------ | ----------- | ------------------------------- |
| exozyme (Official) | No | https://pixivfe.exozy.me |
| dragongoose | No | https://pixivfe.dragongoose.us |
2023-07-15 02:38:17 +00:00
| WhateverItWorks | Yes | https://art.whateveritworks.org |
2023-06-08 11:54:17 +00:00
Hosted one yourself? Create a pull request to add it here!
2023-06-04 15:03:03 +00:00
2023-05-13 03:48:35 +00:00
## License
2023-06-05 13:33:14 +00:00
[AGPL3](https://www.gnu.org/licenses/agpl-3.0.txt)
2023-07-25 03:57:56 +00:00
## Note
2023-08-21 14:34:45 +00:00
Features like following an user, bookmarking and/or liking an artwork won't be
added anytime soon.
2023-07-25 03:57:56 +00:00
API routes:
2023-08-21 14:34:45 +00:00
2023-07-25 03:57:56 +00:00
- Following an user: `https://www.pixiv.net/bookmark_add.php`
- Bookmarking an artwork: `https://www.pixiv.net/ajax/illusts/bookmarks/add`
2023-08-21 14:34:45 +00:00
This is because for these endpoints to work, we must pass in a header called
`x-csrf-token`. The token was stored directly inside any Pixiv's pages (ex:
https://www.pixiv.net) in a variable called `pixiv.context.token`. We could
easily get this token using `curl`:
2023-07-25 03:57:56 +00:00
![curl https://www.pixiv.net --silent | grep pixiv.context.token](https://files.catbox.moe/pbjqtu.png)
2023-08-21 14:34:45 +00:00
The problem is, we cannot use this token, because when we were using `curl` to
fetch the page, we weren't authenticated. Each user has their own token,
generated every time they logout (i think). If we try to authenticate with
`PHPSESSID`, Cloudflare will stop us and we get a challenge page.
2023-07-25 03:57:56 +00:00
![Challenge page](https://files.catbox.moe/c1e0kp.png)
2023-08-21 14:34:45 +00:00
Unless we find out a way to fetch a `x-csrf-token` that works, these features
will probably never be added.
2023-07-25 03:57:56 +00:00
2023-08-21 14:34:45 +00:00
If you found out a way to fetch it, please tell me. You can test the token using
this command:
2023-07-25 03:57:56 +00:00
`curl -H "x-csrf-token: your_csrf_token" -X POST -d "mode=add&type=user&user_id=36055573&tag=&restrict=0&format=json" "https://www.pixiv.net/bookmark_add.php" --cookie "PHPSESSID=your_token" -A "Mozilla/5.0"`
It will return an empty JSON array if success, like this:
![Successfully followed](https://files.catbox.moe/oiwx4u.png)