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

1.2.0 #208

Draft
wants to merge 88 commits into
base: master
Choose a base branch
from
Draft

1.2.0 #208

wants to merge 88 commits into from

Conversation

cal4
Copy link
Collaborator

@cal4 cal4 commented Sep 14, 2024

No description provided.

OmegaBlurz and others added 30 commits September 3, 2024 09:36
added self.activities.dashboardPopUpModalCloseCross()
Added:
     def click_element_if_visible(self, element):
        try:
            if element.is_displayed() and element.is_enabled():
                element.click()
                logging.info("Dashboard pop-up registered and closed, needs to be done once on new accounts")
            else:
                pass
        except (ElementNotInteractableException, NoSuchElementException):
            pass

    def dashboardPopUpModalCloseCross(self):
        try:

            element = self.webdriver.find_element(By.CSS_SELECTOR, ".dashboardPopUpPopUpSelectButton")
            self.click_element_if_visible(element)
            time.sleep(0.25)
        except NoSuchElementException:
            return


-goodluck
Lock/Bann checked after Login.
some cross on its way to pop gets accepted and never comes back (very
sad story)

idk if its added already or not, i was told to create something

if its to late - delete it.

-goodluck
Added configuration to set the logger level in config
Also configs for toggling incomplete promotions and exceptions from apprise notifications
Added chrome option --disable-http2 as suggested in (#185)
I've added #195 and
#194, in the process i
realized having both config-private.yaml and config.yaml was
unnecessary, so now config.yaml is automatically ignored and only
config.yaml.sample should be committed, the user should manually rename
the file after configuring it as instructed in the updated README

I was getting the same problem as #185 so i tried using the
--disable-http2 flag and it seems to have fixed the issue

i've also kinda fixed the ipapi ratelimited, it will still happen but
now it instead of always using US as the default it will use the user
configured country code, this does not block searches anymore for that
day, the language is useless since its just the browser language,
default will still be 'en'
Couple more again, tried to get another called "Find somewhere new to explore" but I couldn't get it to trigger.
(cherry picked from commit 33ee0e6)
(cherry picked from commit a0a9651)
Few more promos, also tried to get the one below but couldn't figure out
what it wanted.

![image](https://github.com/user-attachments/assets/17ab4e71-7bf9-4087-abd5-4b7969669b74)
Moved the (still WIP) Docker Implementation PR from @charlesbel's repo.

Old discussion can be found
[here](charlesbel#431).

Currently it supports two environmental variables:

- `RUN_ONCE`: if set to `true`, runs the script once and then quits
- `CRON_SCHEDULE`: you can supply a valid cron schedule, or by default
it will just run daily at 4 AM.

Builds can be auto-triggered (GitHub Actions) by setting a tag to the
commits.

TODO:

- [ ] Pass command line options to the script
- [ ]  ??? (Suggestions are very much welcomed!)
edited some wording on apprise notification
@adgwfs
Copy link

adgwfs commented Nov 5, 2024

I also get AttributeError: alpha_2 on Debian 12 and not in a docker

Yeah this'll need to be fixed. Shouldn't be too tough but haven't bothered with it and hoping/inviting someone facing the issue to fork this and put up a fix.

In my case, currentLocale returns ('Chinese (Traditional)_Taiwan', '950')
it will raise AttributeError: alpha_2 since both Chinese (Traditional) and Taiwan is not in the list ISO 639-3 / ISO_3166-1

so i have to set like currentLocale = ["Chinese_Taiwan, Province of China"] or something
and it will be ok... at least on AttributeError: alpha_2 problem

but i got another error

Traceback (most recent call last):
  File "C:\Users\user\Downloads\MS-Rewards-Farmer-develop\MS-Rewards-Farmer-develop\main.py", line 39, in main
    earned_points = executeBot(currentAccount, args)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\Downloads\MS-Rewards-Farmer-develop\MS-Rewards-Farmer-develop\main.py", line 246, in executeBot
    searches.bingSearches()
  File "C:\Users\user\Downloads\MS-Rewards-Farmer-develop\MS-Rewards-Farmer-develop\src\searches.py", line 110, in bingSearches
    desktopAndMobileRemaining = self.browser.getRemainingSearches(
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\Downloads\MS-Rewards-Farmer-develop\MS-Rewards-Farmer-develop\src\browser.py", line 283, in getRemainingSearches
    pcSearch: dict = counters["PCSearch"][0]
                     ~~~~~~~~^^^^^^^^^^^^
KeyError: 'PCSearch'

and the following is my counters:

{
    "ActivityAndQuiz": [
        {
            "name": None,
            "priority": 0,
            "isRewardable": False,
            "activityType": None,
            "hash": None,
            "attributes": None,
            "offerId": "",
            "complete": False,
            "activityProgress": 0,
            "activityProgressMax": 0,
            "pointProgressMax": 0,
            "pointProgress": 0,
            "promotionType": "",
            "promotionSubtype": "",
            "title": "",
            "description": "",
            "showcaseTitle": "",
            "showcaseDescription": "",
            "imageUrl": "",
            "smallImageUrl": "",
            "backgroundImageUrl": "",
            "showcaseBackgroundImageUrl": "",
            "showcaseBackgroundLargeImageUrl": "",
            "iconUrl": "",
            "animatedIconUrl": "",
            "animatedLargeBackgroundImageUrl": "",
            "destinationUrl": "",
            "linkText": "",
            "isRecurring": False,
            "isHidden": False,
            "level": "",
            "slidesCount": 0,
            "legalText": "",
            "legalLinkText": "",
            "machineTranslation": "",
            "showUnsupportedLangNote": "",
            "target": "",
            "rewardable": False,
            "exclusiveLockedFeatureType": "notsupported",
            "exclusiveLockedFeatureStatus": "notsupported",
            "shouldScrollToTarget": False,
            "inProgress": ""
        }
    ],
    "DailyPoint": [
        {
            "name": None,
            "priority": 0,
            "isRewardable": False,
            "activityType": None,
            "hash": None,
            "attributes": None,
            "offerId": "",
            "complete": False,
            "activityProgress": 0,
            "activityProgressMax": 0,
            "pointProgressMax": 0,
            "pointProgress": 0,
            "promotionType": "",
            "promotionSubtype": "",
            "title": "",
            "description": "",
            "showcaseTitle": "",
            "showcaseDescription": "",
            "imageUrl": "",
            "smallImageUrl": "",
            "backgroundImageUrl": "",
            "showcaseBackgroundImageUrl": "",
            "showcaseBackgroundLargeImageUrl": "",
            "iconUrl": "",
            "animatedIconUrl": "",
            "animatedLargeBackgroundImageUrl": "",
            "destinationUrl": "",
            "linkText": "",
            "isRecurring": False,
            "isHidden": False,
            "level": "",
            "slidesCount": 0,
            "legalText": "",
            "legalLinkText": "",
            "machineTranslation": "",
            "showUnsupportedLangNote": "",
            "target": "",
            "rewardable": False,
            "exclusiveLockedFeatureType": "notsupported",
            "exclusiveLockedFeatureStatus": "notsupported",
            "shouldScrollToTarget": False,
            "inProgress": ""
        }
    ]
}

@cal4
Copy link
Collaborator Author

cal4 commented Nov 6, 2024

Yeah the locale problem isn't a difficult fix (but is why this PR is a draft and not being merged to master, yet). I'm just not affected by it and don't care enough to fix it, tbh. I invite someone that is affected to fork and fix.

The KeyError: 'PCSearch' is an existing issue that has been exposed by the increased amount of calls to getRemainingSearches (which solves other problems). I've seen it crop up intermittently but don't have a good idea why it occurs occasionally.

@jdeath
Copy link

jdeath commented Nov 7, 2024

It does crop up, but usually goes away. I have worked around it by changing to below code. Could check if PCSearch key is there, and if not, switch to this logic,

        userStatus = self.utils.getDashboardData()["userStatus"]
        searchPoints = 1
        counters = userStatus["counters"]
        pcSearch: dict = counters["pcSearch"][0]
        mobileSearch: dict = counters["mobileSearch"][0]
        pointProgressMax: int = pcSearch["pointProgressMax"]

cal4 and others added 5 commits December 8, 2024 21:09
#237)

1. keyError in getEdgeVersions
Looks like users "randomly" get response json with capitalized or
uncapitalized key.
Thus, add temp function to ignore the capitalization.

3. Key Error in `getLanguageCountry()` country in config.yaml is using
key 'geolocation', while it's fetched by the wrong key 'location'
```yaml
default:
  geolocation: US # Replace with your country code https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
```
```python
@staticmethod
def getLanguageCountry(language: str, country: str) -> tuple[str, str]:
    if not country:
        country = CONFIG.get("default").get("location")
```
Allows to enhance CLI & scripting experience with this project.

For example, can be used for re-launch the program automatically if it
failed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.