Author Topic: TokyoTosho API  (Read 19415 times)

Offline anonymlol

  • Administrator
  • Closet Otaku
  • *****
  • Posts: 3
  • Karma: +0/-0
  • Doki Fansubs
    • View Profile
TokyoTosho API
« on: May 10, 2017, 07:19:50 am »
This has already been implemented, but I'm gonna put this here anyway for archival purposes because it's not available on TokyoTosho anymore (trac/wiki down for years).

Quote
API submissions
===============

API submissions let you submit things from an automated process without using cookies to store your login session. Try to use SSL where possible, anyone with your API secret string can submit stuff as you.
First, you will need to generate an API key for your account. Visit your profile page to view or generate a new one.
A standard HTTP URL encoded POST request to /new.php with your API key in the URL query string with the key value pair, apikey=<your API key>


An example program you can use is cURL, whose command line is like:

curl --data-urlencode "type=5" --data-urlencode "url=http://example.com/test.torrent" --data-urlencode "comment=API test" --data-urlencode "website=https://tokyotosho.info/" --data-urlencode "apikey=123456-asdfasdfasdfasdfasdfasdf" --data-urlencode "send=true" https://www.tokyotosho.info/new.php


TokyoTosho Category IDs (type)
1 : Anime
10: Non-Eng
3 : Manga
8 : Drama
2 : Music
9 : Music Video
7 : Raws
4 : Hentai
12: Hentai (Anime)
13: Hentai (Manga)
14: Hentai (Game)
11: Batch
15: JAV
5 : Other


    type (required, 5 = Other, see other values on the form source code at ?https://www.tokyotosho.info/new.php)
    url (required, URL of your torrent)
    comment (optional, comment for your submission)
    website (optional, website URL)
    apikey (this is your API key shown on your profile page)
    send (required, dummy value for form)

If successful, the website will return the following: OK,idnumber

idnumber is the ID number where it will be located at details.php?id=1234 for example


API deletions
=============

Similar to above, you'll need an API key generated.
A standard HTTP URL encoded POST request to /delete_torrent.php with your API key in the URL query string with the key value pair, apikey=<your API key>

An example program you can use is cURL, whose command line is like:

curl --data-urlencode "torrent_id=123456" --data-urlencode "action=delete" --data-urlencode "apikey=123456-asdfasdfasdfasdfasdfasdf" https://www.tokyotosho.info/delete_torrent.php This has the following POST data:

    torrent_id (The ID number you wish to delete, this is the same value of the URL on the details.php page)
    action (delete or hide)
    apikey (this is your API key shown on your profile page)

If successful, the website will return the following: OK,deleted,torrent_id or OK,hidden,torrent_id