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

RFC, Torrent Post Exchange Protocol (Draft) #3

Open
msg7086 opened this issue Dec 27, 2015 · 0 comments
Open

RFC, Torrent Post Exchange Protocol (Draft) #3

msg7086 opened this issue Dec 27, 2015 · 0 comments

Comments

@msg7086
Copy link

msg7086 commented Dec 27, 2015

Purpose

Due to the demands of synchronizing torrent posts between multiple websites, hereby I propose a standard message format to exchange torrent posts between websites.

Exchange Format

JSON is selected as the format container. Any torrent post package must be provided as a valid JSON file, and must use UTF-8 encoding.

Multiple keys are included in the JSON file, as following. All keys are in snake_lower_case.

  • title (string, required)
  • category (hash)
    • dimension (enum(2, 3))
    • series (bool)
    • multi_episodes (bool)
  • series (hash)
    • year (integer)
    • japanese_name (string)
    • english_name (string)
    • local_name (string)
    • anidb (integer)
  • torrent (base64 encoded string, required)
  • torrent_hash (info_hash string, required)
  • content (string, required)
  • content_type (mime string)

title

Title is required. No extra encoding should be applied. XSS filters can be applied before.

category

Category is to determine which category should this post be placed. Dimension is the primary type of the source, i.e. animation as 2-d and film as 3-d. Series is to specify whether this is a multiple-episodes series, or a single episode individual resource. Multi_episodes indicates whether this torrent file contains episodes for a season or a reasonable long period of time, i.e. 12 or 52 episodes.

If not provided, destination site can choose to match by itself, or leave it as "others".

series

Series is to associate a post with its series. By using different names provided, destination site could manage to find a best match, or to create a new record instead.

If not provided, destination site can choose to match by itself, or leave it alone.

torrent

Torrent is the actual content of a torrent file. It must be encoded by base64 before being inserted into this JSON. It must be a valid torrent.

Torrent_hash is the info_hash of the torrent file provided. It is not the hash of the torrent file.

content

Content is the source input of the post with the torrent. It can be filtered before sending out. Content can be in bbcode, markdown, html or other format.

Content_type indicates the format of the post content. Typical values include:

  • text/plain
  • text/markdown
  • text/html
  • text/x-bbcode
  • other

If the content type is not used as a primary type, destination site can choose to convert it into a native primary type, or if not supported at all, consider it as plain text.

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

No branches or pull requests

1 participant