Improve TR log in handling and remove app login code#327
Open
RealCLanger wants to merge 1 commit intopytr-org:masterfrom
Open
Improve TR log in handling and remove app login code#327RealCLanger wants to merge 1 commit intopytr-org:masterfrom
RealCLanger wants to merge 1 commit intopytr-org:masterfrom
Conversation
Collaborator
Author
|
@Felixoid would you mind having a look? |
Felixoid
reviewed
Mar 29, 2026
Contributor
Felixoid
left a comment
There was a problem hiding this comment.
Pretty straightforward changes with improved code. Some minor points to highlight 👍
|
|
||
| def payout(self, amount): | ||
| return self._sign_request("/api/v1/payout", {"amount": amount}).json() | ||
| return requests.request( |
Contributor
There was a problem hiding this comment.
Should it be self._web_request? For other places as well
| if not self._weblogin: | ||
| payload_with_token["token"] = self.session_token | ||
|
|
||
| await ws.send(f"sub {subscription_id} {json.dumps(payload_with_token)}") |
Contributor
There was a problem hiding this comment.
Looks like payload_with_token = payload.copy() is unnecessary now and here json.dumps(payload) can be used
Comment on lines
+149
to
+151
| if not self._waf_token: | ||
| self._waf_token = self._fetch_waf_token() | ||
| self._set_waf_cookie(self._waf_token) |
Contributor
There was a problem hiding this comment.
Suggested change
| if not self._waf_token: | |
| self._waf_token = self._fetch_waf_token() | |
| self._set_waf_cookie(self._waf_token) | |
| if not self._waf_token: | |
| self._waf_token = self._fetch_waf_token() | |
| if self._waf_token: | |
| self._set_waf_cookie(self._waf_token) |
I feel it should be under the condition. self._fetch_waf_token can return None
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.
This PR improves TR log in handling, fixes a few bugs and removes the app login.
In detail: