Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

Bump webdriver-manager from 3.7.0 to 3.7.1 #13

Closed
wants to merge 51 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
e71cdf2
move B3.py
1404er Feb 22, 2022
41f3dc1
Create index.html
1404er Feb 22, 2022
c9eb68b
0.7
1404er Feb 23, 2022
50a9e58
added bat
1404er Feb 23, 2022
ea9f581
Rename setup.bat to B3setup.bat
1404er Feb 23, 2022
7d0fba0
Deleted deprecated setup
1404er Feb 23, 2022
438b9d6
include license
1404er Feb 23, 2022
1357fbf
0.8
1404er Mar 4, 2022
c417f02
0.8
1404er Mar 8, 2022
6a618d4
Update README.md
1404er Mar 8, 2022
c3173f8
Update README.md
1404er Mar 8, 2022
3650b5d
fl
1404er Mar 8, 2022
f6c9575
selenium 4.1.3
1404er Mar 10, 2022
4d5a578
Update B3req.txt
1404er Mar 10, 2022
13a35f1
commit 60
1404er Mar 16, 2022
3bbe4f8
60
1404er Mar 16, 2022
0bb3409
vbs
1404er Mar 16, 2022
bbc2690
fix sh
1404er Mar 16, 2022
aa897d1
.
1404er Mar 16, 2022
e04c3f2
docs 09
1404er Mar 17, 2022
e16f8ec
adjust docs
1404er Mar 17, 2022
0840453
patch verify.py
1404er Mar 17, 2022
939cb68
patch2
1404er Mar 17, 2022
03a4ff4
Update License Years
1404er Mar 17, 2022
0046899
sync
1404er Mar 28, 2022
f0db3e7
1.0
1404er Mar 28, 2022
9b81f34
spaces
1404er Mar 28, 2022
cafc11c
h
1404er Mar 29, 2022
5de7e4b
rename requirement files
1404er Mar 30, 2022
243db61
Merge branch 'main' of https://github.com/Dogey11/B3
1404er Mar 30, 2022
69d4a1a
fix double pyinstaller
1404er Mar 30, 2022
81a7ea1
more info
1404er Mar 30, 2022
289bb1a
badge
1404er Apr 13, 2022
38d5f6d
b2
1404er Apr 13, 2022
f848321
pyinstaller 5.0
1404er Apr 19, 2022
951a283
update docs
1404er Apr 19, 2022
f9ac744
pyinstaller 5.0.1
1404er May 3, 2022
1e0b86f
dependabot
1404er Jun 2, 2022
52b0aa4
Bump webdriver-manager from 3.5.4 to 3.7.0 in /setup/windows
dependabot[bot] Jun 2, 2022
691989a
revert 22
1404er Jun 2, 2022
fb25817
Merge pull request #4 from Dogey11/dependabot/pip/setup/windows/webdr…
1404er Jun 2, 2022
cf5689c
Bump webdriver-manager from 3.5.4 to 3.7.0 in /setup/linux
dependabot[bot] Jun 2, 2022
8097125
Merge pull request #6 from Dogey11/dependabot/pip/setup/linux/webdriv…
1404er Jun 2, 2022
07ee65d
Bump selenium from 4.1.3 to 4.2.0 in /setup/linux
dependabot[bot] Jun 2, 2022
31c11d0
Merge pull request #5 from Dogey11/dependabot/pip/setup/linux/seleniu…
1404er Jun 2, 2022
12efc80
Bump selenium from 4.1.3 to 4.2.0 in /setup/windows
dependabot[bot] Jun 2, 2022
2e7ca96
Merge pull request #7 from Dogey11/dependabot/pip/setup/windows/selen…
1404er Jun 2, 2022
7f0866d
Bump pyinstaller from 5.0.1 to 5.1 in /setup/windows
dependabot[bot] Jun 2, 2022
600b336
Merge pull request #8 from Dogey11/dependabot/pip/setup/windows/pyins…
1404er Jun 2, 2022
2b3b964
13
1404er Jun 29, 2022
b7b0d1c
Bump webdriver-manager from 3.7.0 to 3.7.1
dependabot[bot] Jun 29, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
13 changes: 13 additions & 0 deletions GETTING_STARTED.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Usage Index

