Torrent Parse
AI-generatedOverview
This node parses a torrent file provided either as a base64 encoded string or as a file path. It extracts key information from the torrent file such as the infohash, magnet URI, torrent name, file list, and tracker details. This node is useful in workflows where torrent metadata needs to be extracted for further processing, such as generating magnet links, analyzing torrent contents, or integrating torrent data into other systems.
Use Case Examples
- Parsing a base64 encoded torrent file content to extract its metadata and generate a magnet URI.
- Reading a torrent file from a specified file path to retrieve the list of files and trackers included in the torrent.
Properties
| Name | Meaning |
|---|---|
| Input Type | Specifies the type of input to parse, either a base64 encoded string or a file path. |
| Base64 Content | The base64 encoded torrent file content to parse. Only used if Input Type is 'Base64'. |
| File Path | The path to the torrent file to parse. Only used if Input Type is 'File Path'. |
Output
JSON
success- Indicates if the torrent parsing was successful.infohash- The infohash of the torrent in uppercase hexadecimal format.magnet_uri- The generated magnet URI string based on the torrent metadata.dn- The display name (name) of the torrent.xl- The total length (size) of the torrent content in bytes.main_tracker- The main tracker URL from the torrent announce field.tracker_list- An array of tracker URLs included in the torrent announce-list.is_private- Boolean indicating if the torrent is marked as private.files- An array of file objects with path and length properties representing the files in the torrent.
Dependencies
- Node.js 'fs' module for file system access
- Node.js 'path' module for resolving file paths
Troubleshooting
- If the input is not a valid base64 string or file path, the node will throw an error indicating invalid input or file not found.
- If the torrent file content is not a valid torrent file, the node will return an error indicating 'invalid torrent file'.
- Ensure the file path is accessible and correct when using the 'File Path' input type.
- If the node is set to continue on fail, errors will be returned in the output JSON under the 'error' property for each failed item.