Quickly purchase items from Best Buy the moment they restock.
Project description
Best Buy Bullet Bot (3B Bot)
Best Buy Bullet Bot, abbreviated to 3B Bot, is a stock checking bot with auto-checkout created to instantly purchase out-of-stock items on Best Buy once restocked. It was designed for speed with ultra-fast auto-checkout, as well as the ability to utilize all cores of your CPU with multiprocessing for optimal performance.
-
Headless item stock tracking
-
Multiprocessing and multithreading for best possible performance
-
One-time login on startup
-
Ultra-fast auto-checkout
-
Encrypted local credentials storage
-
Super easy setup and usage
Bear in mind that 3B Bot is currently not equipped to handle a queue and/or email verification during the checkout process. If either of these is present, the bot will wait for you to take over and will take control again once you are back on the traditional checkout track.
Prerequisites
-
A Best Buy account with your location and payment information already set in advance.
The only information the bot will fill out during checkout is your login credentials (email and password) and the CVV of the card used when setting up your payment information on Best Buy (PayPal is currently not supported). All other information that may be required during checkout must be filled out beforehand.
-
Python 3.6 or newer
3B Bot is written in Python so if it is not already installed on your computer please install it from https://www.python.org/downloads/.
On Windows make sure to tick the “Add Python to PATH” checkbox during the installation process. On MacOS this is done automatically.
Once installed, checking your Python version can be done with the following.
For MacOS:
python3 --version
For Windows:
python --version
If your version is less than 3.6 or you get the message
python is not recognized as an internal or external command
then install python from the link above. -
A supported browser
3B Bot currently only supports Chrome and Firefox. We recommend using the Firefox browser for it's superior performance during tracking.
Installation
Installing 3B Bot is as simple as running the following in your shell (Command Prompt for Windows and Terminal for MacOS)
For MacOS:
python3 -m pip install --upgrade 3b-bot
For Windows:
pip install --upgrade 3b-bot
Usage
To start the bot just enter the following in your shell
3b-bot
For more usage information check out our documentation.
How does it work?
This is what 3B Bot does step by step at a high level
-
Get currently set URLs to track or prompt if none are set.
-
Using the requests library validate all URLs and get item names.
-
Open up a Google Chrome browser with selenium and perform the following.
a. Navigate to the login page.
b. If we have logged in previously we can use the saved cookies from the previous session to skip the log-in process. If not automatically fill out the username and password fields to log in.
c. Make a get request to the Best Buy API to confirm that there are no items in the cart.
d. If this is the first time using the bot check that a mailing address and payment information has been set.
e. Go to each URL and collect the page cookies. This is done so that during checkout we can just apply the cookies for that URL instead of going through the entire login process.
-
Assign each URL to a core on the CPU.
-
Each core will start a specified number of threads.
-
Each thread will repeatedly check whether the "add to cart button" is available for its item.
-
When a thread notices that an item has come back in stock it will unlock its parent core and lock all other threads on every core to conserve CPU resources and WIFI.
-
The unlocked parent will print to the terminal that the item has come back in stock, play a sound, and attempt to automatically checkout the item with the following steps.
a. With the driver that was used to track the item, click the add-to-cart button.
b. Open up another browser window (this one is visible) and navigate to the item URL to set some cookies to login.
c. Redirect to the checkout page.
d. Enter the CVV for the card.
e. Click "place order".
-
Once finished the parent will update its funds, the item quantity, and unlock all threads to resume stock tracking.
-
Sound will stop playing when the item is no longer in stock.
Performance tips
The following are tips to achieve the best possible performance with 3B Bot.
-
Use the same amount of URLs as cores on your CPU. You can create a URL group with the same URL repeated multiple times to increase the number of URLs you have and
3b-bot count-cores
can be used to see how many cores your CPU has. -
Use ethernet as opposed to WIFI for a stronger more stable connection.
-
Adequately cool your computer to prevent thermal throttling.
-
Tweak the number of threads per URL. This can be changed with the
3b-bot set-threads
command. -
If you plan to complete the checkout process yourself, disable auto-checkout in the settings for a significant performance improvement.
Overall, item stock tracking is a CPU and internet bound task, so at the end of the day the better your CPU and the stronger your internet the faster your tracking.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file 3b-bot-1.1.0.tar.gz
.
File metadata
- Download URL: 3b-bot-1.1.0.tar.gz
- Upload date:
- Size: 98.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76ee3ac2f00e74e1d980fba861a81df067d1b8e20da9862eadb2e58b18fca6ad |
|
MD5 | cde722bd1624cc2c082aadce8544ea78 |
|
BLAKE2b-256 | 31b0c69283845eee3c97f6280883ade629bb11bd4e72c0f489fc345e4f2c54de |