summaryrefslogtreecommitdiff
path: root/python-3b-bot.spec
blob: b043d816dd68a7887dc064da6edd9e864bfbd760 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
%global _empty_manifest_terminate_build 0
Name:		python-3b-bot
Version:	1.1.0
Release:	1
Summary:	Quickly purchase items from Best Buy the moment they restock.
License:	MIT
URL:		https://github.com/LeonShams/BestBuyBulletBot
Source0:	https://mirrors.nju.edu.cn/pypi/web/packages/31/b0/c69283845eee3c97f6280883ade629bb11bd4e72c0f489fc345e4f2c54de/3b-bot-1.1.0.tar.gz
BuildArch:	noarch


%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.

![3B Bot](https://raw.githubusercontent.com/LeonShams/BestBuyBulletBot/main/docs/source/assets/demo.svg)
<br>

## Prerequisites

1. **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.

2. **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:

    ```bash
    python3 --version
    ```

    For Windows:

    ```bash
    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.

3. **A supported browser**

    3B Bot currently only supports [Chrome](https://www.google.com/chrome/) and [Firefox](https://www.mozilla.org/en-US/firefox/new/). 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:

```bash
python3 -m pip install --upgrade 3b-bot
```

For Windows:

```bash
pip install --upgrade 3b-bot
```

## Usage

To start the bot just enter the following in your shell

```bash
3b-bot
```

**For more usage information check out our [documentation](https://bestbuybulletbot.readthedocs.io/en/latest/).**

## How does it work?

This is what 3B Bot does step by step at a high level

1. Get currently set URLs to track or prompt if none are set.

2. Using the requests library validate all URLs and get item names.

3. 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.

4. Assign each URL to a core on the CPU.

5. Each core will start a specified number of threads.

6. Each thread will repeatedly check whether the "add to cart button" is available for its item.

7. 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.

8. 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".

9. Once finished the parent will update its funds, the item quantity, and unlock all threads to resume stock tracking.

10. 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.


%package -n python3-3b-bot
Summary:	Quickly purchase items from Best Buy the moment they restock.
Provides:	python-3b-bot
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	python3-pip
%description -n python3-3b-bot
# 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.

![3B Bot](https://raw.githubusercontent.com/LeonShams/BestBuyBulletBot/main/docs/source/assets/demo.svg)
<br>

## Prerequisites

1. **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.

2. **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:

    ```bash
    python3 --version
    ```

    For Windows:

    ```bash
    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.

3. **A supported browser**

    3B Bot currently only supports [Chrome](https://www.google.com/chrome/) and [Firefox](https://www.mozilla.org/en-US/firefox/new/). 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:

```bash
python3 -m pip install --upgrade 3b-bot
```

For Windows:

```bash
pip install --upgrade 3b-bot
```

## Usage

To start the bot just enter the following in your shell

```bash
3b-bot
```

**For more usage information check out our [documentation](https://bestbuybulletbot.readthedocs.io/en/latest/).**

## How does it work?

This is what 3B Bot does step by step at a high level

1. Get currently set URLs to track or prompt if none are set.

2. Using the requests library validate all URLs and get item names.

3. 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.

4. Assign each URL to a core on the CPU.

5. Each core will start a specified number of threads.

6. Each thread will repeatedly check whether the "add to cart button" is available for its item.

7. 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.

8. 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".

9. Once finished the parent will update its funds, the item quantity, and unlock all threads to resume stock tracking.

10. 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.


%package help
Summary:	Development documents and examples for 3b-bot
Provides:	python3-3b-bot-doc
%description help
# 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.

![3B Bot](https://raw.githubusercontent.com/LeonShams/BestBuyBulletBot/main/docs/source/assets/demo.svg)
<br>

## Prerequisites

1. **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.

2. **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:

    ```bash
    python3 --version
    ```

    For Windows:

    ```bash
    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.

3. **A supported browser**

    3B Bot currently only supports [Chrome](https://www.google.com/chrome/) and [Firefox](https://www.mozilla.org/en-US/firefox/new/). 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:

```bash
python3 -m pip install --upgrade 3b-bot
```

For Windows:

```bash
pip install --upgrade 3b-bot
```

## Usage

To start the bot just enter the following in your shell

```bash
3b-bot
```

**For more usage information check out our [documentation](https://bestbuybulletbot.readthedocs.io/en/latest/).**

## How does it work?

This is what 3B Bot does step by step at a high level

1. Get currently set URLs to track or prompt if none are set.

2. Using the requests library validate all URLs and get item names.

3. 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.

4. Assign each URL to a core on the CPU.

5. Each core will start a specified number of threads.

6. Each thread will repeatedly check whether the "add to cart button" is available for its item.

7. 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.

8. 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".

9. Once finished the parent will update its funds, the item quantity, and unlock all threads to resume stock tracking.

10. 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.


%prep
%autosetup -n 3b-bot-1.1.0

%build
%py3_build

%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
	find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
	find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
	find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
	find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
	find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .

%files -n python3-3b-bot -f filelist.lst
%dir %{python3_sitelib}/*

%files help -f doclist.lst
%{_docdir}/*

%changelog
* Wed May 31 2023 Python_Bot <Python_Bot@openeuler.org> - 1.1.0-1
- Package Spec generated