Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.1.0 #137

Merged
merged 173 commits into from
Jul 30, 2024
Merged

0.1.0 #137

Show file tree
Hide file tree
Changes from 146 commits
Commits
Show all changes
173 commits
Select commit Hold shift + click to select a range
d61ea53
Lots of refactoring and fixes
cal4 Jun 8, 2024
bcfb74d
Fix double random sleep
cal4 Jun 8, 2024
6a8aa33
Add todo
cal4 Jun 8, 2024
7e55b71
Fix __init__.py
cal4 Jun 8, 2024
9c04e0a
Share some useful config
cal4 Jun 8, 2024
3922471
Default logging back to info
cal4 Jun 8, 2024
ef87aae
Fix bug opening headless mobile browser, other improvements
cal4 Jun 9, 2024
e3ea989
Give time for browser to close, suppress exceptions, prefer | to Opti…
cal4 Jun 12, 2024
b3d1f48
Provide default config if not present
cal4 Jun 13, 2024
ca8c732
Adjust sleep between browsers
cal4 Jun 13, 2024
a61f6b2
Restore default log level
cal4 Jun 13, 2024
4a598fc
Remove redundant cleanup, handled already by __exit__
cal4 Jun 13, 2024
c93285a
Remove exception suppression since handled by quit already
cal4 Jun 13, 2024
e153d95
Adjust todos
cal4 Jun 14, 2024
a9cb949
Restore original defaults
cal4 Jun 14, 2024
c76d24f
Fix exception logging
cal4 Jun 14, 2024
94c845d
Fix exception logging
cal4 Jun 14, 2024
b9f7460
Reflect defaults in config.yaml
cal4 Jun 14, 2024
e600cf5
Include traceback in logs
cal4 Jun 14, 2024
ff447a0
Add more and better type hints
cal4 Jun 14, 2024
c788c4e
Wrap main in try-catch
cal4 Jun 14, 2024
262d602
Reformat and fix exception logging
cal4 Jun 14, 2024
be434f5
Put sys back
cal4 Jun 15, 2024
ca97462
Reformat main
cal4 Jun 16, 2024
f13a682
Configure apprise summary via command line arg
cal4 Jun 16, 2024
a286c0f
Share JetBrains run config
cal4 Jun 16, 2024
08b551d
Configure apprise summary via command line arg
cal4 Jun 16, 2024
b2c4480
Persist Google trends to disk and read/write
cal4 Jun 17, 2024
0f4bc50
Remove isDebuggerAttached
cal4 Jun 18, 2024
5e9172d
Be more explicit
cal4 Jun 18, 2024
0135714
Alter imports
cal4 Jun 18, 2024
9972b0e
Add warning logging and remove unused variable
cal4 Jun 18, 2024
4b930c9
Fix import error and return
cal4 Jun 18, 2024
059ecd9
Add google_trends to .gitignore
cal4 Jun 18, 2024
b737c88
Use new method
cal4 Jun 18, 2024
e862a0a
Don't remove load date from google_trends; add logging
cal4 Jun 19, 2024
4051e25
Attempt fix where actual points aren't correct
cal4 Jun 19, 2024
e42d9c4
Update logging
cal4 Jun 19, 2024
5d27c43
Print 2FA to console regardless of log level
cal4 Jun 19, 2024
f3f70fe
Raise exceptions versus return error codes; add more type hints; try-…
cal4 Jun 19, 2024
b322317
Raise exceptions in exceptional conditions; add more typing
cal4 Jun 19, 2024
a205f7d
Raise exceptions if error, don't handle since not recoverable
cal4 Jun 19, 2024
dcf21a8
Fix error when counting points when no remaining searches
cal4 Jun 19, 2024
354cecc
Better error-handling
cal4 Jun 19, 2024
a6da35f
Add type hint
cal4 Jun 19, 2024
f1e0bd6
Remove redundant method and just throw an exception instead of infini…
cal4 Jun 19, 2024
87ff9dd
Just try once and if not successful raise exception
cal4 Jun 19, 2024
41a6656
Replace Apprise summary parameter with ability to disable Apprise via…
cal4 Jun 19, 2024
af2ec8f
Lots of refactoring, predominately throw more exceptions and fail-fast
cal4 Jun 21, 2024
8caf18e
Move failing term to end of list, spam search if not typed
cal4 Jun 23, 2024
d48fb60
Make names more apt
cal4 Jun 23, 2024
bb14bf1
Handle if no related terms and some renaming
cal4 Jun 24, 2024
87ec7f2
Remove send_keys spam since not needed and some renaming
cal4 Jun 24, 2024
db016ce
Handle timeout by doubling wait time
cal4 Jun 24, 2024
4a633fc
If card fails for some reason, log error and continue till none are left
cal4 Jun 24, 2024
a400795
Correct timeToWait type hints
cal4 Jun 25, 2024
aad602e
Remove unnecessary calls to go home
cal4 Jun 25, 2024
ea617bf
Handle some special url rewards; invert condition to help with indent…
cal4 Jun 25, 2024
91599d3
Invert condition to help with indentation; reformat
cal4 Jun 25, 2024
3f5c431
Make punchCards.py faster
cal4 Jun 25, 2024
f416cf6
Add todo
cal4 Jun 25, 2024
42bf12f
Make consistent with others (no go home)
cal4 Jun 25, 2024
e035374
Prefer goHome
cal4 Jun 25, 2024
b02bf12
Continue on error for punch cards and update log message to better re…
cal4 Jun 25, 2024
d2544fc
Specify parameter
cal4 Jun 25, 2024
2e8679a
Add goToSearch and rename goToRewards
cal4 Jun 26, 2024
e1e3dfa
Add debug logging
cal4 Jun 26, 2024
8c893f7
Reformat
cal4 Jun 26, 2024
2dca5d2
Increase timeToWait and spam searchbar
cal4 Jun 26, 2024
b166d62
Add todo
cal4 Jun 26, 2024
a58401f
Handle rate limit
cal4 Jun 26, 2024
472a153
Move sleep
cal4 Jun 26, 2024
baebbd5
Try handling timeout
cal4 Jun 28, 2024
01b53ab
Update logging
cal4 Jun 28, 2024
f48d4cb
Merge remote-tracking branch 'upstream/master'
cal4 Jun 28, 2024
cdfb5a2
Add debugging statements
cal4 Jun 28, 2024
2de01c1
Fix bug when detecting two-factor
cal4 Jun 28, 2024
46c368e
Handle keep me signed in prompt and remove redundant default waits
cal4 Jun 28, 2024
46ce291
Remove redundant method
cal4 Jun 29, 2024
212c719
Ignore space before colon
cal4 Jun 29, 2024
f385a1d
Add CHANGELOG.md
cal4 Jun 29, 2024
a3f4d9e
Get account points explicitly
cal4 Jun 29, 2024
c53efef
Add compatibility requirements
cal4 Jun 29, 2024
4e63382
Add statement to assert
cal4 Jun 29, 2024
0779d2a
Update comment
cal4 Jun 29, 2024
ecc608a
Restore url before after getting dashboard data
cal4 Jun 29, 2024
16cbefc
Cleanup getBingInfo
cal4 Jun 29, 2024
d7e3155
Prefer getBingInfo
cal4 Jun 29, 2024
dd9b170
Sleep longer after send_keys
cal4 Jun 29, 2024
b7697af
Adjust config defaults
cal4 Jun 29, 2024
2b9013c
Added hasty text check for "Let's protect your account" upon logging …
Jun 30, 2024
8e260df
Merge branch 'develop' of https://github.com/aside6/MS-Rewards-Farmer…
Jun 30, 2024
79b6f19
Fixed mistaken clickable update
Jun 30, 2024
2751f38
Fixed protection check
Jun 30, 2024
af180dd
Make logging a bit clearer
cal4 Jun 30, 2024
3d6b51b
Added a hasty "Let's protect your account" check (#138)
cal4 Jun 30, 2024
a58dd66
Add some todos
cal4 Jun 30, 2024
3c6e1a5
Handle running from other than project root and add some logging
cal4 Jun 30, 2024
bf476bf
Explicitly go to rewards page
cal4 Jun 30, 2024
b898ca1
Use with keyword searches
cal4 Jun 30, 2024
4a3ba4f
Use mobileBrowser
cal4 Jul 1, 2024
19be9f8
Use dbm.dumb
cal4 Jul 1, 2024
3bc6901
Remove unnecessary type hints
cal4 Jul 1, 2024
47ebc4d
Click before send_keys (see https://stackoverflow.com/a/25804316/4164…
cal4 Jul 1, 2024
e2a44a2
Get rid of alias
cal4 Jul 1, 2024
e9a7e3c
Configure retry strategy for getBingInfo
cal4 Jul 1, 2024
3ef0ee6
Up searchbar attempts
cal4 Jul 1, 2024
944ce9c
Refactor and handle open job roles card
cal4 Jul 1, 2024
3726e04
Handle plan a quick getaway promotion
cal4 Jul 3, 2024
296ba92
Use variable
cal4 Jul 4, 2024
e58442a
Merge branch 'master' into develop
klept0 Jul 4, 2024
e555f27
Merge remote-tracking branch 'upstream/master' into develop
cal4 Jul 5, 2024
cff4e9f
Remove unnecessary descriptions
cal4 Jul 5, 2024
002663b
Handle puzzles
cal4 Jul 5, 2024
80baa5c
Use default session with retry
cal4 Jul 5, 2024
39a57de
Change defaults
cal4 Jul 5, 2024
1a85a4f
Use default session with retry
cal4 Jul 5, 2024
8563518
If get fails, try go to rewards
cal4 Jul 5, 2024
9964383
Attempt fix Chrome resource leak
cal4 Jul 5, 2024
42eb8fb
Sleep before attempt not after (except first)
cal4 Jul 5, 2024
98edecc
Sleep before attempt not after (except first)
cal4 Jul 5, 2024
84fe7fc
Get remaining searches from Browser
cal4 Jul 5, 2024
a252a1c
Update attempts max
cal4 Jul 6, 2024
d6ba71c
Handle when cards go big mode
cal4 Jul 6, 2024
28d541a
Remove return
cal4 Jul 7, 2024
a61b805
Prefer retries to attempts
cal4 Jul 7, 2024
ec4a1dd
Fix numbering
cal4 Jul 7, 2024
4737caf
Update searches.py
jdeath Jul 9, 2024
eebbb46
Update searches.py
jdeath Jul 9, 2024
051a128
Update searches.py
jdeath Jul 9, 2024
4d6d5b1
Update browser.py
jdeath Jul 9, 2024
178b3b7
Add assert
cal4 Jul 9, 2024
2b5d6f1
Support more promotions
cal4 Jul 9, 2024
99a6df9
Merge branch 'klept0:develop' into develop
jdeath Jul 9, 2024
1875267
Add command line option to do either mobile or desktop search only
toovoo Jul 10, 2024
d2e34fe
Merge branch 'develop' into mobile-desktop-flag
toovoo Jul 10, 2024
1a21d89
Clean up executeBot func and fix errors with mobileSearch func
toovoo Jul 12, 2024
b462688
Add a couple missed promos
cal4 Jul 16, 2024
0ee3c32
Add command line option to do either mobile or desktop search only (#…
cal4 Jul 19, 2024
bf7a87c
Add scroll which is required for some promos
cal4 Jul 19, 2024
b6c95f6
Send incomplete promotion notification
cal4 Jul 19, 2024
3afa10b
Add Contributing section
cal4 Jul 19, 2024
0a2ee23
Remove lines
cal4 Jul 19, 2024
3a353bd
Reformat
cal4 Jul 19, 2024
854950b
Move tips to bug_report.yml
cal4 Jul 19, 2024
1661754
Fix bug when getting activity
cal4 Jul 20, 2024
23eaa4d
Refactor and simplify morePromotions.py
cal4 Jul 20, 2024
c02f83b
Suppress exception in case no searchbar
cal4 Jul 21, 2024
4f7f858
Refactor to fix on_error flag
cal4 Jul 21, 2024
bf60ead
Return account points
cal4 Jul 21, 2024
a1290d5
Fix some problems with promos/activities
cal4 Jul 23, 2024
6fb061a
Fix bug when setting startingPoints when mobile only
cal4 Jul 24, 2024
76f3336
Merge branch 'klept0:develop' into develop
jdeath Jul 25, 2024
4cda900
Add Mobile App Daily Check-in
jdeath Jul 25, 2024
f1d2eb6
Update readToEarn.py
jdeath Jul 25, 2024
fc3e29a
Update readToEarn.py
jdeath Jul 25, 2024
68b93bd
Adds Daily Check-in (#152)
cal4 Jul 25, 2024
9232596
Change line-endings to LF and make consistent
cal4 Jul 26, 2024
0d6a7c4
Update main.py
jdeath Jul 27, 2024
11dc431
Move Read To Earn To Mobile Section (#154)
cal4 Jul 27, 2024
3da1050
Add me as a sponsor option
cal4 Jul 27, 2024
f0a5fa0
Prepare for release and use screaming case for enum constants
cal4 Jul 27, 2024
6cef90c
Add docstrings for enums and config
cal4 Jul 27, 2024
4608d74
Update CHANGELOG.md
cal4 Jul 27, 2024
00d9bd6
Merge remote-tracking branch 'upstream/master' into develop
cal4 Jul 27, 2024
93dd739
Add default session retry config
cal4 Jul 28, 2024
088d6a5
Add default pylint --generate-rcfile
cal4 Jul 28, 2024
4f49fa6
Ignore todos
cal4 Jul 28, 2024
6da84ff
Fix no-else-return
cal4 Jul 28, 2024
8522638
Disable pylint's invalid-name
cal4 Jul 28, 2024
24242f9
Disable pylint's missing function and module docstring
cal4 Jul 28, 2024
909c105
Do a real search versus via url
cal4 Jul 29, 2024
cb9e5b6
Merge branch 'master' into develop
klept0 Jul 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,22 @@ body:
This bug wasn't already reported.
(I have checked every bug report on GitHub)
required: true
- label: |
My code's up-to-date, i.e. I've ran `git pull`.
required: true
- label: |
I've tried the develop branch, `git checkout develop`
required: true
- label: |
I've cleared the sessions folder.
required: true
- label: |
I've tried running with the --visible flag to see what's causing the error.
required: true
- label: |
This bug wasn't already reported.
(I have checked every bug report on GitHub)
required: true
- type: checkboxes
id: title
attributes:
Expand All @@ -25,7 +41,6 @@ body:
id: branch
attributes:
label: Branch
description: Which branch?
options:
- master
- develop
Expand All @@ -36,7 +51,6 @@ body:
id: commit
attributes:
label: Commit
description: Which commit?
placeholder: 5fd7d6c (get using `git rev-parse --short HEAD`)
validations:
required: true
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,6 @@ sessions
logs
runbot.bat
.DS_Store
/google_trends.dat
/google_trends.dir
/google_trends.bak
21 changes: 21 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions .idea/runConfigurations/main.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions .idea/runConfigurations/main_headless.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- Configurable retry strategies: exponential backoff and constant (the default)
- Configurable delay between attempt (default 60 seconds)
- Configurable max attempts before error (default 6)
- Configurable Apprise summary: every run or on error if there's remaining searches after running
- Also configurable as a script parameter that takes precedence (useful for development)
- Some useful JetBrains config
- More logging
- More type hints
- Defaults when getting config

### Changed

- Simplified search logic and made more resilient
- Added assertion that terms were correctly typed
- Persist and read Google trends from disk for a given day (helps get rid of duplicate searches even between different
runs)

### Removed

- Redundant calls to close Chrome
- Calls to close all Chrome processes

### Fixed

- Error when executing script from .bat file #113 Reference paths independent of pwd
- [BUG] AttributeError: 'Browser' object has no attribute 'giveMeProxy' #115 Comment out and todo give me proxy
- When logger is set to debug, doesn't include library code now
- [BUG] SessionNotCreatedException on Mobile Browser Creation #126 Sleep a bit after closing browser so ports are freed
up

## [0.0.0] - 2023-03-05

### Added

- Farmer and lots of other things, but gotta start a changelog somewhere!
43 changes: 18 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
### A "simple" python application that uses Selenium to help with your M$ Rewards

---

![Static Badge](https://img.shields.io/badge/Made_in-python-violet?style=for-the-badge)
![MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=for-the-badge)
![Maintained](https://img.shields.io/badge/Maintained%3F-yes-green.svg?style=for-the-badge)
![GitHub contributors](https://img.shields.io/github/contributors/klept0/MS-Rewards-Farmer?style=for-the-badge)
![GitHub issues](https://img.shields.io/github/issues/klept0/MS-Rewards-Farmer?style=for-the-badge)

---


> [!IMPORTANT]
> If you are multi-accounting and abusing the service for which this is intended - **_DO NOT COMPLAIN ABOUT BANS!!!_**

---


> [!CAUTION]
> Use it at your own risk, M$ may ban your account (and I would not be responsible for it)
Expand All @@ -24,16 +22,12 @@
>
> Do not redeem more than one reward per day.

---

#### Group Chat - [Telegram](https://t.me/klept0_MS_Rewards_Farmer/) (pay attention to captchas - helps prevent spam)

#### Original bot by [@charlesbel](https://github.com/charlesbel) - refactored/updated/maintained by [@klept0](https://github.com/klept0) and a community of volunteers.

#### PULL REQUESTS ARE WELCOME AND APPRECIATED!

---

## Installation

1. Install requirements with the following command :
Expand All @@ -47,13 +41,16 @@

3. (Windows Only) Make sure Visual C++ redistributable DLLs are installed

If they're not, install the current "vc_redist.exe" from this [link](https://learn.microsoft.com/en-GB/cpp/windows/latest-supported-vc-redist?view=msvc-170) and reboot your computer
If they're not, install the current "vc_redist.exe" from
this [link](https://learn.microsoft.com/en-GB/cpp/windows/latest-supported-vc-redist?view=msvc-170) and reboot your
computer

4. Edit the `accounts.json.sample` with your accounts credentials and rename it by removing `.sample` at the end.

The "proxy" field is not mandatory, you can omit it if you don't want to use proxy (don't keep it as an empty string, remove the line completely).
The "proxy" field is not mandatory, you can omit it if you don't want to use proxy (don't keep it as an empty string,
remove the line completely).

- If you want to add more than one account, the syntax is the following:
- If you want to add more than one account, the syntax is the following:

```json
[
Expand All @@ -74,8 +71,6 @@

`python main.py`

---

## Launch arguments

- -v/--visible to disable headless
Expand All @@ -84,22 +79,16 @@

`https://trends.google.com/trends/ for proper geolocation abbreviation for your choice. These MUST be uppercase!!!`

- -p/--proxy to add a proxy to the whole program, supports http/https/socks4/socks5 (overrides per-account proxy in accounts.json)
- -p/--proxy to add a proxy to the whole program, supports http/https/socks4/socks5 (overrides per-account proxy in
accounts.json)

`(ex: http://user:pass@host:port)`

- -cv/--chromeversion to use a specific version of chrome

`(ex: 118)`

---

> [!TIP]
> If you are having issues first ask - did I make sure I have updated all of the files and cleared the sessions folder before running again?

> [!TIP]
> Have I tried to run it with -v so I could see what might be causing the error?
---
[//]: # (todo update)

## Features

Expand All @@ -115,13 +104,17 @@
- Proxy Support (3.0) - they need to be **high quality** proxies
- Logs to CSV file for point tracking

---
## Contributing

Fork this repo and:

> [!NOTE]
> You may see [WARNING] in your logs - this is currently enabled for debugging and to provide in any issues you may need to open
* if providing a bugfix, create a pull request into master.
* if providing a new feature, please create a pull request into develop. Extra points if you update
the [CHANGELOG.md](CHANGELOG.md).

## To Do List (When time permits or someone makes a PR)

- [x] Complete "Read To Earn" (30 pts)
- [ ] Setup flags for mobile/desktop search only
- [ ] Setup flags to load config / save data in working directory
- [ ] Provide Windows Task Scheduler config
6 changes: 6 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# config.yaml
apprise:
summary: on_error
urls:
- 'discord://WebhookID/WebhookToken' # Replace with your actual Apprise service URLs
attempts:
retries:
base_delay_in_seconds: 14.0625 # base_delay_in_seconds * 2^max = 14.0625 * 2^6 = 900 = 15 minutes
max: 8
strategy: exponential
Loading
Loading