Skip to content

RFC, Torrent Post Exchange Protocol (Draft) #3

Description

@msg7086

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions