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

Refactoring, fixes and some new features #120

Closed
wants to merge 74 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
74 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
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
Prev Previous commit
Next Next commit
Restore original defaults
cal4 committed Jun 18, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit a9cb94983c20af49b20561cf5cf255b93d498dfa
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
@@ -254,7 +254,7 @@ def executeBot(currentAccount: Account, args: argparse.Namespace):
logging.info(
f"[POINTS] You are now at {utils.formatNumber(accountPointsCounter)} points !"
)
appriseSummary = AppriseSummary[utils.config.get("apprise", {}).get("summary", AppriseSummary.on_error.name)]
appriseSummary = AppriseSummary[utils.config.get("apprise", {}).get("summary", AppriseSummary.always.name)]
if appriseSummary == AppriseSummary.always:
goalNotifier = ""
if goalPoints > 0:
2 changes: 1 addition & 1 deletion src/searches.py
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ class Searches:
maxAttempts: int = config.get("attempts", {}).get("max", 6)
baseDelay: int = config.get("attempts", {}).get("base_delay_in_seconds", 60)
attemptsStrategy = AttemptsStrategy[
config.get("attempts", {}).get("strategy", AttemptsStrategy.exponential.name)
config.get("attempts", {}).get("strategy", AttemptsStrategy.constant.name)
]
searchTerms: list[str] | None = None