#### [License](https://github.com/Dogey11/B3/blob/main/LICENSE)

### Windows
[Requirements](https://github.com/Dogey11/B3/blob/main/docs/md/windows/REQUIREMENTS.md)

[Installing](https://github.com/Dogey11/B3/blob/main/docs/md/windows/INSTALL_GUIDE.md)

### Linux
[Requirements](https://github.com/Dogey11/B3/blob/main/docs/md/linux/REQUIREMENTS.md)

[Installing](https://github.com/Dogey11/B3/blob/main/docs/md/linux/INSTALL_GUIDE.md)
4 changes: 0 additions & 4 deletions KNOWN_ISSUES.md

This file was deleted.

101 changes: 4 additions & 97 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,104 +1,11 @@
# B3
Best-Buy-Bot. Written in Python

**NOTICE:**

**Don't use this for any scalping/reselling purposes.**

**This is documentation for versions 0.4 and up.**

## About
B3 is a bot thats a newer and updated version of a now deprecated bot called "BBB". It's now improved to be faster, more accurate, and easier to use then before.
B3 automatically purchases an item from BestBuy when it's available using the given link.

<sub><sup>Real original name right?</sup></sub>

## Currently Supported Operating Systems
### Windows - Supported
### Mac OS - Not Supported
### Linux - Not Supported


## Install
Install guide

### Links you'll need:
#### [Python 3](https://www.python.org/downloads/)
You'll need Python 3.10 or later.
#### [Google Chrome](https://www.google.com/chrome/)
As of now, only Google Chrome is supported.
#### [B3](https://github.com/Dogey11/B3/releases/latest)
The latest version of B3.

### Installation Guide:

### Step 1: Installing Python
__If you already have python installed, skip this step.__

#### 1.1. Go to the 1st link and click the download button shown below:
![Screenshot 2021-11-30 094425](https://user-images.githubusercontent.com/69096657/144100197-6a2118eb-14dd-441f-8dae-6bc0a4d30ea9.png)
<sub><sup>My microsoft paint circle lol</sup></sub>

#### 1.2. Open the installer.
![unknown](https://user-images.githubusercontent.com/69096657/144100640-49284c03-c5a3-40ff-bb8e-fb68b0d3225e.png)

<sub><sup>I'm good at making circles</sup></sub>
#### Select the Add Python 3.10 to PATH option. Note: this may require administrator privileges.
#### Select Install Now.

#### 1.3. When the install is finished, Select disable path length limit if prompted.
![unknown2](https://user-images.githubusercontent.com/69096657/144101345-6d57414a-089b-4351-a3ba-22aa7d2c27eb.png)
#### Restart your pc and go to the next step.

![GitHub release (latest by date)](https://img.shields.io/github/v/release/dogey11/b3?style=for-the-badge)

Best-Buy-Bot. Written in Python

### Step 2: Create and Configure A BestBuy Account
### These are the most crucial steps and if not done right, B3 won't be able to complete the purchase.
#### 2.1 Create A BestBuy account if you don't have one. If you do, make a new one for the bot or use your own.
#### 2.2 Make sure the address you want the product to be shipped to is the ONLY address saved to your BestBuy account.
#### 2.3 Make sure only the payment method you plan to use is saved.
#### 2.4 Make sure 2FA (Two factor authentication) is DISABLED on your account.



### Step 3: Running B3
#### Now that everything is configured, It's time to actually install B3.
#### 3.1 Go to the 3rd link. At the newest release, scroll down to files and download the zip file.
#### 3.2 extract it.
#### 3.3 In the extracted folder, run setup.py
#### 3.4 Follow the prompts.
#### 3.5 After the inital setup, go to C:\b3 in File Explorer. run verify.py by double clicking or running from cmd. read carefully and start the check.
#### 3.6 During the check you might see a prompt from BestBuy asking for email and or phone confirmation. B3 cannot do this itself. You must click and allow the sign in.
#### 3.7 When the verification check is done, Close the window.
#### 3.8 Go to the C:\b3 folder again.
#### 3.9 (Optional) Right click "b3.py" and choose Send to -> Desktop (create shortcut)
#### 3.10 Double click the shortcut or .py file and enter in the item & login info when prompted.
#### 3.11 Let it run until your item is bought!



## Modules used

#### Internal:

Datetime

os

shutil

sys

time


#### Third-Party:

[Selenium](https://pypi.org/project/selenium/)
**NOTICE: This tool is in a deprecated state, However it is still functional. [More info.](https://github.com/Dogey11/B3/blob/main/docs/md/deprecation/NOTICE.md)**

[webdriver-manager](https://pypi.org/project/webdriver-manager/)

## Installing from source
```
git clone https://github.com/Dogey11/B3
```
[Installing info has been moved.](https://github.com/Dogey11/B3/blob/main/GETTING_STARTED.md)
2 changes: 0 additions & 2 deletions Required

This file was deleted.

3 changes: 0 additions & 3 deletions b3.py

This file was deleted.

7 changes: 7 additions & 0 deletions docs/md/deprecation/NOTICE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Deprecation notice

On **March 28th, 2022** the tenth version **1.0** was released. It is the final major version, however minor updates will continue. new issues and pull requests can be made until B3 is archived on **April 20th, 2023**.

**Any versions released after 1.0 are considered minor fixes unless specified otherwise.**

[Learn more about archived repositories](https://docs.github.com/en/repositories/archiving-a-github-repository/archiving-repositories)
27 changes: 27 additions & 0 deletions docs/md/linux/INSTALL_GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Install Guide (Linux)

#### NOTE: See [the requirements page](https://github.com/Dogey11/B3/blob/main/docs/md/linux/REQUIREMENTS.md) before continuing,
#### Setup a BestBuy account if you haven't already. Make sure 2FA is DISABLED and that you only have one shipping address and payment method.


## Steps


* Download the linux installer [here](https://github.com/Dogey11/B3/releases/latest/download/B3-setup.sh)

* Run the installer
```
chmod +x B3-setup.sh
./B3-setup.sh
```

* Agree to the license and follow the prompts

* Run B3.py
```
cd $HOME/.Dogey11/B3
python3 B3.py
```
* If that fails try running main.py instead.

* Follow prompts and let it run.
24 changes: 24 additions & 0 deletions docs/md/linux/REQUIREMENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Requirements for Linux

* Debian-based distro
* Only Debian-based distros are supported at the moment.

* [Mozilla Firefox](https://www.mozilla.org/en-US/firefox/new/)

* A BestBuy account
* Use your own OR make a new one

### Packages

These packages come preinstalled with most distros, check if you have them
and install any missing ones.

**pip3**
```
sudo apt install python3-pip
```

**wget**
```
sudo apt install wget
```
17 changes: 17 additions & 0 deletions docs/md/windows/INSTALL_GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Install Guide (Windows)

#### NOTE: See [the requirements page](https://github.com/Dogey11/B3/blob/main/docs/md/windows/REQUIREMENTS.md) before continuing,
#### Setup a BestBuy account if you haven't already. Make sure 2FA is DISABLED and that you only have one shipping address and payment method.


## Steps


* Download the windows installer [here](https://github.com/Dogey11/B3/releases/latest/download/B3-setup.cmd)

* Agree to the license and follow the prompts
* It's recommended to make a executable and Desktop shortcut.

* Open B3.exe OR B3.py if you chose not to make an executable.

* Follow prompts and let it run.
12 changes: 12 additions & 0 deletions docs/md/windows/REQUIREMENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Requirements for Windows

* Minimum of Windows 10 version 1803
* OR Windows 11 (Preferred)

* [Mozilla Firefox](https://www.mozilla.org/en-US/firefox/new/)

* [Python3](https://www.python.org/downloads/windows/)
* Must be added to PATH and have PIP installed

* A BestBuy account
* Use your own OR make a new one
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
selenium==4.2.0
webdriver-manager==3.7.1
135 changes: 135 additions & 0 deletions src/cli/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
from time import sleep
from datetime import datetime
from sys import argv
import selenium
import selenium.webdriver
import selenium.common.exceptions as ec
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.expected_conditions import presence_of_element_located
from selenium.webdriver.firefox.service import Service
from webdriver_manager.firefox import GeckoDriverManager


FREE_ITEM = "https://www.bestbuy.com/site/free-youtube-premium-for-3-months-new-subscribers-only/6453905.p?skuId=6453905"


def tryParse(i):
try:
int(i)
return True
except:
pass
return False


def verifyMode():
match len(argv):
case 2:
return argv[1] == "--verify"
case _:
return False


def getLink():
return input("BestBuy Item Link: ").lower()


def getEmail():
return input("BestBuy Account Email: ")


def getPassword():
return input("BestBuy Account Password: ")


def getCVV():
print("\nThis is required by BestBuy to use the default payment.")

cvv = input("BestBuy Default Payment Method CVV/CVC: ")
if len(cvv) <= 4 and tryParse(cvv):
return cvv
else:
raise Exception("Invalid.")


def getTime():
return datetime.now().strftime("%m/%d/%Y %H:%M:%S")


def main():
link = getLink()
email = getEmail()
pwd = getPassword()
cvv = getCVV()

service = Service(executable_path=GeckoDriverManager().install())

with selenium.webdriver.Firefox(service=service) as driver:
driver.get(link)
while True:
try:
addToCartBtn = WebDriverWait(driver, 3).until
(
presence_of_element_located((By.CLASS_NAME,
"c-button c-button-disabled c-button-lg c-button-block add-to-cart-button"))
)
except ec.NoSuchElementException:
try:
surveyNo = driver.find_element(By.ID, "survey_invite_no")
surveyNo.click()
except ec.NoSuchElementException:
pass

addToCartBtn = WebDriverWait(driver, 10).until
(
presence_of_element_located((By.CLASS_NAME,
"c-button c-button-primary c-button-lg c-button-block c-button-icon c-button-icon-leading add-to-cart-button"))
)

print(f"Available as of {getTime()}")
addToCartBtn.click()
driver.get("https://www.bestbuy.com/cart")

toBuyScreen = WebDriverWait(driver, 60).until
(
presence_of_element_located((By.XPATH, "//*[text()='Checkout']"))
)
toBuyScreen.click()

enterEmail = WebDriverWait(driver, 60).until
(
presence_of_element_located((By.ID, "fld-e"))
)

enterEmail.send_keys(email)
sleep(0.1)
enterPassword = driver.find_element(By.ID, "fld-p1")
enterPassword.send_keys(pwd)
sleep(0.1)
signInBtn = driver.find_element(By.XPATH, "//*[text()='Sign In']")
signInBtn.click()

enterCVV = WebDriverWait(driver, 600).until
(
presence_of_element_located((By.ID, "cvv"))
)

enterCVV.send_keys(cvv)
sleep(0.5)
confirmBuy = driver.find_element(By.CLASS_NAME, "btn-lg.btn-block.btn-primary.button__fast-track")
confirmBuy.click()
sleep(5)
print(f"Purchased at {getTime()}")
break
except selenium.common.exceptions.TimeoutException:
print(f"Out of Stock as of {getTime()}")
driver.refresh()

sleep(60)
print(f"Finished at {getTime()}")
driver.quit()


if __name__ == "__main__":
main()