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

Set Favorite Market #9

Open
Griffsano opened this issue Oct 14, 2023 · 1 comment
Open

Set Favorite Market #9

Griffsano opened this issue Oct 14, 2023 · 1 comment

Comments

@Griffsano
Copy link

Hi,

thanks for providing this nice package.
With feature #7 it's possible to automatically activate all coupons available to all markets. However, there may be coupons that are only available to the selected favorite market. In the app, this favorite market can be selected under settings.

Without setting a favorite market, the first part of the response of LidlPlusApi.coupons() looks like this: {'name': 'FavoriteStore', 'coupons': []}
To automatically enable the coupons for the favorite market as well, it would be nice to support the selection of the favorite market per API.

By the way, in case someone runs into the same problem:
Some LIDL coupon names are not UTF-8 compliant. This may lead to such an error when printing the coupon name:
UnicodeEncodeError: 'latin-1' codec can't encode character '\u20ac' in position 1120: ordinal not in range(256)
Therefore, it might be worth sanitizing the string before using it further. For me, the following encoding of the string worked:
coupon["title"].encode('utf8', 'ignore')

@Woyken
Copy link
Contributor

Woyken commented Feb 9, 2024

I'm just going to leave these here, maybe someone will decide to implement:

Get available stores for {country}

GET https://stores.lidlplus.com/api/v2/{country}

Lidl-Plus application does both of these requests when you change your favorite store:

Update user's favorite store

PUT https://stores.lidlplus.com/api/v1/users/me/favorite/{country}
{
  "country": "LT",
  "storeKey": "LT0218"
}
Update user country info, with favorite store

POST https://profile.lidlplus.com/profile/api/v1/updateCountryInfo
{
  "country_code": "LT",
  "language": "LT",
  "store_id": "LT0218"
}

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

No branches or pull requests

2 participants