2022-10-18 22:39:32 -04:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="${LANG}">
|
|
|
|
|
|
|
|
<head>
|
2024-10-03 08:37:11 -04:00
|
|
|
<meta charset="UTF-8">
|
2022-11-30 13:49:48 -05:00
|
|
|
<title>Upload local torrent</title>
|
2024-10-03 08:37:11 -04:00
|
|
|
<link rel="stylesheet" href="css/style.css?v=${CACHEID}" type="text/css">
|
|
|
|
<link rel="stylesheet" href="css/Window.css?v=${CACHEID}" type="text/css">
|
2022-10-18 22:39:32 -04:00
|
|
|
<script src="scripts/lib/MooTools-Core-1.6.0-compat-compressed.js"></script>
|
|
|
|
<script src="scripts/download.js?v=${CACHEID}"></script>
|
2024-10-03 08:37:11 -04:00
|
|
|
<script src="scripts/pathAutofill.js?v=${CACHEID}"></script>
|
2022-10-18 22:39:32 -04:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
2024-01-07 17:04:03 -05:00
|
|
|
<iframe id="upload_frame" name="upload_frame" class="invisible" title="" src="about:blank"></iframe>
|
2022-10-18 22:39:32 -04:00
|
|
|
<form action="api/v2/torrents/add" enctype="multipart/form-data" method="post" id="uploadForm" style="text-align: center;" target="upload_frame" autocorrect="off" autocapitalize="none">
|
|
|
|
<div style="margin-top: 25px; display: inline-block; border: 1px solid lightgrey; border-radius: 4px;">
|
2024-10-03 08:37:11 -04:00
|
|
|
<input type="file" id="fileselect" accept=".torrent, application/x-bittorrent" name="fileselect[]" multiple aria-label="Select .torrent files">
|
2022-10-18 22:39:32 -04:00
|
|
|
</div>
|
|
|
|
<fieldset class="settings" style="border: 0; text-align: left; margin-top: 12px;">
|
2024-10-03 08:37:11 -04:00
|
|
|
<legend>Torrent options</legend>
|
2022-10-18 22:39:32 -04:00
|
|
|
<table style="margin: auto;">
|
2024-10-03 08:37:11 -04:00
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<label for="autoTMM">Torrent Management Mode:</label>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<select id="autoTMM" name="autoTMM" onchange="qBittorrent.Download.changeTMM(this)">
|
|
|
|
<option selected value="false">Manual</option>
|
|
|
|
<option value="true">Automatic</option>
|
2022-10-18 22:39:32 -04:00
|
|
|
</select>
|
2024-10-03 08:37:11 -04:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<label for="savepath">Save files to location:</label>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<input type="text" id="savepath" name="savepath" class="pathDirectory" style="width: 16em;">
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<label for="rename">Rename torrent</label>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<input type="text" id="rename" name="rename" style="width: 16em;">
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<label id="categoryLabel" for="categorySelect">Category:</label>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<div class="select-watched-folder-editable">
|
|
|
|
<select id="categorySelect" onchange="qBittorrent.Download.changeCategorySelect(this)">
|
|
|
|
<option selected value="\other"></option>
|
|
|
|
</select>
|
|
|
|
<input type="text" name="category" aria-labelledby="categoryLabel">
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<label for="startTorrent">Start torrent</label>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<input type="hidden" id="startTorrentHidden" name="stopped">
|
|
|
|
<input type="checkbox" id="startTorrent">
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<label for="addToTopOfQueue">Add to top of queue</label>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<input type="checkbox" id="addToTopOfQueue" name="addToTopOfQueue" value="true">
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<label for="stopCondition">Stop condition:</label>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<select id="stopCondition" name="stopCondition">
|
|
|
|
<option selected value="None">None</option>
|
|
|
|
<option value="MetadataReceived">Metadata received</option>
|
|
|
|
<option value="FilesChecked">Files checked</option>
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<label for="skip_checking">Skip hash check</label>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<input type="checkbox" id="skip_checking" name="skip_checking" value="true">
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<label for="contentLayout">Content layout:</label>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<select id="contentLayout" name="contentLayout">
|
|
|
|
<option selected value="Original">Original</option>
|
|
|
|
<option value="Subfolder">Create subfolder</option>
|
|
|
|
<option value="NoSubfolder">Don't create subfolder</option>
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<label for="sequentialDownload">Download in sequential order</label>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<input type="checkbox" id="sequentialDownload" name="sequentialDownload" value="true">
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<label for="firstLastPiecePrio">Download first and last pieces first</label>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<input type="checkbox" id="firstLastPiecePrio" name="firstLastPiecePrio" value="true">
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<label for="dlLimitText">Limit download rate</label>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<input type="hidden" id="dlLimitHidden" name="dlLimit">
|
|
|
|
<input type="text" id="dlLimitText" style="width: 16em;" placeholder="KiB/s">
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<label for="upLimitText">Limit upload rate</label>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<input type="hidden" id="upLimitHidden" name="upLimit">
|
|
|
|
<input type="text" id="upLimitText" style="width: 16em;" placeholder="KiB/s">
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
2022-10-18 22:39:32 -04:00
|
|
|
</table>
|
|
|
|
<div id="submitbutton" style="margin-top: 30px; text-align: center;">
|
2024-10-03 08:37:11 -04:00
|
|
|
<button type="submit" style="font-size: 1em;">Upload Torrents</button>
|
2022-10-18 22:39:32 -04:00
|
|
|
</div>
|
|
|
|
</fieldset>
|
|
|
|
</form>
|
2024-10-03 08:37:11 -04:00
|
|
|
<div id="upload_spinner" class="mochaSpinner"></div>
|
|
|
|
|
2022-10-18 22:39:32 -04:00
|
|
|
<script>
|
2024-10-03 08:37:11 -04:00
|
|
|
"use strict";
|
2022-10-18 22:39:32 -04:00
|
|
|
|
|
|
|
let submitted = false;
|
|
|
|
|
2024-10-03 08:37:11 -04:00
|
|
|
$("uploadForm").addEventListener("submit", () => {
|
|
|
|
$("startTorrentHidden").value = $("startTorrent").checked ? "false" : "true";
|
2022-10-18 22:39:32 -04:00
|
|
|
|
2024-10-03 08:37:11 -04:00
|
|
|
$("dlLimitHidden").value = $("dlLimitText").value.toInt() * 1024;
|
|
|
|
$("upLimitHidden").value = $("upLimitText").value.toInt() * 1024;
|
2022-10-18 22:39:32 -04:00
|
|
|
|
2024-10-03 08:37:11 -04:00
|
|
|
$("upload_spinner").style.display = "block";
|
2022-10-18 22:39:32 -04:00
|
|
|
submitted = true;
|
|
|
|
});
|
|
|
|
|
2024-10-03 08:37:11 -04:00
|
|
|
$("upload_frame").addEventListener("load", () => {
|
2022-10-18 22:39:32 -04:00
|
|
|
if (submitted)
|
2024-10-03 08:37:11 -04:00
|
|
|
window.parent.qBittorrent.Client.closeWindows();
|
2022-10-18 22:39:32 -04:00
|
|
|
});
|
2024-01-07 17:04:03 -05:00
|
|
|
|
2024-10-03 08:37:11 -04:00
|
|
|
if ((Browser.platform === "ios") || ((Browser.platform === "mac") && (navigator.maxTouchPoints > 1)))
|
|
|
|
$("fileselect").accept = ".torrent";
|
|
|
|
|
|
|
|
window.qBittorrent.pathAutofill.attachPathAutofill();
|
2022-10-18 22:39:32 -04:00
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
|
|
|
|
</html>
|