ANNOUNCEMENT: Join the Discord server here
Basically what this bot does is:
- Reads your query.txt file.
- Appends the next line to the MyPlates API link.
- Opens the API link with urllib and reads the page using BeautifulSoup (explained later).
- Checks if the plate is taken, available, or if you're being blocked by incapsula.
- Exports all the available plates to a txt.
- And does a lot more in the background.
I know what you're thinking, "This guy is insane to be accessing an api without using requests!" And you'd be correct. The only problem is that Incapsula is really smart and blocks my requests. I spent such a long time figuring out how to bypass incapsula with requests, that I even quit on this project for a while because of how much time I was spending. I decided to try a different way as all my methods were not working (custom headers, cookies, etc.). I ended up figuring out that urllib was able to access the site without getting blocked. Now I have this project. I feel like this workaround should not have worked, seeing all the other people who failed using this same workaround. But you know what they say, "If it ain't broke, don't fix it!"
-
The default
query.txt
file will contain random plates that are available and not available. If every plate is coming up as either available/not-available, go into the main.py and set debug mode to true to get a further insight into what the bot is seeing and open up an issue with a log from the console. -
The default checklink is for the Classic Black Silver plate, which supports up to 7 characters.
-
There is a lightweight version that you can obtain from here.
-
I mostly use this repository as a way to learn more about Python and play around with every unneccesary thing possible, so if you see any bad code, please open up an issue or a pull request. I've removed a lot of unneccesary things from the code, but I'm sure there's still a lot of bad code in there.
- NOTE: Leaving any of these unset/incorrectly set will set the variables to their defaults.
debug
- Can be set to either
true
orfalse
. Enables/disables debug mode, which outputs the checklink with the query, the page, and the query. The default setting for this isfalse
.
- Can be set to either
sleeptime
- Can be set to any time in seconds (ex.
3
,7
,1
). The default setting for this is3
.
- Can be set to any time in seconds (ex.
minimode
- Can be set to either
true
orfalse
. Enables/disables mini mode, which disables output of not-available plates. The default setting for this isfalse
.
- Can be set to either
NOTE: If you want to see the latest planned features/progress on them, go to the Issues tab and sort by the tag enhancement.
NOTE: Make sure you are using Python 3.
- Clone the repository
- Or download the zip using this link.
- Open up the folder in your favorite IDE (like PyCharm or VScode)
- If you can open up this file in CMD/Terminal, you do not need an explanation on how to get this thing fully setup.
- Go into the terminal and type
pip install -r requirements.txt
- Edit the
query.txt
file to your liking- Make sure to separate all the plates by new lines. Also make sure all the queries fit the plate requirements.
- Edit the
config.ini
file to your liking - You are now ready to run the bot! Make sure to run
main.py
.
OR
- Download the EXE from the releases tab
- Make a
query.txt
andconfig.ini
file in the same directory as the EXE - Run the EXE
NOTE: This will not always be up-to-date, and I will not add uncommon issues to this list. If you want an up-to-date list of fixes, click here.
- Currently, there are no observed errors. If you are aware of an error, please open up an issue!