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

Torrents exporter #768

Open
josecelano opened this issue Nov 14, 2024 · 1 comment
Open

Torrents exporter #768

josecelano opened this issue Nov 14, 2024 · 1 comment
Labels
- System Admin - Enjoyable to Install and Setup our Software - User - Enjoyable to Use our Software Easy Good for Newcomers Enhancement / Feature Request Something New

Comments

@josecelano
Copy link
Member

Parent issue: #767

A console command to export the index data (torrents) to a directory in a basic format (no zip).

Proposals are welcome. I will add a simple reference proposal.

cc @da2ce7

@josecelano josecelano added Enhancement / Feature Request Something New Easy Good for Newcomers - User - Enjoyable to Use our Software - System Admin - Enjoyable to Install and Setup our Software labels Nov 14, 2024
@josecelano
Copy link
Member Author

Include Metadata in metainfo file

Here’s a JSON representation of the torrent file with a root-level "metadata" field (outside the "info" dictionary) that won’t affect the info-hash:

JSON Format Example

{
  "announce": "http://tracker.example.com/announce",
  "info": {
    "name": "example_file.mp4",
    "piece length": 524288,
    "pieces": "<binary piece hashes>"
  },
  "metadata": {
    "id": 12345,
    "title": "Sample Torrent Title",
    "description": "This is a **sample description** in basic markdown.",
    "category": "Movies",
    "tags": ["Drama", "Classic", "Public Domain"]
  }
}

Bencoded Format Example

In bencode, the format would look like this:

d8:announce25:http://tracker.example.com/announce
4:info
d4:name12:example_file.mp4
12:piece lengthi524288e
6:pieces<binary piece hashes>e
8:metadata
d2:idi12345e
5:title20:Sample Torrent Title
11:description45:This is a **sample description** in basic markdown.
8:category6:Movies
4:tagsl5:Drama7:Classic12:Public Domaineee

Pros and Cons of This Approach

Pros
  1. Info-Hash Stability: By placing metadata outside the "info" dictionary, you keep the torrent's info-hash unchanged, making it compatible with existing peers.
  2. Non-intrusive Metadata: Other clients that don’t support or require the metadata will still interpret the file as a standard torrent without issue.
  3. Ease of Export/Import: Having a single torrent file with embedded metadata allows seamless export/import across indexes without needing additional files.
Cons
  1. Non-standard Extension: This structure deviates from the traditional BitTorrent specification, so some torrent clients might not recognize or handle the "metadata" field, potentially ignoring it or producing errors.
  2. Compatibility Risks: While the added metadata should be harmless, some older or stricter torrent clients may not fully support it.
  3. Limited Searchability: Since this metadata is only accessible within each torrent file, it won't be easily searchable by torrent clients that lack custom handling for the "metadata" field.

This setup should offer a good balance of usability and compatibility for admins needing to transfer metadata across indexes.

cc @da2ce7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- System Admin - Enjoyable to Install and Setup our Software - User - Enjoyable to Use our Software Easy Good for Newcomers Enhancement / Feature Request Something New
Projects
None yet
Development

No branches or pull requests

1 participant