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

Updates for Current nyaa.si Site #2

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

blacktide082
Copy link

@blacktide082 blacktide082 commented Jul 20, 2021

I have made these changes in my fork and would like to contribute them upstream. There were a couple of issues that made this library unusable in its current state (as you have expected it to break).

  • Problem 1 - CSRF tokens are no longer present anywhere on nyaa.si or sukebei.nyaa.si. This actually makes this library unusable for anything other than searching torrents, as each method fails with a Jsoup exception not being able to find the csrf_token field.
  • Problem 2 - Login is now protected by a Google reCAPTCHA, so login is not working.

This PR adds the following:

  • Deprecates the usage all public API methods related to CSRF tokens.
  • Removes CSRF token from all internal requests and associated private methods.
  • Deprecated the username and password login.
  • Adds a new public login using a user's session cookie directly, which needs to be retrieved by logging in using a browser and retrieving from cookie storage.
  • Adds a new constructor to remove the redundant usage of isSukebei in the NyaaSiAuthApiImpl class and deprecates the old constructor.
  • Resolves an issue with Japanese characters in torrent name and description showing up as ???? on Nyaa's website after calling uploadTorrent.
  • Fix minor spelling issue of sukebei in Session. Deprecate the misspelled method.
  • Updates the examples package to show examples with the new changes.
  • Adds accompanying Gradle files for Java developers that may not have sbt (I added this for my own benefit, but I am willing to remove it if you do not care for this).
  • Resolves the issue from Could not find com.github.aki-ks:kaysub-commons:0.1-SNAPSHOT. #1 in Gradle. I'm not familiar with sbt so I have not fixed the build.sbt file.

I have tested all of the methods in the API and everything is working properly with these changes. Feel free to let me know if you have any questions and I look forward to your review.

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

Successfully merging this pull request may close these issues.

None yet

1 participant