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

Error: Can't get google trends; 'AssertionError' #246

Open
2 tasks done
SteveTryndamere opened this issue Dec 15, 2024 · 0 comments
Open
2 tasks done

Error: Can't get google trends; 'AssertionError' #246

SteveTryndamere opened this issue Dec 15, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@SteveTryndamere
Copy link

Before submitting a bug report...

  • This bug wasn't already reported.
    (I have checked every bug report on GitHub)

  • I've cleared the sessions folder.

Branch

develop

Commit

4ff9d79

Describe the bug

i checked the code: status_code=400, requests.codes.ok=200
"400 Bad Request: This HTTP status code indicates that the server could not understand the request due to invalid syntax. The client should not repeat the request without modifications."

Further checked the request:

https://trends.google.com/trends/api/dailytrends?hl=en&ed=20241214&geo=en&ns=15

and found the geo is en, should be 'us' in my case.
Further confirmed by running

from src.browser import Browser
Browser.getLanguageCountry(None,None)
# got ('en', 'en')

bug located:

    @staticmethod
    def getLanguageCountry(language: str, country: str) -> tuple[str, str]:
        if not country:
            country = CONFIG.get("default").get("geolocation")
        if not language:
-            country = CONFIG.get("default").get("language") 
+           language = CONFIG.get("default").get("language") # should be assigned to language instead of overwriting country !!!!!

Copy and paste your error

refer to #206

Screenshots

not applicable

Value of dashboard variable

not applicable

@SteveTryndamere SteveTryndamere added the bug Something isn't working label Dec 15, 2024
SteveTryndamere referenced this issue Dec 15, 2024
#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")
```
SteveTryndamere added a commit to SteveTryndamere/MS-Rewards-Farmer that referenced this issue Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant