Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR updates the Iber client to use mobile-specific headers and sends the login payload as a JSON list rather than a raw string.
- Replaced desktop headers with mobile-focused headers (iOS user-agent and app flags)
- Transformed
login_datafrom a formatted string to a Python list - Switched the request call to use
json=login_datainstead ofdata
Comments suppressed due to low confidence (2)
oligo/requests/iber.py:59
- An extra empty string is appended at the end of
login_data. Confirm that the API expects this trailing element; otherwise, it may cause login failures.
"",
oligo/requests/iber.py:31
- Since you're using
json=login_data,requestswill set theContent-Typeheader automatically. You can remove this manual header to avoid redundancy.
"Content-Type": "application/json; charset=utf-8",
Comment on lines
+49
to
+60
| login_data = [ | ||
| user, | ||
| password, | ||
| "", | ||
| "Android 6.0", | ||
| "Móvil", | ||
| "Chrome 119.0.0.0", | ||
| "0", | ||
| "", | ||
| "s", | ||
| "", | ||
| ] |
There was a problem hiding this comment.
[nitpick] The login_data list relies on positional elements without documentation. Consider adding a comment describing each field or encapsulating this in a helper to clarify the payload structure.
Suggested change
| login_data = [ | |
| user, | |
| password, | |
| "", | |
| "Android 6.0", | |
| "Móvil", | |
| "Chrome 119.0.0.0", | |
| "0", | |
| "", | |
| "s", | |
| "", | |
| ] | |
| login_data = self.__create_login_payload(user, password) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix login using mobile headers like https://github.com/ldotlopez/ideenergy
Fixes #46