Crawl your personal favorite images, photo albums, comics from website.
- Not ready for production.
- Appropriately reduce the crawling speed in the future and provide options to set performance, but your account is still at risk of being disabled by the website.
- instagram.com
- pixiv.net (crawl your liked illust, must login), Thanks for project PixivPy.
- yande.re (crawl your voted posts, require your username)
- lmmpic.com (crawl your favorite albums, must login)
- nhentai.net (crawl your favorite comics, must login)
- twitter.com (crawl your liked posts, must login)
- Python3.7+
pip install -U favorites_crawler
# on Windows
set https_proxy=http://localhost:8080 # replace with your proxy server
# on Liunx/macOS
export https_proxy=http://localhost:8080
favors login [-h] {pixiv,yandere}
Thanks for @ZipFile Pixiv OAuth Flow
- run command
favors login pixiv
- input your user_id (Access your pixiv personal page, copy from address bar), after press Enter, Pixiv login page will open in browser.
- Open dev console (F12) and switch to network tab.
- Enable persistent logging ("Preserve log").
- Type into the filter field: callback?
- Proceed with Pixiv login.
- After logging in you should see a blank page and request that looks like this: https://app-api.pixiv.net/web/v1/users/auth/pixiv/callback?state=...&code=.... Copy value of the code param into the prompt and hit the Enter key.
- run command:
favors login yandere
- input your username and hit the Enter key.
- Open lmmpic on browser and login.
- Use "Get cookies.txt" extension download cookie file.
- Copy cookie file to {user_home}/.favorites_crawler.
- Open nhentai on browser and login.
- Use "Get cookies.txt" extension download cookie file.
- Copy cookie file to {user_home}/.favorites_crawler.
- run command
favors login twitter
- input your username, after press Enter, likes page will open in browser.
- Open dev console (F12) and switch to network tab.
- Enable persistent logging ("Preserve log").
- Type into the filter field: Likes?
- Refresh Page.
- Copy Authorization, X-Csrf-Token and RequestURL from request(Likes?variables...) input on terminal.
- Use "Get cookies.txt" extension download cookie file.
- Copy cookie file to {user_home}/.favorites_crawler.
favors crawl [-h] {lemon,nhentai,pixiv,yandere}
Before run this command, make sure you are already login.
favors crawl pixiv
Before run this command, make sure you are already login.
favors crawl yandere
Before run this command, make sure you are already login.
favors crawl lemon
Before run this command, make sure you are already login.
favors crawl nhantai
Before run this command, make sure you are already login.
favors crawl twitter
Config file locate on {your_home}/.favorites_crawler/config.yml
.
You can set any scrapy built-in settings in this file.
By default, file content likes this:
pixiv:
ACCESS_TOKEN: xxxxxxxxxxxxxxxxxxxxxxxxxxxx
REFRESH_TOKEN: xxxxxxxxxxxxxxxxxxxxxxxxxxxx
USER_ID: xxxx
yandere:
USERNAME: xxxx
By default, pictures will download to working directory.
If you want to change download location, you can add FILES_STORE option to config.
For example, if you want save pixiv files to pictures/a
, and want save yandere files to pictures/b
, you can modify config file like this:
pixiv:
ACCESS_TOKEN: xxxxxxxxxxxxxxxxxxxxxxxxxxxx
REFRESH_TOKEN: xxxxxxxxxxxxxxxxxxxxxxxxxxxx
USER_ID: xxxx
FILES_STORE: pictures/a
yandere:
USERNAME: xxxx
FILES_STORE: pictures/b
if you want to organize pixiv illust by user, add this line to your config:
pixiv:
# FAVORS_PIXIV_ENABLE_ORGANIZE_BY_USER: true # (Deprecation)
ENABLE_ORGANIZE_BY_ARTIST: true # add this line to your yandere config
if you want to organize yandere post by artist, add this line to your config:
yandere:
ENABLE_ORGANIZE_BY_ARTIST: true # add this line to your yandere config
only support pixiv and yandere.
yandere:
ENABLE_WRITE_IPTC_KEYWORDS: true # default: true
EXIF_TOOL_EXECUTABLE: '<Path to your exiftool executable>' # default None
pixiv:
ENABLE_WRITE_IPTC_KEYWORDS: true # default: true
EXIF_TOOL_EXECUTABLE: '<Path to your exiftool executable>' # default None
$ favors restore yandere -h
usage: favors restore yandere [-h] -s {0,1,2,3} -t CSRF_TOKEN -c COOKIE path
positional arguments:
path The location of the post to vote. (Sub-folders are ignored)
optional arguments:
-h, --help show this help message and exit
-s {0,1,2,3}, --score {0,1,2,3}
Set 1, 2 or 3 to vote, 0 to cancel vote.
-t CSRF_TOKEN, --csrf-token CSRF_TOKEN
CSRF token. To get it:
1. Open your browser DevTools.
2. Switch to network tab.
3. Vote any post on yandere.
4. Copy x-csrf-token value from request headers.
-c COOKIE, --cookie COOKIE
Cookie. To get it:
1. Open your browser DevTools.
2. Switch to network tab.
3. Vote any post on yandere.
4. Copy cookie value from request headers.
Example:
favors restore yandere -s 3 -t "xxxx" -c "xx=x; xx=x; xx=x" .