About this project
Created to facilitate access to pictures of PIXIV daily rankings
- Get ranking
- Create a separate folder for each artist to save his pictures. The folder name format is: artist name_ID = artist ID.
- Save the folder to the directory configured in the configuration file
- Images from blacklisted artists will not be downloaded.
- Automatically add artists in the blacklist directory to the blacklist and delete images in the blacklist directory
The main functions of the current project are these
use
Running the exe file for the first time will create 1. blacklist directory 2. blacklist.json 3.config.txt 4. download directory
- After downloading the picture, you may not like the artist's style. You can drag and drop the artist's folder in this directory. The next time you run the program, the artist will be added to the blacklist.json and the files in the blacklist directory will be deleted. picture
- The blacklist.json is automatically generated. If you don’t know the json, don’t delete the content in it, because currently the program does not have the function to back up the blacklist.
- The default setting in config.txt is to download in the download directory, which is a temporary directory. After downloading, you can manually cut the ones you think look good into the warehouse directory, and cut the ones you think need to be added to the blacklist into the blacklist directory. Sending emails is not supported yet, so the following configuration does not matter.
- Download directory (generated by the program), the download directory in the default configuration. After modifying the configuration later, downloading will not be done in this directory.
After the initialization is completed, it will automatically enter the download. Special handling methods have been written below the FAQ.
Configuration file modification:
This is the default configuration. You only need to modify the text content after --. For example: you want to modify the warehouse to c:Download
Email related matters have not been processed yet.
Possible problems
- Program crash: In fact, this is a coding problem on my side. I will use the code to throw an exception later to avoid crashing. The first is the configuration file problem. Check whether the directory is an absolute path. The second may be the blacklist directory. It is caused by entering a directory that is not the artist's. The third possibility is that the blacklist.json is a human error and has been modified.
- The program crashes when entering the first page of data processing: an exception is thrown later to solve the problem. It may be that the PIXIV website is not available on your Internet. Please use Scientific Internet.
- The program gets stuck in the download stage and crashes after a while: throw an exception later to solve the problem, just restart the program.
- The progress bar keeps refreshing downwards: This cannot be fixed by the code, because cmd is used to output content. If the buffer length of cmd is not enough, it will enter the next line, causing it to keep refreshing downwards. The solution is to increase the buffer length, as follows is the modification step
In fact, the process should be refreshed on one line when starting processing. The solution is as follows
This solves the problem, just re-run the program
About source code
The purpose of this project was initially to facilitate my own use. Later, the amount of code became larger and larger, and my friends also started to want to use it. I modified the original code to generate an exe file that can also be used by novices, and it is also a record. A note from the study, the source code will also be put together for everyone to study. In fact, the current code is half of my original project. The code I use myself has 400 lines of code. The main reason is that there is no output and the py file needs to be modified, so Not suitable for beginners
Future update plans
- Solving crashes: The program will not crash if there is an exception, and the original error message will be given (more detailed exception handling will be performed later to prompt different error messages)
- Log: Output the debugging information to the log file, which will be used as an email attachment later.
- Support QQ email notification results (other email settings are under consideration)
- Update the progress bar display method: the progress bar is relatively rigid now and will be modified later.
- The current code is not suitable for task plan deployment. After the code is improved, a tutorial will be written on how to deploy the task plan and run it automatically every day.
expect
Whether you are a novice or an expert, you can give me suggestions for modifications, whether in terms of functions or code. If you have any problems when using it, you can give me suggestions. QQ email: [email protected]