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

Adding action=user_torrents #99

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kbuffington
Copy link

Adding new AJAX end point: user_torrents. This allows the retrieval of the torrents and primary artists for the torrents a user is seeding from one of the four types: seeding, leeching, uploaded, snatched. Results are ordered starting with most-recent first. This replicates the data available from torrents.php with a type and userid specified.

The end point properly handles paranoia settings for non-logged in users.

Required variables:
userid: the user to retrieve torrent information for
type: seeding, leeching, uploaded, snatched

Optional
limit, offset

An example request and response:

// https://what.cd/ajax.php?action=user_torrents&userid=2&type=seeding&limit=3&offset=1

{
  "status": "success",
  "response": {
    "seeding": [
      {
        "groupId": "4",
        "name": "If You Have Ghost",
        "torrentId": "4",
        "artistName": "Ghost B.C.",
        "artistId": "4"
      },
      {
        "groupId": "3",
        "name": "Absolute Dissent",
        "torrentId": "3",
        "artistName": "Killing Joke",
        "artistId": "3"
      }
    ]
  }
}

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.

1 participant