Introducing a new way to review your PRs.

Read the announcement

transmission-remote-gui / transgui

🧲 A feature rich cross platform Transmission BitTorrent client. Faster and has more functionality than the built-in web GUI.

View on GitHub

19 documents · Updated Sep 25, 2026

docs / torrent-intake

Torrent intake

Torrent intake is the path that turns a local torrent file or a torrent link into a torrent managed by Transmission. It accepts files, HTTP(S) URLs, magnet links, and supported hash values, then lets the user choose the download location and wanted content before it starts the torrent.

This page is a child of Torrent workflows. For the later property and location flow, see Torrent details and location. Tracker changes are covered in Tracker management, while HTTP retrieval and bencode decoding are described in Remote downloads and bencode.

Intake sources

Local torrent files

A local .torrent file enters the same add flow as a link. The client reads the file and sends its metainfo to Transmission. This lets the add step use the file contents even when the torrent file is on the computer running the remote GUI rather than on the Transmission host. (main.pas#L2738-L2757)

Users can choose one or more local files from the add command. The application also accepts a file passed at startup or handed off by another running instance. A configured watch folder can add local .torrent files without a separate user action. (main.pas#L2357-L2362, main.pas#L1230-L1255, main.pas#L1348-L1352, main.pas#L1053-L1064)

References: main.pas• L2357-2362 main.pas• L2738-2757 main.pas• L1230-1255 main.pas• L1348-1352 main.pas• L1053-1064

The link dialog accepts a URL for a .torrent file or a magnet link. The client supports http:, https:, and magnet: values. A 40-character hexadecimal hash or a valid 32-character base32 hash is turned into a BitTorrent magnet link before submission. (addlink.lfm#L47-L61, main.pas#L1174-L1189, main.pas#L2422-L2435, main.pas#L1037-L1051)

The link value remains a link when the client sends the initial add request. Transmission then obtains the torrent from that link. The client may also fetch an HTTP(S) torrent file locally so it can inspect its trackers and reconcile them with an existing torrent. (main.pas#L2504-L2513, main.pas#L2632-L2641)

References: addlink.lfm• L47-61 main.pas• L1174-1189 main.pas• L2422-2435 main.pas• L1037-1051 main.pas• L2504-2513 main.pas• L2632-2641

Optional clipboard monitoring turns a new single-line magnet link, .torrent URL, or supported hash into a pending intake item. It ignores empty text, multi-line text, unsupported protocols, and the same clipboard value after it has already been seen. The setting is off by default and can be changed in the interface preferences. (main.pas#L1191-L1228, main.pas#L2288-L2304, main.pas#L2332-L2337, main.pas#L8399-L8427)

The pending item waits until the normal add queue can process it. This prevents clipboard changes from starting an add while another torrent is being configured. (main.pas#L8360-L8388)

References: main.pas• L1191-1228 main.pas• L2288-2304 main.pas• L2332-2337 main.pas• L8360-8388 main.pas• L8399-8427

Add flow

Source acquisition

Source acquisition prepares enough data for Transmission and for the add choices. A local file is read as metainfo. An HTTP(S) source is downloaded to a temporary torrent file when the client needs to inspect it. A magnet link has no file contents at this point, so Transmission must obtain its metadata before the file list is available. (main.pas#L2504-L2558, main.pas#L2738-L2757)

HTTP(S) retrieval shows progress and supports cancellation. A failed or cancelled retrieval does not leave the temporary torrent file as a usable input. The shared download service also uses the configured RPC proxy when one is present. (download.pas#L91-L123, download.pas#L127-L189, download.pas#L203-L215)

References: main.pas• L2504-2558 main.pas• L2738-2757 download.pas• L91-123 download.pas• L127-189 download.pas• L203-215

Metadata and tracker preparation

After the initial add, the client requests the torrent name, file list, peer limit, and metadata completion state. It uses this state to show file choices for a normal torrent and to treat an incomplete magnet as a metadata-pending torrent. (main.pas#L2828-L2865)

For a new torrent, the client can read tracker information from a magnet link or from the torrent metainfo. If the torrent already exists, it detects the duplicate and offers to add trackers that are not already present. This duplicate path changes tracker data without creating a second torrent. (main.pas#L2444-L2473, main.pas#L2474-L2553, main.pas#L2560-L2621, main.pas#L2642-L2656)

References: main.pas• L2828-2865 main.pas• L2444-2473 main.pas• L2474-2553 main.pas• L2560-2621 main.pas• L2642-2656

Add choices

The add window collects the remote download folder and the choices that affect the new torrent. It can show the torrent contents as a file tree, which lets the user select wanted files and see the selected size. The user can also set a peer limit and choose whether the torrent starts after the add. (addtorrent.lfm#L19-L124, addtorrent.lfm#L205-L317, addtorrent.pas#L1029-L1049, main.pas#L2802-L2824)

The window normally starts with all files selected. A watch-folder add skips the prompt and uses its configured destination. The client checks free space when the connected Transmission version supports that query. (addtorrent.pas#L899-L920, addtorrent.pas#L1051-L1069, addtorrent.pas#L1117-L1147, main.pas#L2759-L2797, main.pas#L2868-L2875)

References: addtorrent.lfm• L19-124 addtorrent.lfm• L205-317 addtorrent.pas• L1029-1049 addtorrent.pas• L899-920 addtorrent.pas• L1051-1069 addtorrent.pas• L1117-1147 main.pas• L2759-2797 main.pas• L2802-2824 main.pas• L2868-2875

Transmission handoff

Initial torrent-add request

The client sends a torrent-add RPC request with the source and the chosen download folder. It keeps the new torrent paused during setup so that file selection, peer limits, and the optional name change can be applied before download activity begins. (main.pas#L2628-L2662, main.pas#L2802-L2824)

The source form determines the request data:

SourceData sent to Transmission
Local torrent fileBase64-encoded torrent metainfo in metainfo
HTTP(S) torrent URLThe URL in filename
Magnet link or normalized hashThe link in filename

Transmission returns the new torrent ID. If it reports a duplicate, the client follows the tracker update path instead of treating the add as a new torrent. (main.pas#L2632-L2662, main.pas#L2738-L2757)

References: main.pas• L2628-2662 main.pas• L2738-2757 main.pas• L2802-2824

Post-add settings

Once Transmission accepts the source, the client sends a torrent-set request for the peer limit and the wanted file set. It sends files-wanted for selected files and files-unwanted for files the user did not select. A changed display name is sent as a separate path rename. (main.pas#L2882-L2959)

If the user changes the destination after the first add, the client removes the paused torrent and adds it again with the new folder before applying the remaining choices. This keeps the final torrent tied to the selected remote path. (main.pas#L2888-L2900)

References: main.pas• L2882-2959

Start and completion

The torrent stays paused until setup succeeds. If the user selected Start torrent, the client sends torrent-start; otherwise the new torrent remains paused for a later action. The client then selects the torrent in the main list and refreshes its state. (main.pas#L2802-L2806, main.pas#L2964-L2967)

The original local torrent file can be removed after a successful add when deletion is enabled. Watch-folder inputs are removed as part of their automatic intake. A remotely fetched temporary file is removed after inspection rather than after the final Transmission request. (main.pas#L2550-L2558, main.pas#L2970-L2982)

References: main.pas• L2550-2558 main.pas• L2964-2982

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep the accepted source forms aligned across the link dialog, startup handoff, clipboard normalization, and torrent-add source selection.
  • Preserve the distinction between local metainfo sent as metainfo and remote or magnet sources sent as filename.
  • Keep the paused setup order intact when changing download folder, wanted files, peer limit, rename, or start behavior.
  • Keep temporary remote-file cleanup separate from optional deletion of the user’s local torrent file.
  • Keep duplicate handling linked to tracker reconciliation so a repeated add does not create an unintended second torrent.

Important failure modes

TriggerConsequenceGuard
HTTP(S) retrieval fails or is cancelledThe add flow stops and the incomplete temporary file is removed.Download progress reports failure and DoAddTorrent exits before submission.
The source is not a supported link or readable local fileNo valid torrent reaches Transmission.Input checks reject unsupported protocols and unreadable files.
A magnet has no metadata yetThe add window cannot show a file list or apply file selection at that time.The client detects incomplete metadata and hides the contents section.
The selected remote folder changes after the first addThe first paused torrent points at the wrong folder.The client removes and re-adds the paused torrent before final settings.
Transmission reports a duplicateA new torrent is not created.The client offers tracker reconciliation for the existing torrent.
The RPC connection fails during add setupThe torrent may not be fully configured.The client reports RPC status and removes the temporary paused add when possible.

Key files

FileWhy to read it
main.pasCoordinates every intake source, the add queue, source preparation, Transmission requests, duplicate handling, and cleanup.
addtorrent.pasDefines the user choices for destination, file selection, peer limit, and start state.
addtorrent.lfmShows the add window’s user-facing controls and the content-selection surface.
addlink.pasValidates the direct link entry before the main intake flow handles it.
addlink.lfmShows the supported link-entry prompt for torrent URLs and magnet links.
download.pasProvides cancellable HTTP(S) acquisition with progress reporting for link-based intake.
bencode.pasProvides the torrent metainfo reader used when the client inspects torrent files and tracker data.