|
9 | 9 |
|
10 | 10 |
|
11 | 11 | > [!IMPORTANT]
|
12 |
| -> If you are multi-accounting and abusing the service for which this is intended - **_DO NOT COMPLAIN ABOUT BANS!!!_** |
| 12 | +> If you are multi-accounting and abusing the service for which this is intended - * |
| 13 | +*_DO NOT COMPLAIN ABOUT BANS!!!_** |
13 | 14 |
|
14 | 15 |
|
15 | 16 |
|
|
31 | 32 | ## Installation
|
32 | 33 |
|
33 | 34 | 1. Install requirements with the following command :
|
34 |
| - |
35 |
| - `pip install -r requirements.txt` |
| 35 | + ```sh |
| 36 | + pip install -r requirements.txt |
| 37 | + ``` |
36 | 38 |
|
37 | 39 | Upgrade all required with the following command:
|
38 | 40 | `pip install --upgrade -r requirements.txt`
|
|
42 | 44 | 3. (Windows Only) Make sure Visual C++ redistributable DLLs are installed
|
43 | 45 |
|
44 | 46 | If they're not, install the current "vc_redist.exe" from
|
45 |
| - this [link](https://learn.microsoft.com/en-GB/cpp/windows/latest-supported-vc-redist?view=msvc-170) and reboot your |
46 |
| - computer |
47 |
| - |
48 |
| -4. Edit the `accounts.json.sample` with your accounts credentials and rename it by removing `.sample` at the end. |
49 |
| - |
50 |
| - The "totp" field is not mandatory, only enter your TOTP key if you use it for 2FA (if ommitting, don't keep |
51 |
| - it as an empty string, remove the line completely). |
52 |
| - |
53 |
| - 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, |
54 |
| - remove the line completely). |
55 |
| - |
56 |
| - - If you want to add more than one account, the syntax is the following: |
57 |
| - |
58 |
| - ```json |
59 |
| - [ |
60 |
| - { |
61 |
| - "username": "Your Email 1", |
62 |
| - "password": "Your Password 1", |
63 |
| - "totp": "0123 4567 89ab cdef", |
64 |
| - "proxy": "http://user:pass@host1:port" |
65 |
| - }, |
66 |
| - { |
67 |
| - "username": "Your Email 2", |
68 |
| - "password": "Your Password 2", |
69 |
| - "totp": "0123 4567 89ab cdef", |
70 |
| - "proxy": "http://user:pass@host2:port" |
71 |
| - } |
72 |
| - ] |
73 |
| - ``` |
| 47 | + this [link](https://learn.microsoft.com/en-GB/cpp/windows/latest-supported-vc-redist?view=msvc-170) |
| 48 | + and reboot your computer |
74 | 49 |
|
75 |
| -5. Run the script: |
| 50 | +4. Run the script with the following arguments: |
| 51 | + ```sh |
| 52 | + python main.py -C |
| 53 | + ``` |
76 | 54 |
|
77 |
| - `python main.py` |
| 55 | +5. Open the generated `config.yaml` file and edit it with your information. |
78 | 56 |
|
79 |
| -6. (Windows Only) You can set up automatic execution by generating a Task Scheduler XML file. |
| 57 | + The "totp" field is not mandatory, only enter your TOTP key if you use it for 2FA (if |
| 58 | + ommitting, don't keep it as an empty string, remove the line completely). |
80 | 59 |
|
81 |
| - If you are a Windows user, run the `generate_task_xml.py` script to create a `.xml` file. After generating the file, import it into Task Scheduler to schedule automatic execution of the script. This will allow the script to run at the specified time without manual intervention. |
| 60 | + The "proxy" field is not mandatory, you can omit it if you don't want to use proxy (don't |
| 61 | + keep it as an empty string, remove the line completely). |
82 | 62 |
|
83 |
| - To import the XML file into Task Scheduler, see [this guide](https://superuser.com/a/485565/709704). |
| 63 | + You can add or remove accounts according to your will. |
84 | 64 |
|
| 65 | + the "apprise.urls" field is not mandatory, you can remove it if you don't want to get notifications. |
85 | 66 |
|
86 |
| -## Launch arguments |
| 67 | +6. Run the script: |
| 68 | + ```sh |
| 69 | + python main.py |
| 70 | + ``` |
87 | 71 |
|
88 |
| -- `-v/--visible` to disable headless |
89 |
| -- `-l/--lang` to force a language (ex: en) |
90 |
| -- `-g/--geo` to force a searching geolocation (ex: US) |
91 |
| - `https://trends.google.com/trends/ for proper geolocation abbreviation for your choice. These MUST be uppercase!!!` |
92 |
| -- `-p/--proxy` to add a proxy to the whole program, supports http/https/socks4/socks5 (overrides per-account proxy in |
93 |
| - accounts.json) |
94 |
| - `(ex: http://user:pass@host:port)` |
95 |
| -- `-cv/--chromeversion` to use a specific version of chrome |
96 |
| - `(ex: 118)` |
97 |
| -- `-da/--disable-apprise` disables Apprise notifications for the session, overriding [config.yaml](config.yaml). |
98 |
| - Useful when running manually as opposed to on a schedule. |
99 |
| -- `-t/--searchtype` to only do `desktop` or `mobile` searches, `(ex: --searchtype=mobile)` |
| 72 | + (Windows Only) You can also run the script wrapper that will detect your python installation |
| 73 | + and re-run the script if it crashes using `.\MsReward.ps1` (`.\MsReward.ps1 -help` for more |
| 74 | + information). To allow script execution without confirmation, use the following command: |
| 75 | + `Set-ExecutionPolicy RemoteSigned -Scope CurrentUser`. |
| 76 | + |
| 77 | +7. (Windows Only) You can set up automatic execution by generating a Task Scheduler XML file. |
| 78 | + |
| 79 | + If you are a Windows user, run the `generate_task_xml.py` script to create a `.xml` file. |
| 80 | + After generating the file, import it into Task Scheduler to schedule automatic execution of |
| 81 | + the script. This will allow the script to run at the specified time without manual |
| 82 | + intervention. |
| 83 | + |
| 84 | + To import the XML file into Task Scheduler, |
| 85 | + see [this guide](https://superuser.com/a/485565/709704). |
| 86 | + |
| 87 | +## Configuration file |
| 88 | + |
| 89 | +All the variable listed here can be added to you `config.yaml` configuration file, and the values represented here show |
| 90 | +the default ones, if not said otherwise. |
| 91 | + |
| 92 | +```yaml |
| 93 | +# config.yaml |
| 94 | +apprise: # 'apprise' is the name of the service used for notifications https://github.com/caronc/apprise |
| 95 | + enabled: true # set it to false to disable apprise globally, can be overridden with command-line arguments. |
| 96 | + notify: |
| 97 | + incomplete-activity: true # set it to false to disable notifications for incomplete activities |
| 98 | + uncaught-exception: true # set it to false to disable notifications for uncaught exceptions |
| 99 | + login-code: true # set it to false to disable notifications for the temporary M$ Authenticator login code |
| 100 | + summary: ON_ERROR # set it to ALWAYS to always receive a summary about your points progression or errors, or to |
| 101 | + # NEVER to never receive a summary, even in case of an error. |
| 102 | + urls: # add apprise urls here to receive notifications on the specified services : |
| 103 | + # https://github.com/caronc/apprise#supported-notifications |
| 104 | + # Empty by default. |
| 105 | + - discord://{WebhookID}/{WebhookToken} # Exemple url |
| 106 | +browser: |
| 107 | + geolocation: US # Replace with your country code https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2. |
| 108 | + # Detected by default, can be overridden with command-line arguments. |
| 109 | + language: en # Replace with your language code https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes. |
| 110 | + # Detected by default, can be overridden with command-line arguments. |
| 111 | + visible: false # set it to true to show the browser window, can be overridden with command-line arguments. |
| 112 | + proxy: null # set the global proxy using the 'http://user:pass@host:port' syntax. |
| 113 | + # Override per-account proxies. Can be overridden with command-line arguments. |
| 114 | +activities: |
| 115 | + ignore: # list of activities to ignore, like activities that can't be completed |
| 116 | + - Get 50 entries plus 1000 points! |
| 117 | + - Safeguard your family's info |
| 118 | + search: # list of searches to do for search-based activities |
| 119 | + "Black Friday shopping": black friday deals |
| 120 | + "Discover open job roles": jobs at microsoft |
| 121 | + "Expand your vocabulary": define demure |
| 122 | + "Find places to stay": hotels rome italy |
| 123 | + "Find somewhere new to explore": directions to new york |
| 124 | + "Gaming time": vampire survivors video game |
| 125 | + "Get your shopping done faster": new iphone |
| 126 | + "Houses near you": apartments manhattan |
| 127 | + "How's the economy?": sp 500 |
| 128 | + "Learn to cook a new recipe": how cook pierogi |
| 129 | + "Let's watch that movie again!": aliens movie |
| 130 | + "Plan a quick getaway": flights nyc to paris |
| 131 | + "Prepare for the weather": weather tomorrow |
| 132 | + "Quickly convert your money": convert 374 usd to yen |
| 133 | + "Search the lyrics of a song": black sabbath supernaut lyrics |
| 134 | + "Stay on top of the elections": election news latest |
| 135 | + "Too tired to cook tonight?": Pizza Hut near me |
| 136 | + "Translate anything": translate pencil sharpener to spanish |
| 137 | + "What time is it?": china time |
| 138 | + "What's for Thanksgiving dinner?": pumpkin pie recipe |
| 139 | + "Who won?": braves score |
| 140 | + "You can track your package": usps tracking |
| 141 | +logging: |
| 142 | + level: INFO # Set to DEBUG, WARNING, ERROR or CRITICAL to change the level of displayed information in the terminal |
| 143 | + # See https://docs.python.org/3/library/logging.html#logging-levels. Can be overridden with command-line arguments. |
| 144 | +retries: |
| 145 | + base_delay_in_seconds: 120 # The base wait time between each retries. Multiplied by two each try. |
| 146 | + max: 4 # The maximal number of retries to do |
| 147 | + strategy: EXPONENTIAL # Set it to CONSTANT to use the same delay between each retries. |
| 148 | + # Else, increase it exponentially each time. |
| 149 | +cooldown: |
| 150 | + min: 300 # The minimal wait time between two searches/activities |
| 151 | + max: 600 # The maximal wait time between two searches/activities |
| 152 | +search: |
| 153 | + type: both # Set it to 'mobile' or 'desktop' to only complete searches on one plateform, |
| 154 | + # can be overridden with command-line arguments. |
| 155 | +accounts: # The accounts to use. You can put zero, one or an infinite number of accounts here. |
| 156 | + # Empty by default, can be overridden with command-line arguments. |
| 157 | + - email: Your Email 1 # replace with your email |
| 158 | + password: Your Password 1 # replace with your password |
| 159 | + totp: 0123 4567 89ab cdef # replace with your totp, or remove it |
| 160 | + proxy: http://user:pass@host1:port # replace with your account proxy, or remove it |
| 161 | + - email: Your Email 2 # replace with your email |
| 162 | + password: Your Password 2 # replace with your password |
| 163 | + totp: 0123 4567 89ab cdef # replace with your totp, or remove it |
| 164 | + proxy: http://user:pass@host2:port # replace with your account proxy, or remove it |
| 165 | +``` |
| 166 | +
|
| 167 | +## Usage |
| 168 | +
|
| 169 | +``` |
| 170 | +usage: main.py [-h] [-c CONFIG] [-C] [-v] [-l LANG] [-g GEO] [-em EMAIL] [-pw PASSWORD] |
| 171 | + [-p PROXY] [-t {desktop,mobile,both}] [-da] [-d] |
| 172 | + |
| 173 | +A simple bot that uses Selenium to farm M$ Rewards in Python |
| 174 | + |
| 175 | +options: |
| 176 | + -h, --help show this help message and exit |
| 177 | + -c CONFIG, --config CONFIG |
| 178 | + Specify the configuration file path |
| 179 | + -C, --create-config Create a fillable configuration file with basic settings and given |
| 180 | + ones if none exists |
| 181 | + -v, --visible Visible browser (Disable headless mode) |
| 182 | + -l LANG, --lang LANG Language (ex: en) see https://serpapi.com/google-languages for options |
| 183 | + -g GEO, --geo GEO Searching geolocation (ex: US) see https://serpapi.com/google-trends- |
| 184 | + locations for options (should be uppercase) |
| 185 | + -em EMAIL, --email EMAIL |
| 186 | + Email address of the account to run. Only used if a password is given. |
| 187 | + -pw PASSWORD, --password PASSWORD |
| 188 | + Password of the account to run. Only used if an email is given. |
| 189 | + -p PROXY, --proxy PROXY |
| 190 | + Global Proxy, supports http/https/socks4/socks5 (overrides config per- |
| 191 | + account proxies) `(ex: http://user:pass@host:port)` |
| 192 | + -t {desktop,mobile,both}, --searchtype {desktop,mobile,both} |
| 193 | + Set to search in either desktop, mobile or both (default: both) |
| 194 | + -da, --disable-apprise |
| 195 | + Disable Apprise notifications, useful when developing |
| 196 | + -d, --debug Set the logging level to DEBUG |
| 197 | + |
| 198 | +At least one account should be specified, either using command line arguments or a |
| 199 | +configuration file. All specified arguments will override the configuration file values |
| 200 | +``` |
| 201 | + |
| 202 | +You can display this message at any moment using `python main.py -h`. |
100 | 203 |
|
101 | 204 | ## Features
|
102 | 205 |
|
|
108 | 211 | - Multi-Account Management
|
109 | 212 | - Session storing
|
110 | 213 | - 2FA Support
|
111 |
| -- Notifications via [Apprise](https://github.com/caronc/apprise) - no longer limited to Telegram or Discord |
| 214 | +- Notifications via [Apprise](https://github.com/caronc/apprise) - no longer limited to |
| 215 | + Telegram or Discord |
112 | 216 | - Proxy Support (3.0) - they need to be **high quality** proxies
|
113 | 217 | - Logs to CSV file for point tracking
|
114 | 218 |
|
|
117 | 221 | Fork this repo and:
|
118 | 222 |
|
119 | 223 | * if providing a bugfix, create a pull request into master.
|
120 |
| -* if providing a new feature, please create a pull request into develop. Extra points if you update |
121 |
| - the [CHANGELOG.md](CHANGELOG.md). |
| 224 | +* if providing a new feature, please create a pull request into develop. Extra points if you |
| 225 | + update the [CHANGELOG.md](CHANGELOG.md). |
122 | 226 |
|
123 | 227 | ## To Do List (When time permits or someone makes a PR)
|
124 | 228 |
|
|
0 commit comments