Conversation
| def get_login_form_data(self, login: str, password: str) -> dict: | ||
| """Returns a dictionary with data to be pushed to authorization form.""" | ||
| return {'login_username': login, 'login_password': password, 'login': 'pushed', 'redirect': 'index.php'} | ||
| return {'login_username': login, 'login_password': password, 'login': '%E2%F5%EE%E4'} |
There was a problem hiding this comment.
- Let's try to set
logindirectly toвходvalue (%E2%F5%EE%E4iswin-1251-urlencoded). Yet, it's strange they'd started to verify the value. - Also
redirectparameter should be just fine.
There was a problem hiding this comment.
I captured the login form data using Safari's inspector on a Mac. The login value is provided as-is, and no redirect field was present. Using "вход" in UTF-8 likely won't work if the backend expects CP1251, and hardcoding CP1251 into a Python script that defaults to UTF-8 doesn't seem ideal. Of course, utf8 вход can be converted into cp1251 before encoding into form but this would inflate code size for no good reason.
There was a problem hiding this comment.
and no redirect field was present.
I suspect this can be related to a referer header. Anyway, if this param breaks nothing I propose leaving in intact.
but this would inflate code size for no good reason.
Then we need at least a hint near that value: a hint about cp1251 вход.
There was a problem hiding this comment.
redirect is dead code these days, misleading that it is being used. Let me know if you still think that it should remain in codebase.
|
This is incomplete fix, download link doesn't work with "Unable to get torrent from" The page it navigates to is "Just a moment..." |
|
I have updated implementation, verified end to end, can login and download links. Also fixed tests. No very confident regarding github action configuration - reference to coveralls looks dead and unused, also not sure what coverage report is needed (what to print on stdout). |
Rutracker support has stopped recently with 403. The fix is trivial - update login form content to match new version.
In addition to that, cloudflare is breaking the process, so have to pull cloudscraper that helps to avoid being detected as robot.
Also fixed tox configuration (verified to pass on 3.9-3.13 pythons on Mac).
Github integration is not tested, best effort fix.