qBittorrent: bump to new version
This commit is contained in:
parent
9ac9db22e8
commit
b4058b6ecf
@ -1,15 +1,16 @@
|
|||||||
# Copyright (C) 2019 Openwrt.org
|
# Copyright (C) 2019 Openwrt.org
|
||||||
#
|
#
|
||||||
# This is free software, licensed under the Apache License, Version 2.0 .
|
# This is a free software, use it under Apache Licene 2.0 & GNU General Public License v3.0.
|
||||||
#
|
#
|
||||||
|
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
LUCI_TITLE:=LuCI support for qBittorrent
|
LUCI_TITLE:=qbittorrent-nox for LuCI
|
||||||
LUCI_DEPENDS:=+qBittorrent +python
|
LUCI_DEPENDS:=+qBittorrent-Enhanced-Edition
|
||||||
LUCI_PKGARCH:=all
|
LUCI_PKGARCH:=all
|
||||||
|
PKG_NAME:=luci-app-qbittorrent
|
||||||
PKG_VERSION=1.0
|
PKG_VERSION=1.0
|
||||||
PKG_RELEASE:=18
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
include $(TOPDIR)/feeds/luci/luci.mk
|
include $(TOPDIR)/feeds/luci/luci.mk
|
||||||
|
|
||||||
|
|||||||
@ -13,4 +13,4 @@ function act_status()
|
|||||||
e.running=luci.sys.call("pgrep qbittorrent-nox >/dev/null")==0
|
e.running=luci.sys.call("pgrep qbittorrent-nox >/dev/null")==0
|
||||||
luci.http.prepare_content("application/json")
|
luci.http.prepare_content("application/json")
|
||||||
luci.http.write_json(e)
|
luci.http.write_json(e)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,371 +1,32 @@
|
|||||||
|
local e=require"luci.model.uci".cursor()
|
||||||
local o=luci.sys.exec("uci get qbittorrent.main.Port | xargs echo -n") or 8080
|
local o=e:get_first("qbittorrent","Preferences","port") or 8080
|
||||||
|
|
||||||
local a=(luci.sys.call("pidof qbittorrent-nox > /dev/null")==0)
|
local a=(luci.sys.call("pidof qbittorrent-nox > /dev/null")==0)
|
||||||
|
|
||||||
local t=""
|
local t=""
|
||||||
if a then
|
if a then
|
||||||
t="<br /><br /><input class=\"cbi-button cbi-button-apply\" type=\"button\" value=\" "..translate("Open Web Interface").." \" onclick=\"window.open('http://'+window.location.hostname+':"..o.."')\"/>"
|
t="<br /><br /><input class=\"cbi-button cbi-button-apply\" type=\"submit\" value=\" "..translate("Open Web Interface").." \" onclick=\"window.open('http://'+window.location.hostname+':"..o.."')\"/>"
|
||||||
end
|
|
||||||
|
|
||||||
function titlesplit(Value)
|
|
||||||
return "<p style=\"font-size:20px;font-weight:bold;color: DodgerBlue\">" .. translate(Value) .. "</p>"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
m = Map("qbittorrent", translate("qBittorrent"), translate("qBittorrent is a cross-platform free and open-source BitTorrent client")..t)
|
m = Map("qbittorrent", translate("qBittorrent"), translate("qBittorrent is a cross-platform free and open-source BitTorrent client")..t)
|
||||||
|
|
||||||
s = m:section(NamedSection, "main", "qbittorrent")
|
m:section(SimpleSection).template="qbittorrent/qbittorrent_status"
|
||||||
|
|
||||||
s:tab("basic", translate("Basic Settings"))
|
s_basic = m:section(TypedSection, "basic", translate("Basic Settings"))
|
||||||
|
s_basic.anonymous = true
|
||||||
|
|
||||||
o = s:taboption("basic", Flag, "enabled", translate("Enabled"))
|
enable = s_basic:option(Flag, "enable", translate("Enable"))
|
||||||
o.default = "1"
|
profile_dir = s_basic:option(Value,"profile_dir",translate("profile_dir"),translate("Store configuration files in the Path"))
|
||||||
|
profile_dir.default = "/root"
|
||||||
|
|
||||||
o = s:taboption("basic", ListValue, "user", translate("Run daemon as user"))
|
s_download = m:section(TypedSection, "Preferences", translate("Download Settings"))
|
||||||
local u
|
s_download.anonymous = true
|
||||||
for u in luci.util.execi("cat /etc/passwd | cut -d ':' -f1") do
|
download_dir = s_download:option(Value,"download_dir",translate("download_dir"),translate("Store download files in the Path"))
|
||||||
o:value(u)
|
download_dir.default = "/root/download"
|
||||||
end
|
|
||||||
|
|
||||||
o = s:taboption("basic", Value, "profile", translate("Store configuration files in the Path"))
|
s_webui = m:section(TypedSection, "Preferences", translate("WEBUI Settings"))
|
||||||
o.default = '/tmp'
|
s_webui.anonymous = true
|
||||||
|
port = s_webui:option(Value,"port",translate("port"),translate("WEBUI listening port"))
|
||||||
|
port.default = "8080"
|
||||||
|
|
||||||
o = s:taboption("basic", Value, "SavePath", translate("Store download files in the Path"))
|
return m
|
||||||
o.placeholder = "/tmp/download"
|
|
||||||
|
|
||||||
o = s:taboption("basic", Value, "Port", translate("WEBUI listening port"))
|
|
||||||
o.datatype = "port"
|
|
||||||
o.placeholder = "8080"
|
|
||||||
|
|
||||||
o = s:taboption("basic", Flag, "UseRandomPort", translate("Use Random Port"), translate("Randomly assigns a different port every time qBittorrent starts up"))
|
|
||||||
o.enabled = "true"
|
|
||||||
o.disabled = "false"
|
|
||||||
o.default = o.enabled
|
|
||||||
|
|
||||||
o = s:taboption("basic", Value, "PortRangeMin", translate("Connection Port"), translate("Incoming connection port"))
|
|
||||||
o:depends("UseRandomPort", false)
|
|
||||||
o.datatype = "range(1024,65535)"
|
|
||||||
|
|
||||||
|
|
||||||
s:tab("connection", translate("Connection Settings"))
|
|
||||||
|
|
||||||
o = s:taboption("connection", Flag, "UPnP", translate("Use UPnP for Connections"), translate("Use UPnP/ NAT-PMP port forwarding from my router. Refer to the "
|
|
||||||
.. "<a href='https://en.wikipedia.org/wiki/Port_forwarding' target='_blank'>wiki</a>."))
|
|
||||||
o.enabled = "true"
|
|
||||||
o.disabled = "false"
|
|
||||||
o.default = o.enabled
|
|
||||||
|
|
||||||
|
|
||||||
o = s:taboption("connection", Value, "GlobalDLLimit", translate("Global Download Speed"), translate("Global Download Speed Limit(KiB/s)."))
|
|
||||||
o.datatype = "float"
|
|
||||||
o.placeholder = "0"
|
|
||||||
|
|
||||||
o = s:taboption("connection", Value, "GlobalUPLimit", translate("Global Upload Speed"), translate("Global Upload Speed Limit(KiB/s)."))
|
|
||||||
o.datatype = "float"
|
|
||||||
o.placeholder = "0"
|
|
||||||
|
|
||||||
o = s:taboption("connection", Value, "GlobalDLLimitAlt", translate("Alternative Download Speed"), translate("Alternative Download Speed Limit(KiB/s)."))
|
|
||||||
o.datatype = "float"
|
|
||||||
o.placeholder = "10"
|
|
||||||
|
|
||||||
o = s:taboption("connection", Value, "GlobalUPLimitAlt", translate("Alternative Upload Speed"), translate("Alternative Upload Speed Limit(KiB/s)."))
|
|
||||||
o.datatype = "float"
|
|
||||||
o.placeholder = "10"
|
|
||||||
|
|
||||||
o = s:taboption("connection", ListValue, "BTProtocol", translate("Enabled protocol"), translate("The protocol that was enabled."))
|
|
||||||
o:value("Both", translate("TCP and UTP"))
|
|
||||||
o:value("TCP", translate("TCP"))
|
|
||||||
o:value("UTP", translate("UTP"))
|
|
||||||
o.default = "Both"
|
|
||||||
|
|
||||||
o = s:taboption("connection", Value, "InetAddress", translate("Inet Address"), translate("The address that respond to the trackers."))
|
|
||||||
|
|
||||||
s:tab("downloads", translate("Download Settings"))
|
|
||||||
|
|
||||||
o = s:taboption("downloads", Flag, "CreateTorrentSubfolder", translate("Create Subfolder"), translate("Create subfolder for torrents with multiple files."))
|
|
||||||
o.enabled = "true"
|
|
||||||
o.disabled = "false"
|
|
||||||
o.default = o.enabled
|
|
||||||
|
|
||||||
o = s:taboption("downloads", Flag, "StartInPause", translate("Start In Pause"), translate("Do not start the download automatically."))
|
|
||||||
o.enabled = "true"
|
|
||||||
o.disabled = "false"
|
|
||||||
o.default = o.disabled
|
|
||||||
|
|
||||||
o = s:taboption("downloads", Flag, "AutoDeleteAddedTorrentFile", translate("Auto Delete Torrent File"), translate("The .torrent files will be deleted afterwards."))
|
|
||||||
o.enabled = "IfAdded"
|
|
||||||
o.disabled = "Never"
|
|
||||||
o.default = o.disabled
|
|
||||||
|
|
||||||
o = s:taboption("downloads", Flag, "PreAllocation", translate("Pre Allocation"), translate("Pre-allocate disk space for all files."))
|
|
||||||
o.enabled = "true"
|
|
||||||
o.disabled = "false"
|
|
||||||
o.default = o.disabled
|
|
||||||
|
|
||||||
o = s:taboption("downloads", Flag, "UseIncompleteExtension", translate("Use Incomplete Extension"), translate("The incomplete task will be added the extension of !qB."))
|
|
||||||
o.enabled = "true"
|
|
||||||
o.disabled = "false"
|
|
||||||
o.default = o.disabled
|
|
||||||
|
|
||||||
o = s:taboption("downloads", Flag, "TempPathEnabled", translate("Temp Path Enabled"))
|
|
||||||
o.enabled = "true"
|
|
||||||
o.disabled = "false"
|
|
||||||
o.default = o.enabled
|
|
||||||
|
|
||||||
o = s:taboption("downloads", Value, "TempPath", translate("Temp Path"), translate("The absolute and relative path can be set."))
|
|
||||||
o:depends("TempPathEnabled", "true")
|
|
||||||
o.placeholder = "temp/"
|
|
||||||
|
|
||||||
o = s:taboption("downloads", Value, "DiskWriteCacheSize", translate("Disk Cache Size (MiB)"), translate("The value -1 is auto and 0 is disable. In default, it is set to 64MiB."))
|
|
||||||
o.datatype = "integer"
|
|
||||||
o.placeholder = "64"
|
|
||||||
|
|
||||||
o = s:taboption("downloads", Value, "DiskWriteCacheTTL", translate("Disk Cache TTL (s)"), translate("In default, it is set to 60s."))
|
|
||||||
o.datatype = "integer"
|
|
||||||
o.placeholder = "60"
|
|
||||||
|
|
||||||
o = s:taboption("downloads", DummyValue, "Saving Management", titlesplit("Saving Management"))
|
|
||||||
|
|
||||||
o = s:taboption("downloads", ListValue, "DisableAutoTMMByDefault", translate("Default Torrent Management Mode"))
|
|
||||||
o:value("true", translate("Manual"))
|
|
||||||
o:value("false", translate("Automaic"))
|
|
||||||
o.default = "true"
|
|
||||||
|
|
||||||
o = s:taboption("downloads", ListValue, "CategoryChanged", translate("Torrent Category Changed"), translate("Choose the action when torrent category changed."))
|
|
||||||
o:value("true", translate("Switch torrent to Manual Mode"))
|
|
||||||
o:value("false", translate("Relocate torrent"))
|
|
||||||
o.default = "false"
|
|
||||||
|
|
||||||
o = s:taboption("downloads", ListValue, "DefaultSavePathChanged", translate("Default Save Path Changed"), translate("Choose the action when default save path changed."))
|
|
||||||
o:value("true", translate("Switch affected torrent to Manual Mode"))
|
|
||||||
o:value("false", translate("Relocate affected torrent"))
|
|
||||||
o.default = "true"
|
|
||||||
|
|
||||||
o = s:taboption("downloads", ListValue, "CategorySavePathChanged", translate("Category Save Path Changed"), translate("Choose the action when category save path changed."))
|
|
||||||
o:value("true", translate("Switch affected torrent to Manual Mode"))
|
|
||||||
o:value("false", translate("Relocate affected torrent"))
|
|
||||||
o.default = "true"
|
|
||||||
|
|
||||||
o = s:taboption("downloads", Value, "TorrentExportDir", translate("Torrent Export Dir"), translate("The .torrent files will be copied to the target directory."))
|
|
||||||
|
|
||||||
o = s:taboption("downloads", Value, "FinishedTorrentExportDir", translate("Finished Torrent Export Dir"), translate("The .torrent files for finished downloads will be copied to the target directory."))
|
|
||||||
|
|
||||||
s:tab("bittorrent", translate("Bittorrent Settings"))
|
|
||||||
|
|
||||||
o = s:taboption("bittorrent", Flag, "DHT", translate("Enable DHT"), translate("Enable DHT (decentralized network) to find more peers"))
|
|
||||||
o.enabled = "true"
|
|
||||||
o.disabled = "false"
|
|
||||||
o.default = o.enabled
|
|
||||||
|
|
||||||
o = s:taboption("bittorrent", Flag, "PeX", translate("Enable PeX"), translate("Enable Peer Exchange (PeX) to find more peers"))
|
|
||||||
o.enabled = "true"
|
|
||||||
o.disabled = "false"
|
|
||||||
o.default = o.enabled
|
|
||||||
|
|
||||||
o = s:taboption("bittorrent", Flag, "LSD", translate("Enable LSD"), translate("Enable Local Peer Discovery to find more peers"))
|
|
||||||
o.enabled = "true"
|
|
||||||
o.disabled = "false"
|
|
||||||
o.default = o.disabled
|
|
||||||
|
|
||||||
o = s:taboption("bittorrent", Flag, "uTP_rate_limited", translate("uTP Rate Limit"), translate("Apply rate limit to μTP protocol."))
|
|
||||||
o.enabled = "true"
|
|
||||||
o.disabled = "false"
|
|
||||||
o.default = o.enabled
|
|
||||||
|
|
||||||
o = s:taboption("bittorrent", ListValue, "Encryption", translate("Encryption Mode"), translate("Enable DHT (decentralized network) to find more peers"))
|
|
||||||
o:value("0", translate("Prefer Encryption"))
|
|
||||||
o:value("1", translate("Require Encryption"))
|
|
||||||
o:value("2", translate("Disable Encryption"))
|
|
||||||
o.default = "0"
|
|
||||||
|
|
||||||
o = s:taboption("bittorrent", Value, "MaxConnecs", translate("Max Connections"), translate("The max number of connections."))
|
|
||||||
o.datatype = "integer"
|
|
||||||
o.placeholder = "500"
|
|
||||||
|
|
||||||
o = s:taboption("bittorrent", Value, "MaxConnecsPerTorrent", translate("Max Connections Per Torrent"), translate("The max number of connections per torrent."))
|
|
||||||
o.datatype = "integer"
|
|
||||||
o.placeholder = "100"
|
|
||||||
|
|
||||||
o = s:taboption("bittorrent", Value, "MaxUploads", translate("Max Uploads"), translate("The max number of connected peers."))
|
|
||||||
o.datatype = "integer"
|
|
||||||
o.placeholder = "8"
|
|
||||||
|
|
||||||
o = s:taboption("bittorrent", Value, "MaxUploadsPerTorrent", translate("Max Uploads Per Torrent"), translate("The max number of connected peers per torrent."))
|
|
||||||
o.datatype = "integer"
|
|
||||||
o.placeholder = "4"
|
|
||||||
|
|
||||||
o = s:taboption("bittorrent", Value, "MaxRatio", translate("Max Ratio"), translate("The max ratio for seeding. -1 is to disable the seeding."))
|
|
||||||
o.datatype = "float"
|
|
||||||
o.placeholder = "-1"
|
|
||||||
|
|
||||||
o = s:taboption("bittorrent", ListValue, "MaxRatioAction", translate("Max Ratio Action"), translate("The action when reach the max seeding ratio."))
|
|
||||||
o:value("0", translate("Pause them"))
|
|
||||||
o:value("1", translate("Remove them"))
|
|
||||||
o.defaule = "0"
|
|
||||||
|
|
||||||
o = s:taboption("bittorrent", Value, "GlobalMaxSeedingMinutes", translate("Max Seeding Minutes"), translate("Units: minutes"))
|
|
||||||
o.datatype = "integer"
|
|
||||||
|
|
||||||
o = s:taboption("bittorrent", DummyValue, "Queueing Setting", titlesplit("Queueing Setting"))
|
|
||||||
|
|
||||||
o = s:taboption("bittorrent", Flag, "QueueingEnabled", translate("Enable Torrent Queueing"))
|
|
||||||
o.enabled = "true"
|
|
||||||
o.disabled = "false"
|
|
||||||
o.default = o.enabled
|
|
||||||
|
|
||||||
o = s:taboption("bittorrent", Value, "MaxActiveDownloads", translate("Maximum Active Downloads"))
|
|
||||||
o.datatype = "integer"
|
|
||||||
o.placeholder = "3"
|
|
||||||
|
|
||||||
o = s:taboption("bittorrent", Value, "MaxActiveUploads", translate("Max Active Uploads"))
|
|
||||||
o.datatype = "integer"
|
|
||||||
o.placeholder = "3"
|
|
||||||
|
|
||||||
o = s:taboption("bittorrent", Value, "MaxActiveTorrents", translate("Max Active Torrents"))
|
|
||||||
o.datatype = "integer"
|
|
||||||
o.placeholder = "5"
|
|
||||||
|
|
||||||
o = s:taboption("bittorrent", Flag, "IgnoreSlowTorrents", translate("Ignore Slow Torrents"), translate("Do not count slow torrents in these limits."))
|
|
||||||
o.enabled = "true"
|
|
||||||
o.disabled = "false"
|
|
||||||
o.default = o.disabled
|
|
||||||
|
|
||||||
o = s:taboption("bittorrent", Value, "SlowTorrentsDownloadRate", translate("Download rate threshold"), translate("Units: KiB/s"))
|
|
||||||
o.datatype = "integer"
|
|
||||||
o.placeholder = "2"
|
|
||||||
|
|
||||||
o = s:taboption("bittorrent", Value, "SlowTorrentsUploadRate", translate("Upload rate threshold"), translate("Units: KiB/s"))
|
|
||||||
o.datatype = "integer"
|
|
||||||
o.placeholder = "2"
|
|
||||||
|
|
||||||
o = s:taboption("bittorrent", Value, "SlowTorrentsInactivityTimer", translate("Torrent inactivity timer"), translate("Units: seconds"))
|
|
||||||
o.datatype = "integer"
|
|
||||||
o.placeholder = "60"
|
|
||||||
|
|
||||||
s:tab("webgui", translate("WebUI Settings"))
|
|
||||||
|
|
||||||
o = s:taboption("webgui", Flag, "UseUPnP", translate("Use UPnP for WebUI"), translate("Using the UPnP / NAT-PMP port of the router for connecting to WebUI."))
|
|
||||||
o.enabled = "true"
|
|
||||||
o.disabled = "false"
|
|
||||||
o.default = o.disabled
|
|
||||||
|
|
||||||
o = s:taboption("webgui", Value, "Username", translate("Username"), translate("The login name for WebUI."))
|
|
||||||
o.placeholder = "admin"
|
|
||||||
|
|
||||||
o = s:taboption("webgui", Value, "Password", translate("Password"), translate("The login password for WebUI."))
|
|
||||||
o.password = true
|
|
||||||
|
|
||||||
o = s:taboption("webgui", Value, "Locale", translate("Locale Language"))
|
|
||||||
o:value("en", translate("English"))
|
|
||||||
o:value("zh", translate("Chinese"))
|
|
||||||
o.default = "en"
|
|
||||||
|
|
||||||
o = s:taboption("webgui", Flag, "CSRFProtection", translate("CSRF Protection"), translate("Enable Cross-Site Request Forgery (CSRF) protection."))
|
|
||||||
o.enabled = "true"
|
|
||||||
o.disabled = "false"
|
|
||||||
o.default = o.enabled
|
|
||||||
|
|
||||||
o = s:taboption("webgui", Flag, "ClickjackingProtection", translate("Clickjacking Protection"), translate("Enable clickjacking protection."))
|
|
||||||
o.enabled = "true"
|
|
||||||
o.disabled = "false"
|
|
||||||
o.default = o.enabled
|
|
||||||
|
|
||||||
o = s:taboption("webgui", Flag, "HostHeaderValidation", translate("Host Header Validation"), translate("Validate the host header."))
|
|
||||||
o.enabled = "true"
|
|
||||||
o.disabled = "false"
|
|
||||||
o.default = o.enabled
|
|
||||||
|
|
||||||
o = s:taboption("webgui", Flag, "LocalHostAuth", translate("Local Host Authentication"), translate("Force authentication for clients on localhost."))
|
|
||||||
o.enabled = "true"
|
|
||||||
o.disabled = "false"
|
|
||||||
o.default = o.enabled
|
|
||||||
|
|
||||||
o = s:taboption("webgui", Flag, "AuthSubnetWhitelistEnabled", translate("Enable Subnet Whitelist"))
|
|
||||||
o.enabled = "true"
|
|
||||||
o.disabled = "false"
|
|
||||||
o.default = o.disabled
|
|
||||||
|
|
||||||
o = s:taboption("webgui", DynamicList, "AuthSubnetWhitelist", translate("Subnet Whitelist"))
|
|
||||||
o:depends("AuthSubnetWhitelistEnabled", "true")
|
|
||||||
|
|
||||||
s:tab("advanced", translate("Advance Settings"))
|
|
||||||
|
|
||||||
o = s:taboption("advanced", Flag, "AnonymousMode", translate("Anonymous Mode"), translate("When enabled, qBittorrent will take certain measures to try"
|
|
||||||
.. " to mask its identity. Refer to the <a href='https://github.com/qbittorrent/qBittorrent/wiki/Anonymous-Mode' target='_blank'>wiki</a>"))
|
|
||||||
o.enabled = "true"
|
|
||||||
o.disabled = "false"
|
|
||||||
o.default = o.enabled
|
|
||||||
|
|
||||||
o = s:taboption("advanced", Flag, "SuperSeeding", translate("Super Seeding"), translate("The super seeding mode."))
|
|
||||||
o.enabled = "true"
|
|
||||||
o.disabled = "false"
|
|
||||||
o.default = o.disabled
|
|
||||||
|
|
||||||
o = s:taboption("advanced", Value, "configuration", translate("Profile Folder Suffix"), translate("Suffix for profile folder"))
|
|
||||||
|
|
||||||
o = s:taboption("advanced", Flag, "IncludeOverhead", translate("Limit Overhead Usage"), translate("The overhead usage is been limitted."))
|
|
||||||
o.enabled = "true"
|
|
||||||
o.disabled = "false"
|
|
||||||
o.default = o.disabled
|
|
||||||
|
|
||||||
o = s:taboption("advanced", Flag, "IgnoreLimitsLAN", translate("Ignore LAN Limit"), translate("Ignore the speed limit to LAN."))
|
|
||||||
o.enabled = "true"
|
|
||||||
o.disabled = "false"
|
|
||||||
o.default = o.enabled
|
|
||||||
|
|
||||||
o = s:taboption("advanced", Flag, "osCache", translate("Use os Cache"))
|
|
||||||
o.enabled = "true"
|
|
||||||
o.disabled = "false"
|
|
||||||
o.default = o.enabled
|
|
||||||
|
|
||||||
o = s:taboption("advanced", Value, "OutgoingPortsMax", translate("Max Outgoing Port"), translate("The max outgoing port."))
|
|
||||||
o.datatype = "port"
|
|
||||||
|
|
||||||
o = s:taboption("advanced", Value, "OutgoingPortsMin", translate("Min Outgoing Port"), translate("The min outgoing port."))
|
|
||||||
o.datatype = "port"
|
|
||||||
|
|
||||||
o = s:taboption("advanced", ListValue, "SeedChokingAlgorithm", translate("Choking Algorithm"), translate("The strategy of choking algorithm."))
|
|
||||||
o:value("RoundRobin", translate("Round Robin"))
|
|
||||||
o:value("FastestUpload", translate("Fastest Upload"))
|
|
||||||
o:value("AntiLeech", translate("Anti-Leech"))
|
|
||||||
o.default = "FastestUpload"
|
|
||||||
|
|
||||||
o = s:taboption("advanced", Flag, "AnnounceToAllTrackers", translate("Announce To All Trackers"))
|
|
||||||
o.enabled = "true"
|
|
||||||
o.disabled = "false"
|
|
||||||
o.default = o.disabled
|
|
||||||
|
|
||||||
o = s:taboption("advanced", Flag, "AnnounceToAllTiers", translate("Announce To All Tiers"))
|
|
||||||
o.enabled = "true"
|
|
||||||
o.disabled = "false"
|
|
||||||
o.default = o.enabled
|
|
||||||
|
|
||||||
o = s:taboption("advanced", Flag, "Enabled", translate("Enable Log"), translate("Enable logger to log file."))
|
|
||||||
o.enabled = "true"
|
|
||||||
o.disabled = "false"
|
|
||||||
o.default = o.enabled
|
|
||||||
|
|
||||||
o = s:taboption("advanced", Value, "Path", translate("Log Path"), translate("The path for qbittorrent log."))
|
|
||||||
o:depends("Enabled", "true")
|
|
||||||
|
|
||||||
o = s:taboption("advanced", Flag, "Backup", translate("Enable Backup"), translate("Backup log file when oversize the given size."))
|
|
||||||
o:depends("Enabled", "true")
|
|
||||||
o.enabled = "true"
|
|
||||||
o.disabled = "false"
|
|
||||||
o.default = o.enabled
|
|
||||||
|
|
||||||
o = s:taboption("advanced", Flag, "DeleteOld", translate("Delete Old Backup"), translate("Delete the old log file."))
|
|
||||||
o:depends("Enabled", "true")
|
|
||||||
o.enabled = "true"
|
|
||||||
o.disabled = "false"
|
|
||||||
o.default = o.enabled
|
|
||||||
|
|
||||||
o = s:taboption("advanced", Value, "MaxSizeBytes", translate("Log Max Size"), translate("The max size for qbittorrent log (Unit: Bytes)."))
|
|
||||||
o:depends("Enabled", "true")
|
|
||||||
o.placeholder = "66560"
|
|
||||||
|
|
||||||
o = s:taboption("advanced", Value, "SaveTime", translate("Log Saving Period"), translate("The log file will be deteted after given time. 1d -- 1 day, 1m -- 1 month, 1y -- 1 year"))
|
|
||||||
o:depends("Enabled", "true")
|
|
||||||
o.datatype = "string"
|
|
||||||
|
|
||||||
return m
|
|
||||||
@ -50,525 +50,4 @@ msgid "WEBUI Settings"
|
|||||||
msgstr "WEBUI设置"
|
msgstr "WEBUI设置"
|
||||||
|
|
||||||
msgid "WEBUI listening port"
|
msgid "WEBUI listening port"
|
||||||
msgstr "WebUI 监听端口"
|
msgstr "WEBUI监听端口"
|
||||||
|
|
||||||
msgid "Use Random Port"
|
|
||||||
msgstr "随机传入连接端口"
|
|
||||||
|
|
||||||
msgid "Randomly assigns a different port every time qBittorrent starts up"
|
|
||||||
msgstr "在每次启动时使用不同的传入连接端口"
|
|
||||||
|
|
||||||
msgid "Connection Port"
|
|
||||||
msgstr "用于传入连接的端口"
|
|
||||||
|
|
||||||
msgid "Incoming connection port"
|
|
||||||
msgstr "推荐在防火墙 -> 流量规则 中,打开这个端口获得更好的下载速度( TCP+UDP )"
|
|
||||||
|
|
||||||
msgid "Bittorrent Settings"
|
|
||||||
msgstr "Bittorrent 设置"
|
|
||||||
|
|
||||||
msgid "WebUI Settings"
|
|
||||||
msgstr "WebUI 设置"
|
|
||||||
|
|
||||||
msgid "Advance Settings"
|
|
||||||
msgstr "高级设置"
|
|
||||||
|
|
||||||
|
|
||||||
msgid "Run daemon as user"
|
|
||||||
msgstr "用户组"
|
|
||||||
|
|
||||||
msgid "Parent Path for Profile Folder"
|
|
||||||
msgstr "配置保存路径"
|
|
||||||
|
|
||||||
msgid "The path for storing profile folder using by command: <b>--profile [PATH]</b>."
|
|
||||||
msgstr "配置文件的保存路径,默认的配置文件夹在/tmp下。例如:<code>/etc/config</code>"
|
|
||||||
|
|
||||||
msgid "Profile Folder Suffix"
|
|
||||||
msgstr "配置目录后缀"
|
|
||||||
|
|
||||||
msgid "Suffix for profile folder, for example, <b>qBittorrent_[NAME]</b>."
|
|
||||||
msgstr "配置文件文件夹的后缀。例如: <b>qBittorrent_[NAME]</b>"
|
|
||||||
|
|
||||||
msgid "Locale Language"
|
|
||||||
msgstr "WebUI语言"
|
|
||||||
|
|
||||||
msgid "English"
|
|
||||||
msgstr "英文"
|
|
||||||
|
|
||||||
msgid "Chinese"
|
|
||||||
msgstr "中文"
|
|
||||||
|
|
||||||
msgid "Enable Log"
|
|
||||||
msgstr "启用日志"
|
|
||||||
|
|
||||||
msgid "Enable logger to log file."
|
|
||||||
msgstr "qBittorrent的启动和运行信息文档。"
|
|
||||||
|
|
||||||
msgid "Log Path"
|
|
||||||
msgstr "日志文件"
|
|
||||||
|
|
||||||
msgid "The path for qbittorrent log."
|
|
||||||
msgstr "日志文件自定义保存路径,默认都在配置文件夹的data下。"
|
|
||||||
|
|
||||||
msgid "Enable Backup"
|
|
||||||
msgstr "启用备份"
|
|
||||||
|
|
||||||
msgid "Backup log file when oversize the given size."
|
|
||||||
msgstr "备份日志文件。"
|
|
||||||
|
|
||||||
msgid "Delete Old Backup"
|
|
||||||
msgstr "删除备份"
|
|
||||||
|
|
||||||
msgid "Delete the old log file."
|
|
||||||
msgstr "符合下列设定后将删除旧的日志文件。"
|
|
||||||
|
|
||||||
msgid "Log Max Size"
|
|
||||||
msgstr "日志保存大小"
|
|
||||||
|
|
||||||
msgid "Log Saving Period"
|
|
||||||
msgstr "日志保存期限"
|
|
||||||
|
|
||||||
msgid "The max size for qbittorrent log (Unit: Bytes)."
|
|
||||||
msgstr "设定日志文件的大小(单位:字节)"
|
|
||||||
|
|
||||||
msgid "The log file will be deteted after given time. 1d -- 1 day, 1m -- 1 month, 1y -- 1 year"
|
|
||||||
msgstr "设定日志文件的时间(1d-1天,1m-1个月,1y-1年)"
|
|
||||||
|
|
||||||
msgid "Connection Settings"
|
|
||||||
msgstr "连接设置"
|
|
||||||
|
|
||||||
msgid "Use UPnP for Connections"
|
|
||||||
msgstr "端口自动转发"
|
|
||||||
|
|
||||||
msgid "Use UPnP/ NAT-PMP port forwarding from my router."
|
|
||||||
msgstr "使用路由器的UPnP/NAT-PMP端口自动转发。"
|
|
||||||
|
|
||||||
msgid "Use Random Port"
|
|
||||||
msgstr "启用随机端口"
|
|
||||||
|
|
||||||
msgid "Use different port on each startup voids the first"
|
|
||||||
msgstr "在每次启动时使用随机的端口。"
|
|
||||||
|
|
||||||
msgid "Connection Port"
|
|
||||||
msgstr "自定义端口"
|
|
||||||
|
|
||||||
msgid "Generate Randomly"
|
|
||||||
msgstr "默认端口:8999"
|
|
||||||
|
|
||||||
msgid "Global Download Speed"
|
|
||||||
msgstr "全局下载速度限制"
|
|
||||||
|
|
||||||
msgid "Global Download Speed Limit(KiB/s)."
|
|
||||||
msgstr "全局下载速度限制(KiB/s),0为无限制。"
|
|
||||||
|
|
||||||
msgid "Global Upload Speed"
|
|
||||||
msgstr "全局上传速度限制"
|
|
||||||
|
|
||||||
msgid "Alternative Download Speed"
|
|
||||||
msgstr "备用下载速度限制"
|
|
||||||
|
|
||||||
msgid "Alternative Upload Speed"
|
|
||||||
msgstr "备用上传速度限制"
|
|
||||||
|
|
||||||
msgid "Global Upload Speed Limit(KiB/s)."
|
|
||||||
msgstr "全局上传速度限制(KiB/s),0为无限制。"
|
|
||||||
|
|
||||||
msgid "Alternative Download Speed Limit(KiB/s)."
|
|
||||||
msgstr "备用下载速度限制(KiB/s),0为无限制。"
|
|
||||||
|
|
||||||
msgid "Alternative Upload Speed Limit(KiB/s)."
|
|
||||||
msgstr "备用上传速度限制(KiB/s),0为无限制。"
|
|
||||||
|
|
||||||
msgid "Enabled protocol"
|
|
||||||
msgstr "启用的协议"
|
|
||||||
|
|
||||||
msgid "The protocol that was enabled."
|
|
||||||
msgstr "当前已启用的协议。"
|
|
||||||
|
|
||||||
msgid "TCP and UTP"
|
|
||||||
msgstr "TCP和UTP"
|
|
||||||
|
|
||||||
msgid "Inet Address"
|
|
||||||
msgstr "输入地址"
|
|
||||||
|
|
||||||
msgid "The address that respond to the trackers."
|
|
||||||
msgstr "响应跟踪器的地址。"
|
|
||||||
|
|
||||||
msgid "When adding seeds"
|
|
||||||
msgstr "当添加种子时"
|
|
||||||
|
|
||||||
msgid "Downloads Settings"
|
|
||||||
msgstr "下载设置"
|
|
||||||
|
|
||||||
msgid "Create Subfolder"
|
|
||||||
msgstr "创建目录"
|
|
||||||
|
|
||||||
msgid "Create subfolder for torrents with multiple files."
|
|
||||||
msgstr "为含多个文件的种子创建子文件夹。"
|
|
||||||
|
|
||||||
msgid "Start In Pause"
|
|
||||||
msgstr "开始暂停"
|
|
||||||
|
|
||||||
msgid "Do not start the download automatically."
|
|
||||||
msgstr "在下载任务添加后暂停。"
|
|
||||||
|
|
||||||
msgid "Auto Delete Torrent File"
|
|
||||||
msgstr "删除种子"
|
|
||||||
|
|
||||||
msgid "The .torrent files will be deleted afterwards."
|
|
||||||
msgstr "下载完成后自动删除这个种子文件。"
|
|
||||||
|
|
||||||
msgid "Pre Allocation"
|
|
||||||
msgstr "磁盘预分配"
|
|
||||||
|
|
||||||
msgid "Pre-allocate disk space for all files."
|
|
||||||
msgstr "为刚添加的文件预先分配磁盘空间。"
|
|
||||||
|
|
||||||
msgid "Use Incomplete Extension"
|
|
||||||
msgstr "使用扩展名"
|
|
||||||
|
|
||||||
msgid "The incomplete task will be added the extension of !qB."
|
|
||||||
msgstr "为不完整的文件添加后缀名<code>!qB</code>"
|
|
||||||
|
|
||||||
msgid "Save Path"
|
|
||||||
msgstr "文件保存路径"
|
|
||||||
|
|
||||||
msgid "The path to save the download file. For example:<code>/mnt/sda1/download</code>"
|
|
||||||
msgstr "下载文件的保存路径。例如:<code>/mnt/sda1/download</code>"
|
|
||||||
|
|
||||||
msgid "Temp Path Enabled"
|
|
||||||
msgstr "启用临时目录"
|
|
||||||
|
|
||||||
msgid "Temp Path"
|
|
||||||
msgstr "临时路径"
|
|
||||||
|
|
||||||
msgid "The absolute and relative path can be set."
|
|
||||||
msgstr "可以设置绝对和相对路径。"
|
|
||||||
|
|
||||||
msgid "Disk Cache Size (MiB)"
|
|
||||||
msgstr "磁盘缓存"
|
|
||||||
|
|
||||||
msgid "The value -1 is auto and 0 is disable. In default, it is set to 64MiB."
|
|
||||||
msgstr "数值1是自动的,0是禁用的。默认设置为64MiB。"
|
|
||||||
|
|
||||||
msgid "Disk Cache TTL (s)"
|
|
||||||
msgstr "磁盘缓存TTL"
|
|
||||||
|
|
||||||
msgid "In default, it is set to 60s."
|
|
||||||
msgstr "默认设置为60秒。"
|
|
||||||
|
|
||||||
msgid "Saving Management"
|
|
||||||
msgstr "保存管理"
|
|
||||||
|
|
||||||
msgid "Default Torrent Management Mode"
|
|
||||||
msgstr "默认种子管理模式"
|
|
||||||
|
|
||||||
msgid "Manual"
|
|
||||||
msgstr "手动"
|
|
||||||
|
|
||||||
msgid "Automaic"
|
|
||||||
msgstr "自动"
|
|
||||||
|
|
||||||
msgid "Torrent Category Changed"
|
|
||||||
msgstr "当种子分类修改时"
|
|
||||||
|
|
||||||
msgid "Choose the action when torrent category changed."
|
|
||||||
msgstr "选择种子类别更改时的操作。"
|
|
||||||
|
|
||||||
msgid "Switch torrent to Manual Mode"
|
|
||||||
msgstr "将种子切换到手动模式"
|
|
||||||
|
|
||||||
msgid "Relocate torrent"
|
|
||||||
msgstr "重新定位种子"
|
|
||||||
|
|
||||||
msgid "Default Save Path Changed"
|
|
||||||
msgstr "当默认保存路径修改时"
|
|
||||||
|
|
||||||
msgid "Choose the action when default save path changed."
|
|
||||||
msgstr "选择默认保存路径更改时的操作。"
|
|
||||||
|
|
||||||
msgid "Switch affected torrent to Manual Mode"
|
|
||||||
msgstr "将受影响的种子切换到手动模式"
|
|
||||||
|
|
||||||
msgid "Relocate affected torrent"
|
|
||||||
msgstr "重新定位种子"
|
|
||||||
|
|
||||||
msgid "Category Save Path Changed"
|
|
||||||
msgstr "当分类保存路径修改时"
|
|
||||||
|
|
||||||
msgid "Choose the action when category save path changed."
|
|
||||||
msgstr "选择分类保存路径更改时的操作。"
|
|
||||||
|
|
||||||
msgid "Torrent Export Dir"
|
|
||||||
msgstr "种子导出目录"
|
|
||||||
|
|
||||||
msgid "The .torrent files will be copied to the target directory."
|
|
||||||
msgstr "种子文件将被复制到目标目录。例如:<code>/etc/config</code>"
|
|
||||||
|
|
||||||
msgid "Finished Torrent Export Dir"
|
|
||||||
msgstr "复制种子文件"
|
|
||||||
|
|
||||||
msgid "The .torrent files for finished downloads will be copied to the target directory."
|
|
||||||
msgstr "将已下载完成的种子文件复制到目标目录。例如:<code>/etc/config</code>"
|
|
||||||
|
|
||||||
msgid "Bittorrent Settings"
|
|
||||||
msgstr "BT设置""
|
|
||||||
|
|
||||||
msgid "Enable DHT"
|
|
||||||
msgstr "启用DHT"
|
|
||||||
|
|
||||||
msgid "Enable DHT (decentralized network) to find more peers"
|
|
||||||
msgstr "启用DHT(去中心化网络) 以找到更多用户。"
|
|
||||||
|
|
||||||
msgid "Enable PeX"
|
|
||||||
msgstr "启用PeX"
|
|
||||||
|
|
||||||
msgid "Enable Peer Exchange (PeX) to find more peers"
|
|
||||||
msgstr "启用用户交换(PeX)以找到更多用户。"
|
|
||||||
|
|
||||||
msgid "Enable LSD"
|
|
||||||
msgstr "启用LSD"
|
|
||||||
|
|
||||||
msgid "Enable Local Peer Discovery to find more peers"
|
|
||||||
msgstr "启用本地用户发现以找到更多用户。"
|
|
||||||
|
|
||||||
msgid "uTP Rate Limit"
|
|
||||||
msgstr "uTP速度限制"
|
|
||||||
|
|
||||||
msgid "Apply rate limit to µTP protocol."
|
|
||||||
msgstr "针对µTP协议进行速度限制。"
|
|
||||||
|
|
||||||
msgid "Encryption Mode"
|
|
||||||
msgstr "加密模式"
|
|
||||||
|
|
||||||
msgid "Enable DHT (decentralized network) to find more peers"
|
|
||||||
msgstr "使DHT(分散网络)能够找到更多的对等点。"
|
|
||||||
|
|
||||||
msgid "Prefer Encryption"
|
|
||||||
msgstr "偏好加密"
|
|
||||||
|
|
||||||
msgid "Require Encryption"
|
|
||||||
msgstr "强制加密"
|
|
||||||
|
|
||||||
msgid "Disable Encryption"
|
|
||||||
msgstr "禁用加密"
|
|
||||||
|
|
||||||
msgid "Max Connections"
|
|
||||||
msgstr "连接数限制"
|
|
||||||
|
|
||||||
msgid "The max number of connections."
|
|
||||||
msgstr "全局最大连接数。"
|
|
||||||
|
|
||||||
msgid "Max Connections Per Torrent"
|
|
||||||
msgstr "种子连接数限制"
|
|
||||||
|
|
||||||
msgid "The max number of connections per torrent."
|
|
||||||
msgstr "每个种子的最大连接数。"
|
|
||||||
|
|
||||||
msgid "Max Uploads"
|
|
||||||
msgstr "最大上传数"
|
|
||||||
|
|
||||||
msgid "The max number of connected peers."
|
|
||||||
msgstr "全局最大上传线程数。"
|
|
||||||
|
|
||||||
msgid "Max Uploads Per Torrent"
|
|
||||||
msgstr "种子上传限制"
|
|
||||||
|
|
||||||
msgid "The max number of connected peers per torrent."
|
|
||||||
msgstr "每个种子上传线程最大值。"
|
|
||||||
|
|
||||||
msgid "Share rate limit"
|
|
||||||
msgstr "分享率限制"
|
|
||||||
|
|
||||||
msgid "Max Ratio"
|
|
||||||
msgstr "最大的分享率"
|
|
||||||
|
|
||||||
msgid "The max ratio for seeding. -1 is to disable the seeding."
|
|
||||||
msgstr "分享的最大比例设定。-1是禁用做种。"
|
|
||||||
|
|
||||||
msgid "Max Seeding Minutes"
|
|
||||||
msgstr "最大做种时间"
|
|
||||||
|
|
||||||
msgid "Units: minutes"
|
|
||||||
msgstr "做种最大比例设定。单位:分钟"
|
|
||||||
|
|
||||||
msgid "Max Ratio Action"
|
|
||||||
msgstr "达到后"
|
|
||||||
|
|
||||||
msgid "The action when reach the max seeding ratio."
|
|
||||||
msgstr "达到设定分享率和时间后的动作。"
|
|
||||||
|
|
||||||
msgid "Pause them"
|
|
||||||
msgstr "暂停"
|
|
||||||
|
|
||||||
msgid "Remove them"
|
|
||||||
msgstr "删除"
|
|
||||||
|
|
||||||
msgid "Queueing Setting"
|
|
||||||
msgstr "种子排队设置"
|
|
||||||
|
|
||||||
msgid "Enable Torrent Queueing"
|
|
||||||
msgstr "启用种子排队"
|
|
||||||
|
|
||||||
msgid "Maximum Active Downloads"
|
|
||||||
msgstr "最大活动的下载数"
|
|
||||||
|
|
||||||
msgid "Max Active Uploads"
|
|
||||||
msgstr "最大活动的上传数"
|
|
||||||
|
|
||||||
msgid "Max Active Torrents"
|
|
||||||
msgstr "最大活动的种子数"
|
|
||||||
|
|
||||||
msgid "Ignore Slow Torrents"
|
|
||||||
msgstr "忽略慢速的种子"
|
|
||||||
|
|
||||||
msgid "Do not count slow torrents in these limits."
|
|
||||||
msgstr "慢速的种子不包在括限制内。"
|
|
||||||
|
|
||||||
msgid "Download rate threshold"
|
|
||||||
msgstr "下载速度阈值"
|
|
||||||
|
|
||||||
msgid "Upload rate threshold"
|
|
||||||
msgstr "上传速度阈值"
|
|
||||||
|
|
||||||
msgid "Units: KiB/s"
|
|
||||||
msgstr "单位:KiB/s"
|
|
||||||
|
|
||||||
msgid "Torrent inactivity timer"
|
|
||||||
msgstr "种子不活动时间"
|
|
||||||
|
|
||||||
msgid "Units: seconds"
|
|
||||||
msgstr "时间单位:分钟"
|
|
||||||
|
|
||||||
msgid "WebUI Settings"
|
|
||||||
msgstr "WebUI设置"
|
|
||||||
|
|
||||||
msgid "Username"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgid "Password"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgid "Use UPnP for WebUI"
|
|
||||||
msgstr "WebUI端口转发"
|
|
||||||
|
|
||||||
msgid "Using the UPnP / NAT-PMP port of the router for connecting to WebUI."
|
|
||||||
msgstr "使用路由器的UPnP/NAT-PMP端口转发到WebUI。"
|
|
||||||
|
|
||||||
msgid "The login name for WebUI."
|
|
||||||
msgstr "WebUI的登录用户名设置。"
|
|
||||||
|
|
||||||
msgid "The login password for WebUI."
|
|
||||||
msgstr "WebUI用户的登录密码设置。"
|
|
||||||
|
|
||||||
msgid "The listening port for WebUI."
|
|
||||||
msgstr "WebUI的登录端口设置。默认端口:8080"
|
|
||||||
|
|
||||||
msgid "CSRF Protection"
|
|
||||||
msgstr "CSRF保护"
|
|
||||||
|
|
||||||
msgid "Enable Cross-Site Request Forgery (CSRF) protection."
|
|
||||||
msgstr "启用跨站点请求伪造(CSRF)保护。"
|
|
||||||
|
|
||||||
msgid "Clickjacking Protection"
|
|
||||||
msgstr "劫持保护"
|
|
||||||
|
|
||||||
msgid "Enable clickjacking protection."
|
|
||||||
msgstr "启用点击劫持保护。"
|
|
||||||
|
|
||||||
msgid "Host Header Validation"
|
|
||||||
msgstr "主机标头验证"
|
|
||||||
|
|
||||||
msgid "Validate the host header."
|
|
||||||
msgstr "启用主机标头验证."
|
|
||||||
|
|
||||||
msgid "Local Host Authentication"
|
|
||||||
msgstr "本地主机认证"
|
|
||||||
|
|
||||||
msgid "Force authentication for clients on localhost."
|
|
||||||
msgstr "强制对本地主机上的客户端进行身份验证。"
|
|
||||||
|
|
||||||
msgid "Enable Subnet Whitelist"
|
|
||||||
msgstr "使子网白名单"
|
|
||||||
|
|
||||||
msgid "Subnet Whitelist"
|
|
||||||
msgstr "输入IP地址"
|
|
||||||
|
|
||||||
msgid "Skip authentication for clients in the IP subnet white list."
|
|
||||||
msgstr "对IP子网白名单中的客户端跳过身份验证."
|
|
||||||
|
|
||||||
msgid "Advance Settings"
|
|
||||||
msgstr "高级设置"
|
|
||||||
|
|
||||||
msgid "Anonymous Mode"
|
|
||||||
msgstr "匿名模式"
|
|
||||||
|
|
||||||
msgid "When enabled, qBittorrent will take certain measures to try"
|
|
||||||
msgstr "启用后,qBittorrent将采取某些措施隐藏其身份。"
|
|
||||||
|
|
||||||
msgid "Super Seeding"
|
|
||||||
msgstr "超级种子"
|
|
||||||
|
|
||||||
msgid "The super seeding mode."
|
|
||||||
msgstr "超级种子模式。"
|
|
||||||
|
|
||||||
msgid "Limit Overhead Usage"
|
|
||||||
msgstr "开销限制"
|
|
||||||
|
|
||||||
msgid "The overhead usage is been limitted."
|
|
||||||
msgstr "对传送总开销进行速度限制。"
|
|
||||||
|
|
||||||
msgid "Ignore LAN Limit"
|
|
||||||
msgstr "LAN限制"
|
|
||||||
|
|
||||||
msgid "Ignore the speed limit to LAN."
|
|
||||||
msgstr "忽略对LAN的速度限制。"
|
|
||||||
|
|
||||||
msgid "Use os Cache"
|
|
||||||
msgstr "使用OS操作系统缓存管理"
|
|
||||||
|
|
||||||
msgid "Max Outgoing Port"
|
|
||||||
msgstr "端口设置"
|
|
||||||
|
|
||||||
msgid The max outgoing port.""
|
|
||||||
msgstr "最大输出端口。"
|
|
||||||
|
|
||||||
msgid "Min Outgoing Port"
|
|
||||||
msgstr "端口设置"
|
|
||||||
|
|
||||||
msgid "The min outgoing port."
|
|
||||||
msgstr "最小输出端口。"
|
|
||||||
|
|
||||||
msgid "Choking Algorithm"
|
|
||||||
msgstr "数据传输算法"
|
|
||||||
|
|
||||||
msgid "The strategy of choking algorithm."
|
|
||||||
msgstr "数据传输算法的策略。"
|
|
||||||
|
|
||||||
msgid "Round Robin"
|
|
||||||
msgstr "负载均衡"
|
|
||||||
|
|
||||||
msgid "Fastest Upload"
|
|
||||||
msgstr "最快上传"
|
|
||||||
|
|
||||||
msgid "Anti-Leech"
|
|
||||||
msgstr "反吸血"
|
|
||||||
|
|
||||||
msgid "Announce To All Trackers"
|
|
||||||
msgstr "对所有Trackers宣告"
|
|
||||||
|
|
||||||
msgid "Announce To All Tiers"
|
|
||||||
msgstr "对所有Tiers宣告"
|
|
||||||
|
|
||||||
msgid "configuration file"
|
|
||||||
msgstr "配置文件"
|
|
||||||
|
|
||||||
msgid "Operation log"
|
|
||||||
msgstr "运行日志"
|
|
||||||
|
|
||||||
msgid "This page is the log document content of qbittorrent."
|
|
||||||
msgstr "本页是qBittorrent的日志文档内容。"
|
|
||||||
|
|
||||||
msgid "This page is the content of the configuration document under /etc/config/qbittorrent."
|
|
||||||
msgstr "本页是/etc/config/qbittorrent下的配置文档内容。"
|
|
||||||
|
|
||||||
|
|||||||
@ -1,19 +1,11 @@
|
|||||||
|
|
||||||
|
config basic
|
||||||
|
option program_dir '/usr/bin'
|
||||||
|
option library_dir '/usr/lib'
|
||||||
|
option profile_dir '/root'
|
||||||
|
option enable '0'
|
||||||
|
|
||||||
config qbittorrent 'main'
|
config Preferences
|
||||||
option user 'root'
|
option download_dir '/root/download'
|
||||||
option Locale 'zh'
|
option port '8080'
|
||||||
option BTProtocol 'Both'
|
|
||||||
option DisableAutoTMMByDefault 'true'
|
|
||||||
option CategoryChanged 'false'
|
|
||||||
option DefaultSavePathChanged 'true'
|
|
||||||
option CategorySavePathChanged 'true'
|
|
||||||
option Encryption '0'
|
|
||||||
option MaxRatioAction '0'
|
|
||||||
option CSRFProtection 'false'
|
|
||||||
option SeedChokingAlgorithm 'FastestUpload'
|
|
||||||
option Enabled 'false'
|
|
||||||
option Port '8080'
|
|
||||||
option profile '/opt'
|
|
||||||
option enabled '0'
|
|
||||||
|
|
||||||
|
|||||||
@ -1,264 +1,79 @@
|
|||||||
#!/bin/sh /etc/rc.common
|
#!/bin/sh /etc/rc.common
|
||||||
# Licensed to the public under the Apache License 2.0.
|
|
||||||
# ubus call service list
|
|
||||||
|
|
||||||
START=99
|
START=99
|
||||||
|
|
||||||
USE_PROCD=1
|
get_config()
|
||||||
|
{
|
||||||
NAME=qbittorrent
|
config_get_bool enable $1 enable 0
|
||||||
args=/usr/bin/qbittorrent-nox
|
|
||||||
|
|
||||||
QBT_PID_FILE=/var/run/qbittorrent.pid
|
|
||||||
QBT_INI_FILE=/tmp/qBittorrent/config/qBittorrent.conf
|
|
||||||
|
|
||||||
QBT_INSTANCE=""
|
|
||||||
|
|
||||||
_info() {
|
|
||||||
logger -p daemon.info -t "$NAME" "$*"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_err() {
|
config_qbittorrent()
|
||||||
logger -p daemon.err -t "$NAME" "$*"
|
{
|
||||||
}
|
local download_dir
|
||||||
|
local port
|
||||||
|
config_get download_dir $1 download_dir
|
||||||
|
config_get port $1 port
|
||||||
|
if [ -f $2/qBittorrent/config/qBittorrent.conf ]; then
|
||||||
|
sed -i 's/WebUI\\Port=[0-9]*/WebUI\\Port='"$port"'/g' $2/qBittorrent/config/qBittorrent.conf
|
||||||
|
sed -i 's/Downloads\\SavePath=[a-z,/]*//g' $2/qBittorrent/config/qBittorrent.conf
|
||||||
|
echo "Downloads\SavePath=$down" >> $2/qBittorrent/config/qBittorrent.conf
|
||||||
|
else
|
||||||
|
cat>$2/qBittorrent/config/qBittorrent.conf<<EOF
|
||||||
|
[AutoRun]
|
||||||
|
enabled=false
|
||||||
|
program=
|
||||||
|
|
||||||
validate_QBT () {
|
|
||||||
uci_validate_section "$NAME" vlmcsd "$1" \
|
|
||||||
'enabled:bool:1' \
|
|
||||||
'user:string:root' \
|
|
||||||
'profile:string:/tmp' \
|
|
||||||
'configuration:string' \
|
|
||||||
'DHT:or("true","false"):true' \
|
|
||||||
'Encryption:or("0","1","2"):0' \
|
|
||||||
'LSD:or("true","false"):true' \
|
|
||||||
'MaxConnecs:integer' \
|
|
||||||
'MaxConnecsPerTorrent:integer' \
|
|
||||||
'MaxRatio:float' \
|
|
||||||
'MaxRatioAction:or("0","1")' \
|
|
||||||
'MaxUploads:integer' \
|
|
||||||
'MaxUploadsPerTorrent:integer' \
|
|
||||||
'PeX:or("true","false"):true' \
|
|
||||||
'uTP_rate_limited:or("true","false"):true' \
|
|
||||||
'PortRangeMin:port' \
|
|
||||||
'InetAddress:string' \
|
|
||||||
'UPnP:or("true","false"):true' \
|
|
||||||
'GlobalDLLimit:float' \
|
|
||||||
'GlobalDLLimitAlt:float' \
|
|
||||||
'GlobalUPLimit:float' \
|
|
||||||
'GlobalUPLimitAlt:float' \
|
|
||||||
'DiskWriteCacheSize:integer' \
|
|
||||||
'DiskWriteCacheTTL:integer' \
|
|
||||||
'FinishedTorrentExportDir:string' \
|
|
||||||
'PreAllocation:or("true","false"):false' \
|
|
||||||
'SavePath:string:/tmp/download' \
|
|
||||||
'StartInPause:or("true","false"):false' \
|
|
||||||
'TempPathEnabled:or("true","false"):true' \
|
|
||||||
'TempPath:string:temp/' \
|
|
||||||
'UseIncompleteExtension:or("true","false"):false' \
|
|
||||||
'TorrentExportDir:string' \
|
|
||||||
'Locale:string:en' \
|
|
||||||
'UseRandomPort:or("true","false"):true' \
|
|
||||||
'IgnoreSlowTorrents:or("true","false")' \
|
|
||||||
'MaxActiveDownloads:integer' \
|
|
||||||
'MaxActiveTorrents:integer' \
|
|
||||||
'MaxActiveUploads:integer' \
|
|
||||||
'QueueingEnabled:or("true","false")' \
|
|
||||||
'AuthSubnetWhitelist:string' \
|
|
||||||
'AuthSubnetWhitelistEnabled:or("true","false"):false' \
|
|
||||||
'ClickjackingProtection:or("true","false"):true' \
|
|
||||||
'CSRFProtection:or("true","false"):true' \
|
|
||||||
'HostHeaderValidation:or("true","false"):true' \
|
|
||||||
'LocalHostAuth:or("true","false"):true' \
|
|
||||||
'Password:string' \
|
|
||||||
'Port:port:8080' \
|
|
||||||
'Username:string' \
|
|
||||||
'UseUPnP:or("true","false"):true' \
|
|
||||||
'AnonymousMode:or("true","false"):true' \
|
|
||||||
'AnnounceToAllTrackers:or("true","false")' \
|
|
||||||
'IgnoreLimitsLAN:or("true","false"):true' \
|
|
||||||
'IncludeOverhead:or("true","false"):false' \
|
|
||||||
'osCache:or("true","false")' \
|
|
||||||
'OutgoingPortsMax:port' \
|
|
||||||
'OutgoingPortsMin:port' \
|
|
||||||
'AnnounceToAllTiers:or("true","false")' \
|
|
||||||
'BTProtocol:or("Both","TCP","UTP")' \
|
|
||||||
'CreateTorrentSubfolder:or("true","false"):true' \
|
|
||||||
'DisableAutoTMMByDefault:or("true","false"):true' \
|
|
||||||
'SuperSeeding:or("true","false"):false' \
|
|
||||||
'GlobalMaxSeedingMinutes:integer' \
|
|
||||||
'SeedChokingAlgorithm:or("RoundRobin","FastestUpload","AntiLeech")' \
|
|
||||||
'SlowTorrentsDownloadRate:integer' \
|
|
||||||
'SlowTorrentsInactivityTimer:integer' \
|
|
||||||
'SlowTorrentsUploadRate:integer' \
|
|
||||||
'CategoryChanged:or("true","false"):false' \
|
|
||||||
'CategorySavePathChanged:or("true","false"):true' \
|
|
||||||
'DefaultSavePathChanged:or("true","false"):true' \
|
|
||||||
'AutoDeleteAddedTorrentFile:or("Never","IfAdded"):Never' \
|
|
||||||
'Enabled:or("true","false")' \
|
|
||||||
'Path:string' \
|
|
||||||
'Backup:or("true","false")' \
|
|
||||||
'DeleteOld:or("true","false")' \
|
|
||||||
'MaxSizeBytes:integer' \
|
|
||||||
'SaveTime:string'
|
|
||||||
}
|
|
||||||
|
|
||||||
sed_options () {
|
|
||||||
local Anchor=$1
|
|
||||||
local category=$( echo $2 | sed 's/\s/\\\\/g' )
|
|
||||||
shift
|
|
||||||
shift
|
|
||||||
|
|
||||||
if [ $( sed -n '/^\['"$Anchor"'\]/p' $QBT_INI_FILE | wc -l ) -lt 1 ]; then
|
|
||||||
sed -i '$a\\n\['"$Anchor"'\]' "$QBT_INI_FILE"
|
|
||||||
fi
|
|
||||||
|
|
||||||
local o; local v; local ol
|
|
||||||
for o in "$@"; do
|
|
||||||
v=$( echo "$(eval echo "\$$o")" | sed 's/[\/\.]/\\&/g' )
|
|
||||||
[ -n "$category" ] && ol="$category\\\\$o" || ol="$o"
|
|
||||||
|
|
||||||
[ -n "$v" ] && {
|
|
||||||
if [ $( sed -n '/^'"$ol"'=/p' $QBT_INI_FILE | wc -l ) -lt 1 ]; then
|
|
||||||
sed -i '/'"$Anchor"'/a'"$ol"'='"$v" "$QBT_INI_FILE"
|
|
||||||
else
|
|
||||||
sed -i 's/'"$ol"'=.*/'"$ol"'='"$v"'/g' "$QBT_INI_FILE"
|
|
||||||
fi
|
|
||||||
} || {
|
|
||||||
sed -i '/'"$ol"'=.*/d' "$QBT_INI_FILE"
|
|
||||||
}
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
config_QBT () {
|
|
||||||
local Password_ha1="";local Age="";local AgeType=""
|
|
||||||
[ -n "$Password" ] && \
|
|
||||||
Password_ha1="@ByteArray($(echo -n $Password|md5sum|grep -oE '[a-z0-9]{32}'))"
|
|
||||||
|
|
||||||
[ -n "$SaveTime" ] && {
|
|
||||||
[ -n "$(echo $SaveTime | sed 's/[0-9dmyDMY]//g')" ] && { _err "Error save time setted."; return 1; }
|
|
||||||
|
|
||||||
Age="$(echo $SaveTime | sed 's/[dmyDMY]//g')"
|
|
||||||
AgeType="$(echo $SaveTime | sed 's/[0-9]//g' | sed 's/[dD]/0/g' | sed 's/[mM]/1/g' | sed 's/[yY]/2/g')"
|
|
||||||
}
|
|
||||||
|
|
||||||
[ -f "$QBT_INI_FILE" ] || {
|
|
||||||
cat>"$QBT_INI_FILE"<<EOF
|
|
||||||
[LegalNotice]
|
[LegalNotice]
|
||||||
Accepted=true
|
Accepted=true
|
||||||
|
|
||||||
[Network]
|
[Network]
|
||||||
Cookies=@Invalid()
|
Cookies=@Invalid()
|
||||||
|
|
||||||
|
[Preferences]
|
||||||
|
General\Locale=zh
|
||||||
|
Downloads\SavePath=$download_dir
|
||||||
|
General\Locale=zh
|
||||||
|
WebUI\Port=$port
|
||||||
|
WebUI\CSRFProtection=false
|
||||||
EOF
|
EOF
|
||||||
}
|
fi
|
||||||
|
|
||||||
sed_options "Core" "" \
|
|
||||||
"AutoDeleteAddedTorrentFile"
|
|
||||||
sed_options "BitTorrent" "Session DisableAutoTMMTriggers" \
|
|
||||||
"CategoryChanged" "CategorySavePathChanged" "DefaultSavePathChanged"
|
|
||||||
sed_options "BitTorrent" "Session" \
|
|
||||||
"AnnounceToAllTiers" "BTProtocol" "CreateTorrentSubfolder" "DisableAutoTMMByDefault" "GlobalMaxSeedingMinutes" \
|
|
||||||
"SeedChokingAlgorithm" "SlowTorrentsDownloadRate" "SlowTorrentsInactivityTimer" "SlowTorrentsUploadRate"
|
|
||||||
sed_options "Preferences" "WebUI" \
|
|
||||||
"AuthSubnetWhitelistEnabled" "AuthSubnetWhitelist" "CSRFProtection" \
|
|
||||||
"ClickjackingProtection" "HostHeaderValidation" "LocalHostAuth" \
|
|
||||||
"Password_ha1" "Port" "Username" "UseUPnP"
|
|
||||||
sed_options "Preferences" "Queueing" \
|
|
||||||
"IgnoreSlowTorrents" "MaxActiveDownloads" "MaxActiveTorrents" "MaxActiveUploads" \
|
|
||||||
"QueueingEnabled"
|
|
||||||
sed_options "Preferences" "General" \
|
|
||||||
"Locale" "UseRandomPort"
|
|
||||||
sed_options "Preferences" "Downloads" \
|
|
||||||
"DiskWriteCacheSize" "DiskWriteCacheTTL" "FinishedTorrentExportDir" "PreAllocation" \
|
|
||||||
"SavePath" "StartInPause" "TempPathEnabled" "TempPath" "TorrentExportDir" \
|
|
||||||
"UseIncompleteExtension"
|
|
||||||
sed_options "Preferences" "Connection" \
|
|
||||||
"GlobalDLLimit" "GlobalDLLimitAlt" "GlobalUPLimit" "GlobalUPLimitAlt" \
|
|
||||||
"PortRangeMin" "InetAddress" "UPnP"
|
|
||||||
sed_options "Preferences" "Bittorrent" \
|
|
||||||
"DHT" "Encryption" "LSD" "MaxConnecs" "MaxConnecsPerTorrent" "MaxRatio" \
|
|
||||||
"MaxRatioAction" "MaxUploads" "MaxUploadsPerTorrent" "PeX" "uTP_rate_limited"
|
|
||||||
sed_options "Preferences" "Advanced" \
|
|
||||||
"AnnounceToAllTrackers" "AnonymousMode" "IgnoreLimitsLAN" "IncludeOverhead" "osCache" "OutgoingPortsMax" \
|
|
||||||
"OutgoingPortsMin" "SuperSeeding"
|
|
||||||
sed_options "Application" "FileLogger" \
|
|
||||||
"Enabled" "Path" "Backup" "DeleteOld" "MaxSizeBytes" "Age" "AgeType"
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
init_QBT(){
|
run_qbittorrent()
|
||||||
local section="$1"
|
|
||||||
QBT_INSTANCE="${NAME}.${section}"
|
|
||||||
|
|
||||||
validate_QBT "$section" || { _err "Validation failed."; return 1; }
|
|
||||||
|
|
||||||
[ x"$enabled" = x0 ] && {
|
|
||||||
_info "Instance \"${section}\" disabled.";
|
|
||||||
procd_kill "$NAME" "$QBT_INSTANCE" >/dev/null 2>&1;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
local confdir="qBittorrent"
|
|
||||||
[ -n "$configuration" ] && {
|
|
||||||
confdir="qBittorrent_$configuration"
|
|
||||||
}
|
|
||||||
|
|
||||||
[ -d "$profile/$confdir/config" ] || {
|
|
||||||
mkdir -m 0755 -p "$profile/$confdir/config"
|
|
||||||
}
|
|
||||||
|
|
||||||
[ "$user" != "root" ] && {
|
|
||||||
[ -d "$confdir" ] && {
|
|
||||||
local groupnow="$(ls -l $profile | grep $confdir | awk '{print $3})"
|
|
||||||
local usernow="$(ls -l $profile | grep $confdir | awk '{print $4})"
|
|
||||||
|
|
||||||
[ "$usernow" != "$user" ] && { _err "Permission denied!"; return 1; }
|
|
||||||
} || {
|
|
||||||
chmod -R g+w "$profile/$confdir"
|
|
||||||
chown -R "$user":"$user" "$profile/$confdir"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[ "$AuthSubnetWhitelistEnabled" = true ] && {
|
|
||||||
AuthSubnetWhitelist="$( echo $AuthSubnetWhitelist | sed 's/ /,/g')"
|
|
||||||
} || {
|
|
||||||
AuthSubnetWhitelist="@Invalid()"
|
|
||||||
}
|
|
||||||
|
|
||||||
QBT_INI_FILE="$profile/$confdir/config/qBittorrent.conf"
|
|
||||||
config_QBT
|
|
||||||
|
|
||||||
procd_open_instance $QBT_INSTANCE
|
|
||||||
procd_set_param command $args
|
|
||||||
procd_append_param command --profile="$profile"
|
|
||||||
|
|
||||||
[ -n "$configuration" ] && {
|
|
||||||
procd_append_param command --configuration="$configuration"
|
|
||||||
}
|
|
||||||
|
|
||||||
procd_set_param respawn
|
|
||||||
procd_set_param user $user
|
|
||||||
procd_set_param file $QBT_INI_FILE
|
|
||||||
procd_set_param pidfile $QBT_PID_FILE
|
|
||||||
procd_close_instance
|
|
||||||
}
|
|
||||||
|
|
||||||
service_triggers()
|
|
||||||
{
|
{
|
||||||
procd_add_reload_trigger "$NAME"
|
local enable
|
||||||
|
config_get_bool enable $1 enable
|
||||||
|
|
||||||
|
if [ $enable ]; then
|
||||||
|
local profile_dir
|
||||||
|
config_get profile_dir $1 profile_dir
|
||||||
|
config_foreach config_qbittorrent 'Preferences' $profile_dir
|
||||||
|
if [ "$profile_dir" != "" ]; then
|
||||||
|
mkdir -p $profile_dir/qBittorrent
|
||||||
|
ln -sf /etc/qBittorrent/ipfilter.dat $profile_dir/qBittorrent/ipfilter.dat
|
||||||
|
config_get library_dir $1 library_dir
|
||||||
|
config_get program_dir $1 program_dir
|
||||||
|
export PATH=$PATH:$program_dir
|
||||||
|
export LD_LIBRARY_PATH=$library_dir
|
||||||
|
qbittorrent-nox -d --profile=$profile_dir
|
||||||
|
else
|
||||||
|
echo "no profile_dir,stop!"
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
start_service() {
|
start()
|
||||||
config_load "$NAME"
|
{
|
||||||
config_foreach init_QBT "$NAME"
|
|
||||||
}
|
|
||||||
|
|
||||||
reload_service() {
|
|
||||||
restart
|
|
||||||
}
|
|
||||||
|
|
||||||
restart() {
|
|
||||||
stop
|
stop
|
||||||
sleep 2
|
local profile_path
|
||||||
start
|
config_load 'qbittorrent'
|
||||||
|
config_foreach get_config basic
|
||||||
|
[ $enable -eq 0 ] && exit 0
|
||||||
|
config_foreach run_qbittorrent 'basic'
|
||||||
|
}
|
||||||
|
|
||||||
|
stop()
|
||||||
|
{
|
||||||
|
killall qbittorrent-nox >/dev/null 2>&1
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,21 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
uci -q batch <<-EOF >/dev/null
|
|
||||||
delete ucitrack.@qbittorrent[-1]
|
|
||||||
add ucitrack qbittorrent
|
|
||||||
set ucitrack.@qbittorrent[-1].init=qbittorrent
|
|
||||||
commit ucitrack
|
|
||||||
EOF
|
|
||||||
|
|
||||||
if [ ."$(uci -q get qbittorrent.main)" != ."qbittorrent" ]; then
|
|
||||||
uci -q batch <<-EOF >/dev/null
|
|
||||||
add qbittorrent qbittorrent
|
|
||||||
rename qbittorrent.@qbittorrent[-1]="main"
|
|
||||||
set qbittorrent.main.enabled=0
|
|
||||||
set qbittorrent.main.profile="/tmp"
|
|
||||||
commit qbittorrent
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -f /tmp/luci-indexcache
|
|
||||||
exit 0
|
|
||||||
12
package/lean/luci-app-qbittorrent/root/etc/uci-defaults/qbittorrent
Executable file
12
package/lean/luci-app-qbittorrent/root/etc/uci-defaults/qbittorrent
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
uci -q batch <<-EOF >/dev/null
|
||||||
|
delete ucitrack.@qbittorrent[-1]
|
||||||
|
add ucitrack qbittorrent
|
||||||
|
set ucitrack.@qbittorrent[-1].init=qbittorrent
|
||||||
|
commit ucitrack
|
||||||
|
EOF
|
||||||
|
|
||||||
|
/etc/init.d/qbittorrent stop
|
||||||
|
rm -f /tmp/luci-indexcache
|
||||||
|
exit 0
|
||||||
@ -1,14 +1,14 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=qbittorrent
|
PKG_NAME:=qBittorrent-Enhanced-Edition
|
||||||
PKG_VERSION:=4.1.9
|
PKG_VERSION:=4.2.1.10
|
||||||
PKG_RELEASE=5
|
PKG_RELEASE=5
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-release-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-release-$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE_URL:=https://codeload.github.com/qbittorrent/qBittorrent/tar.gz/release-$(PKG_VERSION)?
|
PKG_SOURCE_URL:=https://codeload.github.com/c0re100/qBittorrent-Enhanced-Edition/tar.gz/release-$(PKG_VERSION)?
|
||||||
PKG_HASH:=620127f73f88ed3f2b2e4195cbc641f7c27f967d3b045e45f7916c0995fd61fe
|
PKG_HASH:=78b0116c00d791328d2ad4f84f7447e2208bf0eb5798c4da2ae4404ac00cad2b
|
||||||
|
|
||||||
PKG_BUILD_DIR:=$(BUILD_DIR)/qBittorrent-release-$(PKG_VERSION)
|
PKG_BUILD_DIR:=$(BUILD_DIR)/qBittorrent-Enhanced-Edition-release-$(PKG_VERSION)
|
||||||
|
|
||||||
PKG_LICENSE:=GPL-2.0+
|
PKG_LICENSE:=GPL-2.0+
|
||||||
PKG_LICENSE_FILES:=COPYING
|
PKG_LICENSE_FILES:=COPYING
|
||||||
@ -19,16 +19,16 @@ PKG_USE_MIPS16:=0
|
|||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
define Package/qBittorrent
|
define Package/$(PKG_NAME)
|
||||||
SUBMENU:=BitTorrent
|
SUBMENU:=BitTorrent
|
||||||
SECTION:=net
|
SECTION:=net
|
||||||
CATEGORY:=Network
|
CATEGORY:=Network
|
||||||
TITLE:=bittorrent client programmed in C++ / Qt
|
TITLE:=bittorrent client programmed in C++ / Qt
|
||||||
URL:=https://www.qbittorrent.org/
|
URL:=https://github.com/c0re100/qBittorrent-Enhanced-Edition
|
||||||
DEPENDS:=+qt5-core +qt5-network +qt5-xml +rblibtorrent
|
DEPENDS:=+qt5-core +qt5-network +qt5-xml +rblibtorrent
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/qBittorrent/description
|
define Package/$(PKG_NAME)/description
|
||||||
qBittorrent is a bittorrent client programmed in C++ / Qt that uses
|
qBittorrent is a bittorrent client programmed in C++ / Qt that uses
|
||||||
libtorrent (sometimes called libtorrent-rasterbar) by Arvid Norberg.
|
libtorrent (sometimes called libtorrent-rasterbar) by Arvid Norberg.
|
||||||
It aims to be a good alternative to all other bittorrent clients out
|
It aims to be a good alternative to all other bittorrent clients out
|
||||||
@ -49,11 +49,13 @@ define Build/Prepare
|
|||||||
$(SED) '/<context>/{:a;N;/<\/context>/!ba;/\/gui\//d}' `ls $(PKG_BUILD_DIR)/src/lang/qbittorrent_*.ts`
|
$(SED) '/<context>/{:a;N;/<\/context>/!ba;/\/gui\//d}' `ls $(PKG_BUILD_DIR)/src/lang/qbittorrent_*.ts`
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/qBittorrent/install
|
define Package/$(PKG_NAME)/install
|
||||||
$(INSTALL_DIR) $(1)/usr/man/man1
|
$(INSTALL_DIR) $(1)/usr/man/man1
|
||||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/man/man1/qbittorrent-nox.1 $(1)/usr/man/man1/qbittorrent-nox.1
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/man/man1/qbittorrent-nox.1 $(1)/usr/man/man1/qbittorrent-nox.1
|
||||||
$(INSTALL_DIR) $(1)/usr/bin
|
$(INSTALL_DIR) $(1)/usr/bin
|
||||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/qbittorrent-nox $(1)/usr/bin
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/qbittorrent-nox $(1)/usr/bin
|
||||||
|
$(INSTALL_DIR) $(1)/etc/qBittorrent
|
||||||
|
$(INSTALL_DATA) ./files/ipfilter.dat $(1)/etc/qBittorrent/ipfilter.dat
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(call BuildPackage,qBittorrent))
|
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||||
293
package/lean/qBittorrent-Enhanced-Edition/files/ipfilter.dat
Normal file
293
package/lean/qBittorrent-Enhanced-Edition/files/ipfilter.dat
Normal file
@ -0,0 +1,293 @@
|
|||||||
|
14.17.29.0 - 14.17.44.255 , 0 , Tencent Offline
|
||||||
|
14.17.101.0 - 14.17.101.255 , 0 , Baidu Offline
|
||||||
|
14.29.92.0 - 14.29.92.255 , 0 , Xunlei Offline
|
||||||
|
14.215.177.0 - 14.215.177.255 , 0 , Baidu Offline
|
||||||
|
23.3.68.0 - 23.3.68.255 , 0 , Tencent Offline
|
||||||
|
27.221.20.0 - 27.221.21.255 , 0 , 360
|
||||||
|
27.221.36.0 - 27.221.38.255 , 0 , Baidu Offline
|
||||||
|
36.110.198.0 - 36.110.198.255 , 0 , Baidu Offline
|
||||||
|
36.248.6.0 - 36.248.6.255 , 0 , Baidu Offline
|
||||||
|
36.250.0.0 - 36.250.0.255 , 0 , Baidu Offline
|
||||||
|
36.251.188.0 - 36.251.188.255 , 0 , Baidu Offline
|
||||||
|
42.56.64.0 - 42.56.65.255 , 0 , Tencent Offline
|
||||||
|
42.236.4.0 - 42.236.7.255 , 0 , Baidu Offline
|
||||||
|
45.113.68.0 - 45.113.71.255 , 0 , Tencent Offline
|
||||||
|
49.4.0.0 - 49.4.127.255 , 0 , HUAWEI
|
||||||
|
49.51.0.0 - 49.51.31.255 , 0 , Tencent Offline
|
||||||
|
58.48.212.0 - 58.48.212.255 , 0 , Tencent Offline
|
||||||
|
58.51.144.0 - 58.51.144.255 , 0 , Xunlei Offline
|
||||||
|
58.61.39.0 - 58.61.152.255 , 0 , Xunlei Offline
|
||||||
|
58.67.137.0 - 58.67.137.255 , 0 , Xunlei Offline
|
||||||
|
58.198.42.0 - 58.198.42.255 , 0 , Tencent Offline
|
||||||
|
58.215.118.0 - 58.215.123.255 , 0 , Baidu Offline
|
||||||
|
58.217.200.0 - 58.217.222.255 , 0 , Baidu Offline
|
||||||
|
58.220.12.0 - 58.220.12.255 , 0 , Xunlei Offline
|
||||||
|
58.222.18.0 - 58.222.25.255 , 0 , Baidu Offline
|
||||||
|
58.251.57.0 - 58.251.61.255 , 0 , Xunlei Offline
|
||||||
|
58.252.209.0 - 58.252.209.255 , 0 , Xunlei Offline
|
||||||
|
58.254.134.0 - 58.254.134.255 , 0 , Xunlei Offline
|
||||||
|
58.255.249.0 - 58.255.253.255 , 0 , Xunlei Offline
|
||||||
|
59.45.75.0 - 59.45.75.255 , 0 , Baidu Offline
|
||||||
|
59.51.81.0 - 59.51.81.255 , 0 , Baidu Offline
|
||||||
|
59.53.69.0 - 59.53.69.255 , 0 , Baidu Offline
|
||||||
|
59.53.86.0 - 59.53.86.255 , 0 , Tencent Offline
|
||||||
|
59.74.44.0 - 59.74.45.255 , 0 , Tencent Offline
|
||||||
|
60.2.237.0 - 60.2.237.255 , 0 , Tencent Offline
|
||||||
|
60.18.146.0 - 60.18.147.255 , 0 , Xunlei Offline
|
||||||
|
60.19.64.0 - 60.19.64.255 , 0 , Xunlei Offline
|
||||||
|
60.21.219.0 - 60.21.219.255 , 0 , Xunlei Offline
|
||||||
|
60.28.9.0 - 60.28.22.255 , 0 , Baidu Offline
|
||||||
|
60.160.190.0 - 60.160.190.255 , 0 , Xunlei Offline
|
||||||
|
60.211.226.0 - 60.211.226.255 , 0 , Baidu Offline
|
||||||
|
60.214.64.0 - 60.214.64.255 , 0 , Xunlei Offline
|
||||||
|
60.217.235.0 - 60.217.236.255 , 0 , Xunlei Offline
|
||||||
|
60.220.197.0 - 60.220.197.255 , 0 , Xunlei Offline
|
||||||
|
60.221.254.0 - 60.221.254.255 , 0 , Xunlei Offline
|
||||||
|
61.54.12.0 - 61.54.24.255 , 0 , Xunlei Offline
|
||||||
|
61.54.47.0 - 61.54.47.255 , 0 , Baidu Offline
|
||||||
|
61.132.226.0 - 61.132.226.255 , 0 , Baidu Offline
|
||||||
|
61.135.145.0 - 61.135.191.255 , 0 , Baidu Offline
|
||||||
|
61.137.90.0 - 61.137.90.255 , 0 , MNDISK Offline
|
||||||
|
61.137.191.0 - 61.137.191.255 , 0 , Xunlei Offline
|
||||||
|
61.138.131.0 - 61.138.131.255 , 0 , Tencent Offline
|
||||||
|
61.138.177.0 - 61.138.177.255 , 0 , Xunlei Offline
|
||||||
|
61.139.103.0 - 61.139.103.255 , 0 , Xunlei Offline
|
||||||
|
61.147.76.0 - 61.147.94.255 , 0 , Xunlei Offline
|
||||||
|
61.152.105.0 - 61.152.105.255 , 0 , Xunlei Offline
|
||||||
|
61.153.56.0 - 61.153.56.255 , 0 , Baidu Offline
|
||||||
|
61.155.149.0 - 61.155.165.255 , 0 , Baidu Offline
|
||||||
|
61.155.183.0 - 61.155.183.255 , 0 , Xunlei Offline
|
||||||
|
61.155.220.0 - 61.155.220.255 , 0 , Tencent Offline
|
||||||
|
61.160.224.0 - 61.160.224.255 , 0 , 360
|
||||||
|
61.160.230.0 - 61.160.231.255 , 0 , Tencent Offline
|
||||||
|
61.160.253.0 - 61.160.253.255 , 0 , Tencent Offline
|
||||||
|
61.164.120.0 - 61.164.120.255 , 0 , Tencent Offline
|
||||||
|
61.164.155.0 - 61.164.155.255 , 0 , Baidu Offline
|
||||||
|
61.173.85.0 - 61.173.85.255 , 0 , Xunlei Offline
|
||||||
|
61.178.227.0 - 61.178.227.255 , 0 , Xunlei Offline
|
||||||
|
61.179.109.0 - 61.179.109.255 , 0 , Baidu Offline
|
||||||
|
61.182.137.0 - 61.182.137.255 , 0 , Baidu Offline
|
||||||
|
61.183.55.0 - 61.183.55.255 , 0 , Xunlei Offline
|
||||||
|
61.188.190.0 - 61.188.190.255 , 0 , Xunlei Offline
|
||||||
|
61.235.71.0 - 61.235.71.255 , 0 , Xunlei Offline
|
||||||
|
61.240.144.0 - 61.240.144.255 , 0 , 360
|
||||||
|
64.251.96.0 - 64.251.111.255 , 0 , 360
|
||||||
|
101.4.60.0 - 101.4.61.255 , 0 , 360
|
||||||
|
101.64.181.0 - 101.64.181.255 , 0 , Baidu Offline
|
||||||
|
101.69.162.0 - 101.69.162.255 , 0 , Baidu Offline
|
||||||
|
101.71.56.0 - 101.71.56.255 , 0 , Baidu Offline
|
||||||
|
101.198.0.0 - 101.199.255.255 , 0 , 360
|
||||||
|
101.226.4.0 - 101.226.4.255 , 0 , 360
|
||||||
|
101.226.63.0 - 101.226.76.255 , 0 , Tencent Offline
|
||||||
|
101.226.180.0 - 101.226.180.255 , 0 , Xunlei Offline
|
||||||
|
101.227.130.0 - 101.227.143.255 , 0 , Tencent Offline
|
||||||
|
103.7.28.0 - 103.7.31.255 , 0 , Tencent Offline
|
||||||
|
103.28.8.0 - 103.28.11.255 , 0 , 360
|
||||||
|
103.31.200.0 - 103.31.203.255 , 0 , HUAWEI
|
||||||
|
106.38.179.0 - 106.38.179.255 , 0 , Baidu Offline
|
||||||
|
106.120.159.0 - 106.120.159.255 , 0 , Baidu Offline
|
||||||
|
110.18.246.0 - 110.18.246.255 , 0 , Baidu Offline
|
||||||
|
110.188.3.0 - 110.188.3.255 , 0 , Tencent Offline
|
||||||
|
111.13.12.0 - 111.13.113.255 , 0 , Baidu Offline
|
||||||
|
111.30.135.0 - 111.30.135.255 , 0 , Tencent Offline
|
||||||
|
111.161.24.0 - 111.161.24.255 , 0 , Xunlei Offline
|
||||||
|
111.206.36.0 - 111.206.76.255 , 0 , Baidu Offline
|
||||||
|
112.25.34.0 - 112.25.34.255 , 0 , 115 Offline
|
||||||
|
112.25.60.0 - 112.25.60.255 , 0 , 360
|
||||||
|
112.80.23.0 - 112.80.23.255 , 0 , Xunlei Offline
|
||||||
|
112.80.248.0 - 112.80.255.255 , 0 , Baidu Offline
|
||||||
|
112.87.43.0 - 112.87.43.227 , 0 , Xunlei Offline
|
||||||
|
112.90.17.0 - 112.90.17.255 , 0 , Xunlei Offline
|
||||||
|
112.117.217.0 - 112.117.217.255 , 0 , Xunlei Offline
|
||||||
|
112.253.12.0 - 112.253.12.255 , 0 , Baidu Offline
|
||||||
|
113.105.143.0 - 113.105.143.255 , 0 , 115 Offline
|
||||||
|
113.105.148.81 - 113.105.148.255 , 0 , Baidu Offline
|
||||||
|
113.107.248.0 - 113.107.248.255 , 0 , Baidu Offline
|
||||||
|
113.108.29.0 - 113.108.29.255 , 0 , Tencent Offline
|
||||||
|
113.115.10.0 - 113.115.10.255 , 0 , Tencent Offline
|
||||||
|
113.142.0.0 - 113.142.31.255 , 0 , Tencent Offline
|
||||||
|
113.200.90.0 - 113.200.90.255 , 0 , Tencent Offline
|
||||||
|
114.80.183.0 - 114.80.255.255 , 0 , Xunlei Offline
|
||||||
|
114.112.202.0 - 114.112.202.255 , 0 , Xunlei Offline
|
||||||
|
115.159.0.0 - 115.159.255.255 , 0 , Tencent Offline
|
||||||
|
115.231.38.0 - 115.231.45.255 , 0 , Xunlei Offline
|
||||||
|
115.236.96.0 - 115.236.153.255 , 0 , Tencent Offline
|
||||||
|
115.238.230.0 - 115.238.243.255 , 0 , UC Offline
|
||||||
|
115.239.210.0 - 115.239.212.255 , 0 , Baidu Offline
|
||||||
|
116.10.186.0 - 116.10.186.255 , 0 , Xunlei Offline
|
||||||
|
116.31.127.0 - 116.31.127.255 , 0 , Baidu Offline
|
||||||
|
116.55.230.0 - 116.55.255.255 , 0 , Xunlei Offline
|
||||||
|
116.57.183.0 - 116.57.255.255 , 0 , Tencent Offline
|
||||||
|
116.211.117.0 - 116.211.117.255 , 0 , Baidu Offline
|
||||||
|
116.253.190.0 - 116.253.190.255 , 0 , Tencent Offline
|
||||||
|
117.21.185.0 - 117.21.185.255 , 0 , Tencent Offline
|
||||||
|
117.25.132.0 - 117.25.132.255 , 0 , Tencent Offline
|
||||||
|
117.27.148.0 - 117.27.149.255 , 0 , Baidu Offline
|
||||||
|
117.34.6.0 - 117.34.6.255 , 0 , Tencent Offline
|
||||||
|
117.34.28.0 - 117.34.37.255 , 0 , Baidu Offline
|
||||||
|
117.34.91.0 - 117.34.91.255 , 0 , Xunlei Offline
|
||||||
|
117.34.112.0 - 117.34.112.255 , 0 , Baidu Offline
|
||||||
|
117.78.0.0 - 117.78.23.255 , 0 , HUAWEI
|
||||||
|
118.122.36.0 - 118.122.88.255 , 0 , Xunlei Offline
|
||||||
|
118.123.97.0 - 118.123.97.255 , 0 , Tencent Offline
|
||||||
|
118.123.116.0 - 118.123.223.255 , 0 , Baidu Offline
|
||||||
|
118.180.6.0 - 118.180.6.255 , 0 , Baidu Offline
|
||||||
|
119.75.208.0 - 119.75.223.255 , 0 , Baidu Offline
|
||||||
|
119.84.11.0 - 119.84.11.255 , 0 , Xunlei Offline
|
||||||
|
119.84.72.0 - 119.84.72.255 , 0 , Tencent Offline
|
||||||
|
119.84.110.0 - 119.84.114.255 , 0 , Xunlei Offline
|
||||||
|
119.97.178.0 - 119.97.183.255 , 0 , Xunlei Offline
|
||||||
|
119.120.94.0 - 119.120.94.255 , 0 , Xunlei Offline
|
||||||
|
119.134.253.0 - 119.134.253.255 , 0 , Baidu Offline
|
||||||
|
119.144.9.0 - 119.144.9.255 , 0 , Xunlei Offline
|
||||||
|
119.147.15.0 - 119.147.41.255 , 0 , Tencent Offline
|
||||||
|
119.147.99.0 - 119.147.249.255 , 0 , 115 Offline
|
||||||
|
119.167.241.0 - 119.167.241.255 , 0 , Tencent Offline
|
||||||
|
119.167.246.0 - 119.167.246.255 , 0 , Baidu Offline
|
||||||
|
119.178.12.0 - 119.178.12.255 , 0 , Xunlei Offline
|
||||||
|
119.188.11.0 - 119.188.132.255 , 0 , Xunlei Offline
|
||||||
|
119.189.1.0 - 119.189.1.255 , 0 , Xunlei Offline
|
||||||
|
120.52.114.0 - 120.52.114.255 , 0 , Baidu Offline
|
||||||
|
121.9.209.0 - 121.9.255.255 , 0 , Xunlei Offline
|
||||||
|
121.10.24.0 - 121.10.137.255 , 0 , Xunlei Offline
|
||||||
|
121.11.68.0 - 121.11.68.255 , 0 , Tencent Offline
|
||||||
|
121.12.94.0 - 121.12.94.255 , 0 , Baidu Offline
|
||||||
|
121.14.35.0 - 121.14.35.255 , 0 , Baidu Offline
|
||||||
|
121.14.82.0 - 121.14.97.255 , 0 , Xunlei Offline
|
||||||
|
121.14.131.0 - 121.14.131.255 , 0 , Tencent Offline
|
||||||
|
121.14.222.0 - 121.14.228.255 , 0 , Xunlei Offline
|
||||||
|
122.70.142.0 - 122.70.142.255 , 0 , Baidu Offline
|
||||||
|
122.136.46.0 - 122.136.46.255 , 0 , Baidu Offline
|
||||||
|
122.141.227.0 - 122.141.235.255 , 0 , Xunlei Offline
|
||||||
|
122.143.1.0 - 122.143.6.255 , 0 , Xunlei Offline
|
||||||
|
122.143.15.0 - 122.143.15.255 , 0 , 360
|
||||||
|
122.192.32.0 - 122.192.32.255 , 0 , Tencent Offline
|
||||||
|
122.193.41.0 - 122.193.41.255 , 0 , Baidu Offline
|
||||||
|
122.224.10.0 - 122.224.10.255 , 0 , Baidu Offline
|
||||||
|
122.227.15.0 - 122.227.15.255 , 0 , Tencent Offline
|
||||||
|
122.228.218.0 - 122.228.234.255 , 0 , Baidu Offline
|
||||||
|
122.228.241.0 - 122.228.255.255 , 0 , Xunlei Offline
|
||||||
|
123.66.33.0 - 123.66.33.255 , 0 , Xunlei Offline
|
||||||
|
123.125.64.0 - 123.125.115.255 , 0 , Baidu Offline
|
||||||
|
123.125.160.0 - 123.125.161.255 , 0 , 360
|
||||||
|
123.129.219.0 - 123.129.255.255 , 0 , Xunlei Offline
|
||||||
|
123.138.102.0 - 123.138.239.255 , 0 , Tencent Offline
|
||||||
|
123.151.44.0 - 123.151.138.255 , 0 , Tencent Offline
|
||||||
|
123.162.190.0 - 123.162.191.255 , 0 , Xunlei Offline
|
||||||
|
123.183.223.0 - 123.183.223.255 , 0 , Xunlei Offline
|
||||||
|
124.89.102.0 - 124.89.103.255 , 0 , Tencent Offline
|
||||||
|
124.95.156.0 - 124.95.174.255 , 0 , Xunlei Offline
|
||||||
|
124.115.1.0 - 124.115.14.255 , 0 , Tencent Offline
|
||||||
|
124.115.215.0 - 124.115.215.255 , 0 , Baidu Offline
|
||||||
|
124.160.163.0 - 124.160.171.255 , 0 , Tencent Offline
|
||||||
|
124.161.23.0 - 124.161.23.255 , 0 , Tencent Offline
|
||||||
|
124.165.216.0 - 124.165.216.255 , 0 , Baidu Offline
|
||||||
|
124.193.227.0 - 124.193.227.255 , 0 , Baidu Offline
|
||||||
|
124.225.122.0 - 124.225.122.255 , 0 , Tencent Offline
|
||||||
|
124.228.42.0 - 124.228.42.255 , 0 , Tencent Offline
|
||||||
|
124.232.148.0 - 124.232.148.255 , 0 , Xunlei Offline
|
||||||
|
124.238.238.0 - 124.238.238.255 , 0 , Baidu Offline
|
||||||
|
125.39.72.0 - 125.39.79.255 , 0 , Xunlei Offline
|
||||||
|
125.39.126.0 - 125.39.255.255 , 0 , Tencent Offline
|
||||||
|
125.46.42.0 - 125.46.42.255 , 0 , Xunlei Offline
|
||||||
|
125.78.242.0 - 125.78.247.255 , 0 , Xunlei Offline
|
||||||
|
125.218.29.0 - 125.218.29.255 , 0 , Tencent Offline
|
||||||
|
125.221.46.0 - 125.221.46.255 , 0 , Xunlei Offline
|
||||||
|
140.206.165.0 - 140.206.165.255 , 0 , Tencent Offline
|
||||||
|
159.226.50.0 - 159.226.50.255 , 0 , Baidu Offline
|
||||||
|
162.105.207.0 - 162.105.207.255 , 0 , Baidu Offline
|
||||||
|
171.111.152.0 - 171.112.96.255 , 0 , Baidu Offline
|
||||||
|
175.155.115.0 - 175.155.116.255 , 0 , Tencent Offline
|
||||||
|
180.76.0.0 - 180.76.255.255 , 0 , Baidu Offline
|
||||||
|
180.96.0.0 - 180.96.1.255 , 0 , Tencent Offline
|
||||||
|
180.97.7.0 - 180.97.7.255 , 0 , Tencent Offline
|
||||||
|
180.97.33.0 - 180.97.34.255 , 0 , Baidu Offline
|
||||||
|
180.97.151.0 - 180.97.152.255 , 0 , Xunlei Offline
|
||||||
|
180.149.131.0 - 180.149.145.255 , 0 , Baidu Offline
|
||||||
|
180.153.91.0 - 180.153.115.255 , 0 , Xunlei Offline
|
||||||
|
180.153.235.0 - 180.153.235.255 , 0 , 360
|
||||||
|
182.86.197.0 - 182.86.197.255 , 0 , Baidu Offline
|
||||||
|
182.118.13.0 - 182.118.125.255 , 0 , Xunlei Offline
|
||||||
|
182.130.10.0 - 182.130.11.255 , 0 , Tencent Offline
|
||||||
|
182.131.8.0 - 182.131.11.255 , 0 , Tencent Offline
|
||||||
|
182.140.134.0 - 182.140.177.255 , 0 , Tencent Offline
|
||||||
|
182.140.227.0 - 182.140.227.255 , 0 , 360
|
||||||
|
182.150.1.0 - 182.150.1.255 , 0 , Baidu Offline
|
||||||
|
182.247.251.0 - 182.247.251.255 , 0 , Xunlei Offline
|
||||||
|
182.254.0.0 - 182.254.255.255 , 0 , Tencent Offline
|
||||||
|
183.60.15.0 - 183.60.15.255 , 0 , Tencent Offline
|
||||||
|
183.60.131.0 - 183.60.131.255 , 0 , Baidu Offline
|
||||||
|
183.60.139.0 - 183.60.139.255 , 0 , 115 Offline
|
||||||
|
183.60.208.0 - 183.60.209.255 , 0 , Xunlei Offline
|
||||||
|
183.60.211.0 - 183.60.211.255 , 0 , 360
|
||||||
|
183.60.235.0 - 183.60.235.255 , 0 , Baidu Offline
|
||||||
|
183.61.49.0 - 183.61.49.255 , 0 , Tencent Offline
|
||||||
|
183.61.133.0 - 183.61.133.255 , 0 , Baidu Offline
|
||||||
|
183.63.33.0 - 183.63.33.255 , 0 , Xunlei Offline
|
||||||
|
183.94.216.0 - 183.94.239.255 , 0 , Xunlei Offline
|
||||||
|
183.131.32.0 - 183.131.39.255 , 0 , Baidu Offline
|
||||||
|
183.136.133.0 - 183.136.133.255 , 0 , 360
|
||||||
|
183.136.156.0 - 183.136.158.255 , 0 , Xunlei Offline
|
||||||
|
183.136.218.0 - 183.136.218.255 , 0 , Baidu Offline
|
||||||
|
183.157.36.0 - 183.157.36.255 , 0 , Xunlei Offline
|
||||||
|
183.221.245.0 - 183.221.245.255 , 0 , Baidu Offline
|
||||||
|
183.232.22.0 - 183.232.22.255 , 0 , Baidu Offline
|
||||||
|
202.38.194.0 - 202.38.194.255 , 0 , Tencent Offline
|
||||||
|
202.100.78.0 - 202.100.78.255 , 0 , Tencent Offline
|
||||||
|
202.105.139.0 - 202.105.139.255 , 0 , Xunlei Offline
|
||||||
|
202.105.182.0 - 202.105.182.255 , 0 , Tencent Offline
|
||||||
|
202.108.11.0 - 202.108.250.255 , 0 , Baidu Offline
|
||||||
|
203.195.64.0 - 203.195.95.255 , 0 , Tencent Offline
|
||||||
|
203.195.128.0 - 203.195.255.255 , 0 , Tencent Offline
|
||||||
|
203.205.128.0 - 203.205.255.255 , 0 , Tencent Offline
|
||||||
|
210.38.3.0 - 210.38.3.255 , 0 , Tencent Offline
|
||||||
|
210.39.2.0 - 210.39.2.255 , 0 , Tencent Offline
|
||||||
|
211.90.25.0 - 211.90.25.255 , 0 , Baidu Offline
|
||||||
|
211.98.168.0 - 211.98.171.255 , 0 , Xunlei Offline
|
||||||
|
211.137.100.0 - 211.137.100.255 , 0 , Xunlei Offline
|
||||||
|
211.151.210.0 - 211.151.210.255 , 0 , 115 Offline
|
||||||
|
211.162.73.0 - 211.162.73.255 , 0 , Xunlei Offline
|
||||||
|
218.6.13.0 - 218.6.13.255 , 0 , Xunlei Offline
|
||||||
|
218.8.242.0 - 218.8.242.255 , 0 , Tencent Offline
|
||||||
|
218.21.68.0 - 218.21.68.255 , 0 , Xunlei Offline
|
||||||
|
218.22.90.0 - 218.22.90.255 , 0 , Tencent Offline
|
||||||
|
218.26.232.0 - 218.26.232.255 , 0 , Xunlei Offline
|
||||||
|
218.30.73.0 - 218.30.73.255 , 0 , Tencent Offline
|
||||||
|
218.59.144.0 - 218.59.144.255 , 0 , Xunlei Offline
|
||||||
|
218.60.11.0 - 218.60.11.255 , 0 , Tencent Offline
|
||||||
|
218.75.140.0 - 218.75.140.255 , 0 , Baidu Offline
|
||||||
|
218.75.172.0 - 218.75.172.255 , 0 , Xunlei Offline
|
||||||
|
218.199.46.0 - 218.199.46.255 , 0 , Tencent Offline
|
||||||
|
219.129.83.0 - 219.129.83.255 , 0 , Xunlei Offline
|
||||||
|
219.134.132.0 - 219.134.132.255 , 0 , Xunlei Offline
|
||||||
|
219.151.4.0 - 219.151.4.255 , 0 , Tencent Offline
|
||||||
|
219.159.248.0 - 219.159.248.255 , 0 , MNDISK Offline
|
||||||
|
220.113.9.0 - 220.113.9.255 , 0 , Xunlei Offline
|
||||||
|
220.115.240.0 - 220.115.240.255 , 0 , Xunlei Offline
|
||||||
|
220.161.209.0 - 220.161.209.255 , 0 , Baidu Offline
|
||||||
|
220.170.192.0 - 220.170.192.255 , 0 , Tencent Offline
|
||||||
|
220.181.5.0 - 220.181.167.255 , 0 , Baidu Offline
|
||||||
|
220.249.103.0 - 220.249.103.255 , 0 , Xunlei Offline
|
||||||
|
221.4.246.0 - 221.4.246.255 , 0 , Xunlei Offline
|
||||||
|
221.5.8.0 - 221.5.8.255 , 0 , Xunlei Offline
|
||||||
|
221.203.176.0 - 221.204.232.255 , 0 , Xunlei Offline
|
||||||
|
221.215.87.0 - 221.215.87.255 , 0 , Xunlei Offline
|
||||||
|
221.233.79.0 - 221.233.79.255 , 0 , Baidu Offline
|
||||||
|
221.235.189.0 - 221.235.205.255 , 0 , Xunlei Offline
|
||||||
|
221.236.21.0 - 221.236.30.255 , 0 , Tencent Offline
|
||||||
|
221.238.25.0 - 221.238.25.255 , 0 , Xunlei Offline
|
||||||
|
222.24.133.0 - 222.24.133.255 , 0 , Tencent Offline
|
||||||
|
222.28.155.0 - 222.28.155.255 , 0 , Tencent Offline
|
||||||
|
222.73.49.0 - 222.73.133.255 , 0 , Xunlei Offline
|
||||||
|
222.73.183.0 - 222.73.183.255 , 0 , Tencent Offline
|
||||||
|
222.133.46.0 - 222.133.46.255 , 0 , Baidu Offline
|
||||||
|
222.141.53.0 - 222.141.53.255 , 0 , Xunlei Offline
|
||||||
|
222.141.220.0 - 222.141.220.255 , 0 , Tencent Offline
|
||||||
|
222.161.212.0 - 222.161.255.255 , 0 , Xunlei Offline
|
||||||
|
222.186.17.0 - 222.186.19.255 , 0 , Xunlei Offline
|
||||||
|
222.186.55.0 - 222.186.55.255 , 0 , Baidu Offline
|
||||||
|
222.199.144.0 - 222.199.191.255 , 0 , Baidu Offline
|
||||||
|
222.211.64.0 - 222.211.64.255 , 0 , Baidu Offline
|
||||||
|
222.215.119.0 - 222.215.119.255 , 0 , Tencent Offline
|
||||||
|
222.216.190.0 - 222.216.190.255 , 0 , Baidu Offline
|
||||||
|
222.218.45.0 - 222.218.45.255 , 0 , Baidu Offline
|
||||||
@ -1,126 +0,0 @@
|
|||||||
--- a/src/icons/icons.qrc
|
|
||||||
+++ b/src/icons/icons.qrc
|
|
||||||
@@ -250,38 +250,16 @@
|
|
||||||
<file>flags/zm.svg</file>
|
|
||||||
<file>flags/zw.svg</file>
|
|
||||||
<file>L.gif</file>
|
|
||||||
- <file>loading.png</file>
|
|
||||||
<file>qbt-theme/application-exit.svg</file>
|
|
||||||
- <file>qbt-theme/application-rss+xml.svg</file>
|
|
||||||
- <file>qbt-theme/application-x-mswinurl.svg</file>
|
|
||||||
<file>qbt-theme/checked.svg</file>
|
|
||||||
<file>qbt-theme/configure.svg</file>
|
|
||||||
- <file>qbt-theme/dialog-cancel.svg</file>
|
|
||||||
- <file>qbt-theme/dialog-information.svg</file>
|
|
||||||
- <file>qbt-theme/dialog-warning.svg</file>
|
|
||||||
<file>qbt-theme/document-edit-verify.svg</file>
|
|
||||||
<file>qbt-theme/document-edit.svg</file>
|
|
||||||
- <file>qbt-theme/document-encrypt.svg</file>
|
|
||||||
- <file>qbt-theme/document-import.svg</file>
|
|
||||||
- <file>qbt-theme/document-new.svg</file>
|
|
||||||
- <file>qbt-theme/document-properties.svg</file>
|
|
||||||
- <file>qbt-theme/document-save.svg</file>
|
|
||||||
- <file>qbt-theme/download.svg</file>
|
|
||||||
- <file>qbt-theme/edit-clear-history.svg</file>
|
|
||||||
<file>qbt-theme/edit-clear.svg</file>
|
|
||||||
<file>qbt-theme/edit-copy.svg</file>
|
|
||||||
- <file>qbt-theme/edit-cut.svg</file>
|
|
||||||
<file>qbt-theme/edit-delete.svg</file>
|
|
||||||
- <file>qbt-theme/edit-find-user.svg</file>
|
|
||||||
<file>qbt-theme/edit-find.svg</file>
|
|
||||||
- <file>qbt-theme/edit-paste.svg</file>
|
|
||||||
<file>qbt-theme/edit-rename.svg</file>
|
|
||||||
- <file>qbt-theme/folder-documents.svg</file>
|
|
||||||
- <file>qbt-theme/folder-download.svg</file>
|
|
||||||
- <file>qbt-theme/folder-new.svg</file>
|
|
||||||
- <file>qbt-theme/folder-remote.svg</file>
|
|
||||||
- <file>qbt-theme/gear.svg</file>
|
|
||||||
- <file>qbt-theme/gear32.svg</file>
|
|
||||||
<file>qbt-theme/go-bottom.svg</file>
|
|
||||||
<file>qbt-theme/go-down.svg</file>
|
|
||||||
<file>qbt-theme/go-top.svg</file>
|
|
||||||
@@ -295,43 +273,15 @@
|
|
||||||
<file>qbt-theme/kt-set-max-upload-speed.png</file>
|
|
||||||
<file>qbt-theme/list-add.svg</file>
|
|
||||||
<file>qbt-theme/list-remove.svg</file>
|
|
||||||
- <file>qbt-theme/mail-folder-inbox.svg</file>
|
|
||||||
- <file>qbt-theme/mail-mark-read.svg</file>
|
|
||||||
<file>qbt-theme/media-playback-pause.svg</file>
|
|
||||||
<file>qbt-theme/media-playback-start.svg</file>
|
|
||||||
<file>qbt-theme/media-seek-forward.svg</file>
|
|
||||||
- <file>qbt-theme/network-server.svg</file>
|
|
||||||
- <file>qbt-theme/network-wired.svg</file>
|
|
||||||
- <file>qbt-theme/object-locked.svg</file>
|
|
||||||
- <file>qbt-theme/office-chart-line.svg</file>
|
|
||||||
- <file>qbt-theme/preferences-desktop.svg</file>
|
|
||||||
- <file>qbt-theme/preferences-other.svg</file>
|
|
||||||
- <file>qbt-theme/preferences-system-network.svg</file>
|
|
||||||
- <file>qbt-theme/preferences-web-browser-cookies.svg</file>
|
|
||||||
- <file>qbt-theme/rss-config.png</file>
|
|
||||||
<file>qbt-theme/security-high.svg</file>
|
|
||||||
<file>qbt-theme/security-low.svg</file>
|
|
||||||
- <file>qbt-theme/services.svg</file>
|
|
||||||
- <file>qbt-theme/speedometer.svg</file>
|
|
||||||
<file>qbt-theme/system-log-out.svg</file>
|
|
||||||
- <file>qbt-theme/tab-close.svg</file>
|
|
||||||
- <file>qbt-theme/task-attention.svg</file>
|
|
||||||
- <file>qbt-theme/task-complete.png</file>
|
|
||||||
- <file>qbt-theme/task-ongoing.png</file>
|
|
||||||
- <file>qbt-theme/task-reject.png</file>
|
|
||||||
- <file>qbt-theme/text-plain.svg</file>
|
|
||||||
- <file>qbt-theme/tools-report-bug.svg</file>
|
|
||||||
- <file>qbt-theme/unavailable.svg</file>
|
|
||||||
- <file>qbt-theme/user-group-delete.svg</file>
|
|
||||||
- <file>qbt-theme/user-group-new.svg</file>
|
|
||||||
- <file>qbt-theme/view-calendar-journal.svg</file>
|
|
||||||
<file>qbt-theme/view-categories.svg</file>
|
|
||||||
- <file>qbt-theme/view-filter.svg</file>
|
|
||||||
- <file>qbt-theme/view-preview.svg</file>
|
|
||||||
- <file>qbt-theme/view-refresh.svg</file>
|
|
||||||
<file>qbt-theme/view-statistics.svg</file>
|
|
||||||
<file>qbt-theme/wallet-open.svg</file>
|
|
||||||
- <file>qbt-theme/webui.svg</file>
|
|
||||||
<file>skin/arrow-right.gif</file>
|
|
||||||
<file>skin/bg-dropdown.gif</file>
|
|
||||||
<file>skin/bg-handle-horizontal.gif</file>
|
|
||||||
@@ -342,7 +292,6 @@
|
|
||||||
<file>skin/completed.svg</file>
|
|
||||||
<file>skin/connected.svg</file>
|
|
||||||
<file>skin/disconnected.svg</file>
|
|
||||||
- <file>skin/dock-tabs.gif</file>
|
|
||||||
<file>skin/download.svg</file>
|
|
||||||
<file>skin/downloading.svg</file>
|
|
||||||
<file>skin/error.svg</file>
|
|
||||||
@@ -353,14 +302,11 @@
|
|
||||||
<file>skin/handle-icon-horizontal.gif</file>
|
|
||||||
<file>skin/handle-icon.gif</file>
|
|
||||||
<file>skin/knob.gif</file>
|
|
||||||
- <file>skin/logo-blank.gif</file>
|
|
||||||
<file>skin/logo.gif</file>
|
|
||||||
<file>skin/logo2.gif</file>
|
|
||||||
<file>skin/mascot.png</file>
|
|
||||||
<file>skin/paused.svg</file>
|
|
||||||
<file>skin/qbittorrent-tray.svg</file>
|
|
||||||
- <file>skin/qbittorrent-tray-dark.svg</file>
|
|
||||||
- <file>skin/qbittorrent-tray-light.svg</file>
|
|
||||||
<file>skin/qbittorrent32.png</file>
|
|
||||||
<file>skin/queued.svg</file>
|
|
||||||
<file>skin/ratio.svg</file>
|
|
||||||
@@ -370,17 +316,12 @@
|
|
||||||
<file>skin/spacer.gif</file>
|
|
||||||
<file>skin/spinner-placeholder.gif</file>
|
|
||||||
<file>skin/spinner.gif</file>
|
|
||||||
- <file>skin/splash.png</file>
|
|
||||||
<file>skin/stalledDL.svg</file>
|
|
||||||
<file>skin/stalledUP.svg</file>
|
|
||||||
<file>skin/tabs.gif</file>
|
|
||||||
<file>skin/toolbox-divider.gif</file>
|
|
||||||
- <file>skin/toolbox-divider2.gif</file>
|
|
||||||
<file>skin/uploading.svg</file>
|
|
||||||
<file>slow.png</file>
|
|
||||||
<file>slow_off.png</file>
|
|
||||||
- <file>sphere.png</file>
|
|
||||||
- <file>sphere2.png</file>
|
|
||||||
- <file>url.png</file>
|
|
||||||
</qresource>
|
|
||||||
</RCC>
|
|
||||||
@ -1,807 +0,0 @@
|
|||||||
--- a/src/base/bittorrent/peerinfo.cpp
|
|
||||||
+++ b/src/base/bittorrent/peerinfo.cpp
|
|
||||||
@@ -186,11 +186,26 @@ PeerAddress PeerInfo::address() const
|
|
||||||
m_nativeInfo.ip.port());
|
|
||||||
}
|
|
||||||
|
|
||||||
+int PeerInfo::port() const
|
|
||||||
+{
|
|
||||||
+ return m_nativeInfo.ip.port();
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
QString PeerInfo::client() const
|
|
||||||
{
|
|
||||||
return QString::fromStdString(m_nativeInfo.client);
|
|
||||||
}
|
|
||||||
|
|
||||||
+QString PeerInfo::pid() const
|
|
||||||
+{
|
|
||||||
+ return QString::fromStdString(m_nativeInfo.pid.to_string());
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+QString PeerInfo::pidtoclient() const
|
|
||||||
+{
|
|
||||||
+ return QString::fromStdString(libt::identify_client(m_nativeInfo.pid));
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
qreal PeerInfo::progress() const
|
|
||||||
{
|
|
||||||
return m_nativeInfo.progress;
|
|
||||||
--- a/src/base/bittorrent/peerinfo.h
|
|
||||||
+++ b/src/base/bittorrent/peerinfo.h
|
|
||||||
@@ -34,6 +34,7 @@
|
|
||||||
#include <QHostAddress>
|
|
||||||
|
|
||||||
#include <libtorrent/peer_info.hpp>
|
|
||||||
+#include <libtorrent/identify_client.hpp>
|
|
||||||
|
|
||||||
namespace BitTorrent
|
|
||||||
{
|
|
||||||
@@ -85,7 +86,10 @@ namespace BitTorrent
|
|
||||||
bool isPlaintextEncrypted() const;
|
|
||||||
|
|
||||||
PeerAddress address() const;
|
|
||||||
+ int port() const;
|
|
||||||
QString client() const;
|
|
||||||
+ QString pid() const;
|
|
||||||
+ QString pidtoclient() const;
|
|
||||||
qreal progress() const;
|
|
||||||
int payloadUpSpeed() const;
|
|
||||||
int payloadDownSpeed() const;
|
|
||||||
--- a/src/base/bittorrent/session.cpp
|
|
||||||
+++ b/src/base/bittorrent/session.cpp
|
|
||||||
@@ -69,6 +69,7 @@
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "base/algorithm.h"
|
|
||||||
+#include "base/bittorrent/peerinfo.h"
|
|
||||||
#include "base/exceptions.h"
|
|
||||||
#include "base/global.h"
|
|
||||||
#include "base/logger.h"
|
|
||||||
@@ -335,6 +336,8 @@ Session::Session(QObject *parent)
|
|
||||||
, m_isAltGlobalSpeedLimitEnabled(BITTORRENT_SESSION_KEY("UseAlternativeGlobalSpeedLimit"), false)
|
|
||||||
, m_isBandwidthSchedulerEnabled(BITTORRENT_SESSION_KEY("BandwidthSchedulerEnabled"), false)
|
|
||||||
, m_saveResumeDataInterval(BITTORRENT_SESSION_KEY("SaveResumeDataInterval"), 60)
|
|
||||||
+ , m_autoBanUnknownPeer(BITTORRENT_SESSION_KEY("AutoBanUnknownPeer"), true)
|
|
||||||
+ , m_showTrackerAuthWindow(BITTORRENT_SESSION_KEY("ShowTrackerAuthWindow"), true)
|
|
||||||
, m_port(BITTORRENT_SESSION_KEY("Port"), 8999)
|
|
||||||
, m_useRandomPort(BITTORRENT_SESSION_KEY("UseRandomPort"), false)
|
|
||||||
, m_networkInterface(BITTORRENT_SESSION_KEY("Interface"))
|
|
||||||
@@ -502,6 +505,7 @@ Session::Session(QObject *parent)
|
|
||||||
libt::ip_filter filter;
|
|
||||||
processBannedIPs(filter);
|
|
||||||
m_nativeSession->set_ip_filter(filter);
|
|
||||||
+ loadOfflineFilter();
|
|
||||||
}
|
|
||||||
|
|
||||||
m_categories = map_cast(m_storedCategories);
|
|
||||||
@@ -518,6 +522,17 @@ Session::Session(QObject *parent)
|
|
||||||
connect(m_refreshTimer, &QTimer::timeout, this, &Session::refresh);
|
|
||||||
m_refreshTimer->start();
|
|
||||||
|
|
||||||
+ // Unban Timer
|
|
||||||
+ m_unbanTimer = new QTimer(this);
|
|
||||||
+ m_unbanTimer->setInterval(500);
|
|
||||||
+ connect(m_unbanTimer, &QTimer::timeout, this, &Session::processUnbanRequest);
|
|
||||||
+
|
|
||||||
+ // Ban Timer
|
|
||||||
+ m_banTimer = new QTimer(this);
|
|
||||||
+ m_banTimer->setInterval(500);
|
|
||||||
+ connect(m_banTimer, &QTimer::timeout, this, &Session::autoBanBadClient);
|
|
||||||
+ m_banTimer->start();
|
|
||||||
+
|
|
||||||
m_statistics = new Statistics(this);
|
|
||||||
|
|
||||||
updateSeedingLimitTimer();
|
|
||||||
@@ -1077,6 +1092,7 @@ void Session::configure()
|
|
||||||
enableIPFilter();
|
|
||||||
else
|
|
||||||
disableIPFilter();
|
|
||||||
+ loadOfflineFilter();
|
|
||||||
m_IPFilteringChanged = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1905,6 +1921,95 @@ void Session::banIP(const QString &ip)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+bool Session::checkAccessFlags(const QString &ip)
|
|
||||||
+{
|
|
||||||
+ libt::ip_filter filter = m_nativeSession->get_ip_filter();
|
|
||||||
+ boost::system::error_code ec;
|
|
||||||
+ libt::address addr = libt::address::from_string(ip.toLatin1().constData(), ec);
|
|
||||||
+ Q_ASSERT(!ec);
|
|
||||||
+ if (ec) return false;
|
|
||||||
+ return filter.access(addr);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void Session::tempblockIP(const QString &ip)
|
|
||||||
+{
|
|
||||||
+ libt::ip_filter filter = m_nativeSession->get_ip_filter();
|
|
||||||
+ boost::system::error_code ec;
|
|
||||||
+ libt::address addr = libt::address::from_string(ip.toLatin1().constData(), ec);
|
|
||||||
+ Q_ASSERT(!ec);
|
|
||||||
+ if (ec) return;
|
|
||||||
+ filter.add_rule(addr, addr, libt::ip_filter::blocked);
|
|
||||||
+ m_nativeSession->set_ip_filter(filter);
|
|
||||||
+ insertQueue(ip);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void Session::removeBlockedIP(const QString &ip)
|
|
||||||
+{
|
|
||||||
+ libt::ip_filter filter = m_nativeSession->get_ip_filter();
|
|
||||||
+ boost::system::error_code ec;
|
|
||||||
+ libt::address addr = libt::address::from_string(ip.toLatin1().constData(), ec);
|
|
||||||
+ Q_ASSERT(!ec);
|
|
||||||
+ if (ec) return;
|
|
||||||
+ filter.add_rule(addr, addr, 0);
|
|
||||||
+ m_nativeSession->set_ip_filter(filter);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void Session::eraseIPFilter()
|
|
||||||
+{
|
|
||||||
+ q_bannedIPs.clear();
|
|
||||||
+ q_unbanTime.clear();
|
|
||||||
+ if (isIPFilteringEnabled()) {
|
|
||||||
+ enableIPFilter();
|
|
||||||
+ } else {
|
|
||||||
+ disableIPFilter();
|
|
||||||
+ loadOfflineFilter();
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void Session::autoBanBadClient()
|
|
||||||
+{
|
|
||||||
+ const BitTorrent::SessionStatus tStatus = BitTorrent::Session::instance()->status();
|
|
||||||
+ if (tStatus.peersCount > 0) {
|
|
||||||
+ bool m_AutoBan = BitTorrent::Session::instance()->isAutoBanUnknownPeerEnabled();
|
|
||||||
+ foreach (BitTorrent::TorrentHandle *const torrent, BitTorrent::Session::instance()->torrents()) {
|
|
||||||
+ QList<BitTorrent::PeerInfo> peers = torrent->peers();
|
|
||||||
+ foreach (const BitTorrent::PeerInfo &peer, peers) {
|
|
||||||
+ BitTorrent::PeerAddress addr = peer.address();
|
|
||||||
+ if (addr.ip.isNull()) continue;
|
|
||||||
+ QString ip = addr.ip.toString();
|
|
||||||
+ int port = peer.port();
|
|
||||||
+ QString client = peer.client();
|
|
||||||
+ QString ptoc = peer.pidtoclient();
|
|
||||||
+ QString pid = peer.pid().left(8);
|
|
||||||
+ QString country = peer.country();
|
|
||||||
+
|
|
||||||
+ QRegExp IDFilter("-(XL|SD|XF|QD|BN|DL)(\\d+)-");
|
|
||||||
+ QRegExp UAFilter("\\d+.\\d+.\\d+.\\d+");
|
|
||||||
+ if (IDFilter.exactMatch(pid) || UAFilter.exactMatch(client)) {
|
|
||||||
+ qDebug("Auto Banning bad Peer %s...", ip.toLocal8Bit().data());
|
|
||||||
+ Logger::instance()->addMessage(tr("Auto banning bad Peer '%1'...'%2'...'%3'...'%4'").arg(ip).arg(pid).arg(ptoc).arg(country));
|
|
||||||
+ tempblockIP(ip);
|
|
||||||
+ continue;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if(m_AutoBan) {
|
|
||||||
+ if (client.contains("Unknown") && country == "CN") {
|
|
||||||
+ qDebug("Auto Banning Unknown Peer %s...", ip.toLocal8Bit().data());
|
|
||||||
+ Logger::instance()->addMessage(tr("Auto banning Unknown Peer '%1'...'%2'...'%3'...'%4'").arg(ip).arg(pid).arg(ptoc).arg(country));
|
|
||||||
+ tempblockIP(ip);
|
|
||||||
+ continue;
|
|
||||||
+ }
|
|
||||||
+ if (port >= 65000 && country == "CN" && client.contains("Transmission")) {
|
|
||||||
+ qDebug("Auto Banning Offline Downloader %s...", ip.toLocal8Bit().data());
|
|
||||||
+ Logger::instance()->addMessage(tr("Auto banning Offline Downloader '%1:%2'...'%3'...'%4'...'%5'").arg(ip).arg(port).arg(pid).arg(ptoc).arg(country));
|
|
||||||
+ tempblockIP(ip);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
// Delete a torrent from the session, given its hash
|
|
||||||
// deleteLocalFiles = true means that the torrent will be removed from the hard-drive too
|
|
||||||
bool Session::deleteTorrent(const QString &hash, bool deleteLocalFiles)
|
|
||||||
@@ -2787,6 +2892,30 @@ void Session::setSaveResumeDataInterval(
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+bool Session::isAutoBanUnknownPeerEnabled() const
|
|
||||||
+{
|
|
||||||
+ return m_autoBanUnknownPeer;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void Session::setAutoBanUnknownPeer(bool value)
|
|
||||||
+{
|
|
||||||
+ if (value != isAutoBanUnknownPeerEnabled()) {
|
|
||||||
+ m_autoBanUnknownPeer = value;
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+bool Session::isShowTrackerAuthWindow() const
|
|
||||||
+{
|
|
||||||
+ return m_showTrackerAuthWindow;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void Session::setShowTrackerAuthWindow(bool value)
|
|
||||||
+{
|
|
||||||
+ if (value != isShowTrackerAuthWindow()) {
|
|
||||||
+ m_showTrackerAuthWindow = value;
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
int Session::port() const
|
|
||||||
{
|
|
||||||
static int randomPort = Utils::Random::rand(1024, 65535);
|
|
||||||
@@ -3877,6 +4006,220 @@ void Session::disableIPFilter()
|
|
||||||
m_nativeSession->set_ip_filter(filter);
|
|
||||||
}
|
|
||||||
|
|
||||||
+// Insert banned IP to Queue
|
|
||||||
+void Session::insertQueue(QString ip)
|
|
||||||
+{
|
|
||||||
+ q_bannedIPs.enqueue(ip);
|
|
||||||
+ q_unbanTime.enqueue(QDateTime::currentMSecsSinceEpoch() + 60 * 60 * 1000);
|
|
||||||
+
|
|
||||||
+ if (!m_unbanTimer->isActive()) {
|
|
||||||
+ m_unbanTimer->start();
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+// Process Unban Queue
|
|
||||||
+void Session::processUnbanRequest()
|
|
||||||
+{
|
|
||||||
+ if (q_bannedIPs.isEmpty() && q_unbanTime.isEmpty()) {
|
|
||||||
+ m_unbanTimer->stop();
|
|
||||||
+ }
|
|
||||||
+ else if (m_isActive) {
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+ else {
|
|
||||||
+ m_isActive = true;
|
|
||||||
+ int64_t currentTime = QDateTime::currentMSecsSinceEpoch();
|
|
||||||
+ int64_t nextTime = q_unbanTime.dequeue();
|
|
||||||
+ int delayTime = int(nextTime - currentTime);
|
|
||||||
+ QString nextIP = q_bannedIPs.dequeue();
|
|
||||||
+ if (delayTime < 0) {
|
|
||||||
+ QTimer::singleShot(0, [=] { BitTorrent::Session::instance()->removeBlockedIP(nextIP); m_isActive = false; });
|
|
||||||
+ }
|
|
||||||
+ else {
|
|
||||||
+ QTimer::singleShot(delayTime, [=] { BitTorrent::Session::instance()->removeBlockedIP(nextIP); m_isActive = false; });
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+// Handle ipfilter.dat
|
|
||||||
+int trim(char* const data, int start, int end)
|
|
||||||
+{
|
|
||||||
+ if (start >= end) return start;
|
|
||||||
+ int newStart = start;
|
|
||||||
+
|
|
||||||
+ for (int i = start; i <= end; ++i) {
|
|
||||||
+ if (isspace(data[i]) != 0) {
|
|
||||||
+ data[i] = '\0';
|
|
||||||
+ }
|
|
||||||
+ else {
|
|
||||||
+ newStart = i;
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ for (int i = end; i >= start; --i) {
|
|
||||||
+ if (isspace(data[i]) != 0)
|
|
||||||
+ data[i] = '\0';
|
|
||||||
+ else
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return newStart;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+int findAndNullDelimiter(char *const data, char delimiter, int start, int end)
|
|
||||||
+{
|
|
||||||
+ for (int i = start; i <= end; ++i) {
|
|
||||||
+ if (data[i] == delimiter) {
|
|
||||||
+ data[i] = '\0';
|
|
||||||
+ return i;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return -1;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+int Session::parseOfflineFilterFile(QString ipDat, libt::ip_filter &filter)
|
|
||||||
+{
|
|
||||||
+ int ruleCount = 0;
|
|
||||||
+ QFile file(ipDat);
|
|
||||||
+ if (!file.exists()) return ruleCount;
|
|
||||||
+
|
|
||||||
+ if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
|
||||||
+ LogMsg(tr("I/O Error: Could not open IP filter file in read mode."), Log::CRITICAL);
|
|
||||||
+ return ruleCount;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ std::vector<char> buffer(2 * 1024 * 1024, 0); // seems a bit faster than QVector
|
|
||||||
+ qint64 bytesRead = 0;
|
|
||||||
+ int offset = 0;
|
|
||||||
+ int start = 0;
|
|
||||||
+ int endOfLine = -1;
|
|
||||||
+ int nbLine = 0;
|
|
||||||
+
|
|
||||||
+ while (true) {
|
|
||||||
+ bytesRead = file.read(buffer.data() + offset, 2 * 1024 * 1024 - offset - 1);
|
|
||||||
+ if (bytesRead < 0)
|
|
||||||
+ break;
|
|
||||||
+ int dataSize = bytesRead + offset;
|
|
||||||
+ if (bytesRead == 0 && dataSize == 0)
|
|
||||||
+ break;
|
|
||||||
+
|
|
||||||
+ for (start = 0; start < dataSize; ++start) {
|
|
||||||
+ endOfLine = -1;
|
|
||||||
+ // The file might have ended without the last line having a newline
|
|
||||||
+ if (!(bytesRead == 0 && dataSize > 0)) {
|
|
||||||
+ for (int i = start; i < dataSize; ++i) {
|
|
||||||
+ if (buffer[i] == '\n') {
|
|
||||||
+ endOfLine = i;
|
|
||||||
+ // We need to NULL the newline in case the line has only an IP range.
|
|
||||||
+ // In that case the parser won't work for the end IP, because it ends
|
|
||||||
+ // with the newline and not with a number.
|
|
||||||
+ buffer[i] = '\0';
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ else {
|
|
||||||
+ endOfLine = dataSize;
|
|
||||||
+ buffer[dataSize] = '\0';
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (endOfLine == -1) {
|
|
||||||
+ // read the next chunk from file
|
|
||||||
+ // but first move(copy) the leftover data to the front of the buffer
|
|
||||||
+ offset = dataSize - start;
|
|
||||||
+ memmove(buffer.data(), buffer.data() + start, offset);
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+ else {
|
|
||||||
+ ++nbLine;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if ((buffer[start] == '#')
|
|
||||||
+ || ((buffer[start] == '/') && ((start + 1 < dataSize) && (buffer[start + 1] == '/')))) {
|
|
||||||
+ start = endOfLine;
|
|
||||||
+ continue;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ // Each line should follow this format:
|
|
||||||
+ // 001.009.096.105 - 001.009.096.105 , 000 , Some organization
|
|
||||||
+ // The 3rd entry is access level and if above 127 the IP range isn't blocked.
|
|
||||||
+ int firstComma = findAndNullDelimiter(buffer.data(), ',', start, endOfLine);
|
|
||||||
+ if (firstComma != -1)
|
|
||||||
+ findAndNullDelimiter(buffer.data(), ',', firstComma + 1, endOfLine);
|
|
||||||
+
|
|
||||||
+ // Check if there is an access value (apparently not mandatory)
|
|
||||||
+ if (firstComma != -1) {
|
|
||||||
+ // There is possibly one
|
|
||||||
+ const long int nbAccess = strtol(buffer.data() + firstComma + 1, nullptr, 10);
|
|
||||||
+ // Ignoring this rule because access value is too high
|
|
||||||
+ if (nbAccess > 127L) {
|
|
||||||
+ start = endOfLine;
|
|
||||||
+ continue;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ // IP Range should be split by a dash
|
|
||||||
+ int endOfIPRange = ((firstComma == -1) ? (endOfLine - 1) : (firstComma - 1));
|
|
||||||
+ int delimIP = findAndNullDelimiter(buffer.data(), '-', start, endOfIPRange);
|
|
||||||
+ if (delimIP == -1) {
|
|
||||||
+ start = endOfLine;
|
|
||||||
+ continue;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ boost::system::error_code ec;
|
|
||||||
+ int newStart = trim(buffer.data(), start, delimIP - 1);
|
|
||||||
+ libt::address startAddr = libt::address::from_string(buffer.data() + newStart, ec);
|
|
||||||
+ Q_ASSERT(!ec);
|
|
||||||
+ if (ec) {
|
|
||||||
+ start = endOfLine;
|
|
||||||
+ continue;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ newStart = trim(buffer.data(), delimIP + 1, endOfIPRange);
|
|
||||||
+ libt::address endAddr = libt::address::from_string(buffer.data() + newStart, ec);
|
|
||||||
+ Q_ASSERT(!ec);
|
|
||||||
+ if (ec) {
|
|
||||||
+ start = endOfLine;
|
|
||||||
+ continue;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if ((startAddr.is_v4() != endAddr.is_v4())
|
|
||||||
+ || (startAddr.is_v6() != endAddr.is_v6())) {
|
|
||||||
+ start = endOfLine;
|
|
||||||
+ continue;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ start = endOfLine;
|
|
||||||
+
|
|
||||||
+ filter.add_rule(startAddr, endAddr, libt::ip_filter::blocked);
|
|
||||||
+ ++ruleCount;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (start >= dataSize)
|
|
||||||
+ offset = 0;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return ruleCount;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void Session::loadOfflineFilter() {
|
|
||||||
+ int Count = 0;
|
|
||||||
+ libt::ip_filter offlineFilter = m_nativeSession->get_ip_filter();
|
|
||||||
+
|
|
||||||
+#if defined(Q_OS_WIN)
|
|
||||||
+ Count = parseOfflineFilterFile("./ipfilter.dat", offlineFilter);
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
+#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC))
|
|
||||||
+ Count = parseOfflineFilterFile(QDir::home().absoluteFilePath(".config")+"/qBittorrent/ipfilter.dat", offlineFilter);
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
+ m_nativeSession->set_ip_filter(offlineFilter);
|
|
||||||
+ Logger::instance()->addMessage(tr("Successfully parsed the offline downloader IP filter: %1 rules were applied.", "%1 is a number").arg(Count));
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
void Session::recursiveTorrentDownload(const InfoHash &hash)
|
|
||||||
{
|
|
||||||
TorrentHandle *const torrent = m_torrents.value(hash);
|
|
||||||
@@ -4063,6 +4406,7 @@ void Session::handleIPFilterParsed(int r
|
|
||||||
}
|
|
||||||
Logger::instance()->addMessage(tr("Successfully parsed the provided IP filter: %1 rules were applied.", "%1 is a number").arg(ruleCount));
|
|
||||||
emit IPFilterParsed(false, ruleCount);
|
|
||||||
+ loadOfflineFilter();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Session::handleIPFilterError()
|
|
||||||
--- a/src/base/bittorrent/session.h
|
|
||||||
+++ b/src/base/bittorrent/session.h
|
|
||||||
@@ -40,8 +40,10 @@
|
|
||||||
#include <QMap>
|
|
||||||
#include <QNetworkConfigurationManager>
|
|
||||||
#include <QPointer>
|
|
||||||
+#include <QQueue>
|
|
||||||
#include <QSet>
|
|
||||||
#include <QStringList>
|
|
||||||
+#include <QTimer>
|
|
||||||
#include <QVector>
|
|
||||||
#include <QWaitCondition>
|
|
||||||
|
|
||||||
@@ -341,6 +343,10 @@ namespace BitTorrent
|
|
||||||
|
|
||||||
uint saveResumeDataInterval() const;
|
|
||||||
void setSaveResumeDataInterval(uint value);
|
|
||||||
+ bool isAutoBanUnknownPeerEnabled() const;
|
|
||||||
+ void setAutoBanUnknownPeer(bool value);
|
|
||||||
+ bool isShowTrackerAuthWindow() const;
|
|
||||||
+ void setShowTrackerAuthWindow(bool value);
|
|
||||||
int port() const;
|
|
||||||
void setPort(int port);
|
|
||||||
bool useRandomPort() const;
|
|
||||||
@@ -467,6 +473,19 @@ namespace BitTorrent
|
|
||||||
void setMaxRatioAction(MaxRatioAction act);
|
|
||||||
|
|
||||||
void banIP(const QString &ip);
|
|
||||||
+ bool checkAccessFlags(const QString &ip);
|
|
||||||
+ void tempblockIP(const QString &ip);
|
|
||||||
+ void removeBlockedIP(const QString &ip);
|
|
||||||
+ void eraseIPFilter();
|
|
||||||
+ void autoBanBadClient();
|
|
||||||
+
|
|
||||||
+ // Unban Timer
|
|
||||||
+ bool m_isActive = false;
|
|
||||||
+ QQueue<QString> q_bannedIPs;
|
|
||||||
+ QQueue<int64_t> q_unbanTime;
|
|
||||||
+ QTimer *m_unbanTimer;
|
|
||||||
+ QTimer *m_banTimer;
|
|
||||||
+ void insertQueue(QString ip);
|
|
||||||
|
|
||||||
bool isKnownTorrent(const InfoHash &hash) const;
|
|
||||||
bool addTorrent(QString source, const AddTorrentParams ¶ms = AddTorrentParams());
|
|
||||||
@@ -546,6 +565,9 @@ namespace BitTorrent
|
|
||||||
void tagAdded(const QString &tag);
|
|
||||||
void tagRemoved(const QString &tag);
|
|
||||||
|
|
||||||
+ public slots:
|
|
||||||
+ void processUnbanRequest();
|
|
||||||
+
|
|
||||||
private slots:
|
|
||||||
void configureDeferred();
|
|
||||||
void readAlerts();
|
|
||||||
@@ -601,6 +623,8 @@ namespace BitTorrent
|
|
||||||
void populateAdditionalTrackers();
|
|
||||||
void enableIPFilter();
|
|
||||||
void disableIPFilter();
|
|
||||||
+ int parseOfflineFilterFile(QString ipDat, libtorrent::ip_filter &filter);
|
|
||||||
+ void loadOfflineFilter();
|
|
||||||
|
|
||||||
bool addTorrent_impl(CreateTorrentParams params, const MagnetUri &magnetUri,
|
|
||||||
TorrentInfo torrentInfo = TorrentInfo(),
|
|
||||||
@@ -713,6 +737,8 @@ namespace BitTorrent
|
|
||||||
CachedSettingValue<bool> m_isAltGlobalSpeedLimitEnabled;
|
|
||||||
CachedSettingValue<bool> m_isBandwidthSchedulerEnabled;
|
|
||||||
CachedSettingValue<uint> m_saveResumeDataInterval;
|
|
||||||
+ CachedSettingValue<bool> m_autoBanUnknownPeer;
|
|
||||||
+ CachedSettingValue<bool> m_showTrackerAuthWindow;
|
|
||||||
CachedSettingValue<int> m_port;
|
|
||||||
CachedSettingValue<bool> m_useRandomPort;
|
|
||||||
CachedSettingValue<QString> m_networkInterface;
|
|
||||||
--- a/src/base/bittorrent/torrenthandle.cpp
|
|
||||||
+++ b/src/base/bittorrent/torrenthandle.cpp
|
|
||||||
@@ -1561,7 +1561,8 @@ void TorrentHandle::handleTrackerErrorAl
|
|
||||||
m_trackerInfos[trackerUrl].lastMessage = message;
|
|
||||||
|
|
||||||
if (p->status_code == 401)
|
|
||||||
- m_session->handleTorrentTrackerAuthenticationRequired(this, trackerUrl);
|
|
||||||
+ if (Preferences::instance()->getShowTrackerAuthWindow())
|
|
||||||
+ m_session->handleTorrentTrackerAuthenticationRequired(this, trackerUrl);
|
|
||||||
|
|
||||||
m_session->handleTorrentTrackerError(this, trackerUrl);
|
|
||||||
}
|
|
||||||
--- a/src/base/preferences.cpp
|
|
||||||
+++ b/src/base/preferences.cpp
|
|
||||||
@@ -1090,6 +1090,26 @@ void Preferences::setTrayIconStyle(TrayI
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+bool Preferences::getAutoBanUnknownPeer() const
|
|
||||||
+{
|
|
||||||
+ return value("Preferences/Advanced/AutoBanUnknownPeer", false).toBool();
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void Preferences::setAutoBanUnknownPeer(const bool checked)
|
|
||||||
+{
|
|
||||||
+ setValue("Preferences/Advanced/AutoBanUnknownPeer", checked);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+bool Preferences::getShowTrackerAuthWindow() const
|
|
||||||
+{
|
|
||||||
+ return value("Preferences/Advanced/ShowTrackerAuthWindow", true).toBool();
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void Preferences::setShowTrackerAuthWindow(const bool checked)
|
|
||||||
+{
|
|
||||||
+ setValue("Preferences/Advanced/ShowTrackerAuthWindow", checked);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
// Stuff that don't appear in the Options GUI but are saved
|
|
||||||
// in the same file.
|
|
||||||
|
|
||||||
--- a/src/base/preferences.h
|
|
||||||
+++ b/src/base/preferences.h
|
|
||||||
@@ -300,6 +300,10 @@ public:
|
|
||||||
TrayIcon::Style trayIconStyle() const;
|
|
||||||
void setTrayIconStyle(TrayIcon::Style style);
|
|
||||||
#endif // Q_OS_MAC
|
|
||||||
+ bool getAutoBanUnknownPeer() const;
|
|
||||||
+ void setAutoBanUnknownPeer(const bool checked);
|
|
||||||
+ bool getShowTrackerAuthWindow() const;
|
|
||||||
+ void setShowTrackerAuthWindow(const bool checked);
|
|
||||||
|
|
||||||
// Stuff that don't appear in the Options GUI but are saved
|
|
||||||
// in the same file.
|
|
||||||
--- a/src/base/settingsstorage.cpp
|
|
||||||
+++ b/src/base/settingsstorage.cpp
|
|
||||||
@@ -91,6 +91,8 @@ namespace
|
|
||||||
{"BitTorrent/Session/InterfaceName", "Preferences/Connection/InterfaceName"},
|
|
||||||
{"BitTorrent/Session/InterfaceAddress", "Preferences/Connection/InterfaceAddress"},
|
|
||||||
{"BitTorrent/Session/SaveResumeDataInterval", "Preferences/Downloads/SaveResumeDataInterval"},
|
|
||||||
+ {"BitTorrent/Session/AutoBanUnknownPeer", "Preferences/Advanced/AutoBanUnknownPeer"},
|
|
||||||
+ {"BitTorrent/Session/ShowTrackerAuthWindow", "Preferences/Advanced/ShowTrackerAuthWindow"},
|
|
||||||
{"BitTorrent/Session/Encryption", "Preferences/Bittorrent/Encryption"},
|
|
||||||
{"BitTorrent/Session/ForceProxy", "Preferences/Connection/ProxyForce"},
|
|
||||||
{"BitTorrent/Session/ProxyPeerConnections", "Preferences/Connection/ProxyPeerConnections"},
|
|
||||||
--- a/src/gui/advancedsettings.cpp
|
|
||||||
+++ b/src/gui/advancedsettings.cpp
|
|
||||||
@@ -60,6 +60,8 @@ enum AdvSettingsRows
|
|
||||||
NETWORK_LISTEN_IPV6,
|
|
||||||
// behavior
|
|
||||||
SAVE_RESUME_DATA_INTERVAL,
|
|
||||||
+ CONFIRM_AUTO_BAN,
|
|
||||||
+ SHOW_TRACKER_AUTH_WINDOW,
|
|
||||||
CONFIRM_RECHECK_TORRENT,
|
|
||||||
RECHECK_COMPLETED,
|
|
||||||
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
|
|
||||||
@@ -215,6 +217,10 @@ void AdvancedSettings::saveAdvancedSetti
|
|
||||||
// Announce IP
|
|
||||||
QHostAddress addr(lineEditAnnounceIP.text().trimmed());
|
|
||||||
session->setAnnounceIP(addr.isNull() ? "" : addr.toString());
|
|
||||||
+ // Auto ban Unknown Peer
|
|
||||||
+ session->setAutoBanUnknownPeer(cb_auto_ban_unknown_peer.isChecked());
|
|
||||||
+ // Show Tracker Authenticaion Window
|
|
||||||
+ session->setShowTrackerAuthWindow(cb_show_tracker_auth_window.isChecked());
|
|
||||||
|
|
||||||
// Program notification
|
|
||||||
MainWindow *const mainWindow = static_cast<Application*>(QCoreApplication::instance())->mainWindow();
|
|
||||||
@@ -465,6 +471,12 @@ void AdvancedSettings::loadAdvancedSetti
|
|
||||||
// Announce IP
|
|
||||||
lineEditAnnounceIP.setText(session->announceIP());
|
|
||||||
addRow(ANNOUNCE_IP, tr("IP Address to report to trackers (requires restart)"), &lineEditAnnounceIP);
|
|
||||||
+ // Auto Ban Unknown Peer from China
|
|
||||||
+ cb_auto_ban_unknown_peer.setChecked(session->isAutoBanUnknownPeerEnabled());
|
|
||||||
+ addRow(CONFIRM_AUTO_BAN, tr("Auto Ban Unknown Peer from China"), &cb_auto_ban_unknown_peer);
|
|
||||||
+ // Show Tracker Authenticaion Window
|
|
||||||
+ cb_show_tracker_auth_window.setChecked(session->isShowTrackerAuthWindow());
|
|
||||||
+ addRow(SHOW_TRACKER_AUTH_WINDOW, tr("Show Tracker Authenticaion Window"), &cb_show_tracker_auth_window);
|
|
||||||
|
|
||||||
// Program notifications
|
|
||||||
const MainWindow *const mainWindow = static_cast<Application*>(QCoreApplication::instance())->mainWindow();
|
|
||||||
--- a/src/gui/advancedsettings.h
|
|
||||||
+++ b/src/gui/advancedsettings.h
|
|
||||||
@@ -65,7 +65,8 @@ private:
|
|
||||||
QCheckBox checkBoxOsCache, checkBoxRecheckCompleted, checkBoxResolveCountries, checkBoxResolveHosts, checkBoxSuperSeeding,
|
|
||||||
checkBoxProgramNotifications, checkBoxTorrentAddedNotifications, checkBoxTrackerFavicon, checkBoxTrackerStatus,
|
|
||||||
checkBoxConfirmTorrentRecheck, checkBoxConfirmRemoveAllTags, checkBoxListenIPv6, checkBoxAnnounceAllTrackers, checkBoxAnnounceAllTiers,
|
|
||||||
- checkBoxGuidedReadCache, checkBoxMultiConnectionsPerIp, checkBoxSuggestMode, checkBoxCoalesceRW, checkBoxSpeedWidgetEnabled;
|
|
||||||
+ checkBoxGuidedReadCache, checkBoxMultiConnectionsPerIp, checkBoxSuggestMode, checkBoxCoalesceRW, checkBoxSpeedWidgetEnabled,
|
|
||||||
+ cb_auto_ban_unknown_peer, cb_show_tracker_auth_window;
|
|
||||||
QComboBox comboBoxInterface, comboBoxInterfaceAddress, comboBoxUtpMixedMode, comboBoxChokingAlgorithm, comboBoxSeedChokingAlgorithm;
|
|
||||||
QLineEdit lineEditAnnounceIP;
|
|
||||||
|
|
||||||
--- a/src/gui/mainwindow.cpp
|
|
||||||
+++ b/src/gui/mainwindow.cpp
|
|
||||||
@@ -73,6 +73,7 @@
|
|
||||||
#include "addnewtorrentdialog.h"
|
|
||||||
#include "application.h"
|
|
||||||
#include "autoexpandabledialog.h"
|
|
||||||
+#include "base/bittorrent/peerinfo.h"
|
|
||||||
#include "cookiesdialog.h"
|
|
||||||
#include "downloadfromurldialog.h"
|
|
||||||
#include "executionlogwidget.h"
|
|
||||||
--- a/src/gui/properties/peerlistdelegate.h
|
|
||||||
+++ b/src/gui/properties/peerlistdelegate.h
|
|
||||||
@@ -49,6 +49,7 @@ public:
|
|
||||||
CONNECTION,
|
|
||||||
FLAGS,
|
|
||||||
CLIENT,
|
|
||||||
+ PEERID,
|
|
||||||
PROGRESS,
|
|
||||||
DOWN_SPEED,
|
|
||||||
UP_SPEED,
|
|
||||||
--- a/src/gui/properties/peerlistwidget.cpp
|
|
||||||
+++ b/src/gui/properties/peerlistwidget.cpp
|
|
||||||
@@ -75,6 +75,7 @@ PeerListWidget::PeerListWidget(Propertie
|
|
||||||
m_listModel->setHeaderData(PeerListDelegate::FLAGS, Qt::Horizontal, tr("Flags"));
|
|
||||||
m_listModel->setHeaderData(PeerListDelegate::CONNECTION, Qt::Horizontal, tr("Connection"));
|
|
||||||
m_listModel->setHeaderData(PeerListDelegate::CLIENT, Qt::Horizontal, tr("Client", "i.e.: Client application"));
|
|
||||||
+ m_listModel->setHeaderData(PeerListDelegate::PEERID, Qt::Horizontal, tr("Peer ID", "i.e.: Client Peer ID"));
|
|
||||||
m_listModel->setHeaderData(PeerListDelegate::PROGRESS, Qt::Horizontal, tr("Progress", "i.e: % downloaded"));
|
|
||||||
m_listModel->setHeaderData(PeerListDelegate::DOWN_SPEED, Qt::Horizontal, tr("Down Speed", "i.e: Download speed"));
|
|
||||||
m_listModel->setHeaderData(PeerListDelegate::UP_SPEED, Qt::Horizontal, tr("Up Speed", "i.e: Upload speed"));
|
|
||||||
@@ -288,8 +289,13 @@ void PeerListWidget::banSelectedPeers()
|
|
||||||
for (const QModelIndex &index : selectedIndexes) {
|
|
||||||
int row = m_proxyModel->mapToSource(index).row();
|
|
||||||
QString ip = m_listModel->data(m_listModel->index(row, PeerListDelegate::IP_HIDDEN)).toString();
|
|
||||||
+ QString client = m_listModel->data(m_listModel->index(row, PeerListDelegate::CLIENT)).toString();
|
|
||||||
+ QString peerid = m_listModel->data(m_listModel->index(row, PeerListDelegate::PEERID)).toString();
|
|
||||||
+ QHostAddress host;
|
|
||||||
+ host.setAddress(ip);
|
|
||||||
+ const QString countryName = Net::GeoIPManager::CountryName(Net::GeoIPManager::instance()->lookup(host));
|
|
||||||
qDebug("Banning peer %s...", ip.toLocal8Bit().data());
|
|
||||||
- Logger::instance()->addMessage(tr("Manually banning peer '%1'...").arg(ip));
|
|
||||||
+ Logger::instance()->addMessage(tr("Manually banning peer '%1'...'%2'...'%3'...'%4'").arg(ip).arg(peerid).arg(client).arg(countryName));
|
|
||||||
BitTorrent::Session::instance()->banIP(ip);
|
|
||||||
}
|
|
||||||
// Refresh list
|
|
||||||
@@ -398,6 +404,7 @@ QStandardItem *PeerListWidget::addPeer(c
|
|
||||||
m_listModel->setData(m_listModel->index(row, PeerListDelegate::FLAGS), peer.flags());
|
|
||||||
m_listModel->setData(m_listModel->index(row, PeerListDelegate::FLAGS), peer.flagsDescription(), Qt::ToolTipRole);
|
|
||||||
m_listModel->setData(m_listModel->index(row, PeerListDelegate::CLIENT), peer.client().toHtmlEscaped());
|
|
||||||
+ m_listModel->setData(m_listModel->index(row, PeerListDelegate::PEERID), peer.pid().left(8).toHtmlEscaped());
|
|
||||||
m_listModel->setData(m_listModel->index(row, PeerListDelegate::PROGRESS), peer.progress());
|
|
||||||
m_listModel->setData(m_listModel->index(row, PeerListDelegate::DOWN_SPEED), peer.payloadDownSpeed());
|
|
||||||
m_listModel->setData(m_listModel->index(row, PeerListDelegate::UP_SPEED), peer.payloadUpSpeed());
|
|
||||||
@@ -429,6 +436,7 @@ void PeerListWidget::updatePeer(const QS
|
|
||||||
m_listModel->setData(m_listModel->index(row, PeerListDelegate::FLAGS), peer.flags());
|
|
||||||
m_listModel->setData(m_listModel->index(row, PeerListDelegate::FLAGS), peer.flagsDescription(), Qt::ToolTipRole);
|
|
||||||
m_listModel->setData(m_listModel->index(row, PeerListDelegate::CLIENT), peer.client().toHtmlEscaped());
|
|
||||||
+ m_listModel->setData(m_listModel->index(row, PeerListDelegate::PEERID), peer.pid().left(8).toHtmlEscaped());
|
|
||||||
m_listModel->setData(m_listModel->index(row, PeerListDelegate::PROGRESS), peer.progress());
|
|
||||||
m_listModel->setData(m_listModel->index(row, PeerListDelegate::DOWN_SPEED), peer.payloadDownSpeed());
|
|
||||||
m_listModel->setData(m_listModel->index(row, PeerListDelegate::UP_SPEED), peer.payloadUpSpeed());
|
|
||||||
--- a/src/webui/api/appcontroller.cpp
|
|
||||||
+++ b/src/webui/api/appcontroller.cpp
|
|
||||||
@@ -153,6 +153,7 @@ void AppController::preferencesAction()
|
|
||||||
data["ip_filter_path"] = Utils::Fs::toNativePath(session->IPFilterFile());
|
|
||||||
data["ip_filter_trackers"] = session->isTrackerFilteringEnabled();
|
|
||||||
data["banned_IPs"] = session->bannedIPs().join("\n");
|
|
||||||
+ data["auto_ban_unknown_peer"] = session->isAutoBanUnknownPeerEnabled();
|
|
||||||
|
|
||||||
// Speed
|
|
||||||
// Global Rate Limits
|
|
||||||
@@ -401,6 +402,8 @@ void AppController::setPreferencesAction
|
|
||||||
session->setTrackerFilteringEnabled(m["ip_filter_trackers"].toBool());
|
|
||||||
if (m.contains("banned_IPs"))
|
|
||||||
session->setBannedIPs(m["banned_IPs"].toString().split('\n'));
|
|
||||||
+ if (m.contains("auto_ban_unknown_peer"))
|
|
||||||
+ session->setAutoBanUnknownPeer(m["auto_ban_unknown_peer"].toBool());
|
|
||||||
|
|
||||||
// Speed
|
|
||||||
// Global Rate Limits
|
|
||||||
--- a/src/webui/api/transfercontroller.cpp
|
|
||||||
+++ b/src/webui/api/transfercontroller.cpp
|
|
||||||
@@ -30,6 +30,7 @@
|
|
||||||
|
|
||||||
#include <QJsonObject>
|
|
||||||
|
|
||||||
+#include "base/logger.h"
|
|
||||||
#include "base/bittorrent/session.h"
|
|
||||||
|
|
||||||
const char KEY_TRANSFER_DLSPEED[] = "dl_info_speed";
|
|
||||||
@@ -111,3 +112,37 @@ void TransferController::speedLimitsMode
|
|
||||||
{
|
|
||||||
setResult(QString::number(BitTorrent::Session::instance()->isAltGlobalSpeedLimitEnabled()));
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+void TransferController::tempblockPeerAction()
|
|
||||||
+{
|
|
||||||
+ checkParams({"ip"});
|
|
||||||
+ QString ip = params()["ip"];
|
|
||||||
+ boost::system::error_code ec;
|
|
||||||
+ boost::asio::ip::address addr = boost::asio::ip::address::from_string(ip.toStdString(), ec);
|
|
||||||
+ bool isBanned = BitTorrent::Session::instance()->checkAccessFlags(QString::fromStdString(addr.to_string()));
|
|
||||||
+
|
|
||||||
+ if (ip.isEmpty()) {
|
|
||||||
+ setResult(QLatin1String("IP field should not be empty."));
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (ec) {
|
|
||||||
+ setResult(QLatin1String("The given IP address is not valid."));
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (isBanned) {
|
|
||||||
+ setResult(QLatin1String("The given IP address already exists."));
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ BitTorrent::Session::instance()->tempblockIP(ip);
|
|
||||||
+ Logger::instance()->addMessage(tr("Peer '%1' banned via Web API.").arg(ip));
|
|
||||||
+ setResult(QLatin1String("Done."));
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void TransferController::resetIPFilterAction()
|
|
||||||
+{
|
|
||||||
+ BitTorrent::Session::instance()->eraseIPFilter();
|
|
||||||
+ setResult(QLatin1String("Erased."));
|
|
||||||
+}
|
|
||||||
--- a/src/webui/api/transfercontroller.h
|
|
||||||
+++ b/src/webui/api/transfercontroller.h
|
|
||||||
@@ -46,4 +46,6 @@ private slots:
|
|
||||||
void downloadLimitAction();
|
|
||||||
void setUploadLimitAction();
|
|
||||||
void setDownloadLimitAction();
|
|
||||||
+ void tempblockPeerAction();
|
|
||||||
+ void resetIPFilterAction();
|
|
||||||
};
|
|
||||||
--- a/src/webui/www/private/preferences_content.html
|
|
||||||
+++ b/src/webui/www/private/preferences_content.html
|
|
||||||
@@ -377,6 +377,8 @@
|
|
||||||
<textarea id="banned_IPs_textarea" rows="5" cols="70"></textarea>
|
|
||||||
</fieldset>
|
|
||||||
</div>
|
|
||||||
+ <input type="checkbox" id="auto_ban_unknown_peer_checkbox" />
|
|
||||||
+ <label for="auto_ban_unknown_peer_checkbox">QBT_TR(Auto Ban Unknown Client From China)QBT_TR[CONTEXT=OptionsDialog]</label>
|
|
||||||
</fieldset>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@@ -1252,6 +1254,7 @@
|
|
||||||
$('ipfilter_text').setProperty('value', pref.ip_filter_path);
|
|
||||||
$('ipfilter_trackers_checkbox').setProperty('checked', pref.ip_filter_trackers);
|
|
||||||
$('banned_IPs_textarea').setProperty('value', pref.banned_IPs);
|
|
||||||
+ $('auto_ban_unknown_peer_checkbox').setProperty('checked', pref.auto_ban_unknown_peer);
|
|
||||||
updateFilterSettings();
|
|
||||||
|
|
||||||
// Speed tab
|
|
||||||
@@ -1502,6 +1505,7 @@
|
|
||||||
settings.set('ip_filter_path', $('ipfilter_text').getProperty('value'));
|
|
||||||
settings.set('ip_filter_trackers', $('ipfilter_trackers_checkbox').getProperty('checked'));
|
|
||||||
settings.set('banned_IPs', $('banned_IPs_textarea').getProperty('value'));
|
|
||||||
+ settings.set('auto_ban_unknown_peer', $('auto_ban_unknown_peer_checkbox').getProperty('checked'));
|
|
||||||
|
|
||||||
// Speed tab
|
|
||||||
// Global Rate Limits
|
|
||||||
@ -1,13 +1,13 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=rblibtorrent
|
PKG_NAME:=rblibtorrent
|
||||||
PKG_VERSION:=1.1.13
|
PKG_VERSION:=1.2.3
|
||||||
PKG_RELEASE=2
|
PKG_RELEASE=2
|
||||||
|
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE_URL:=https://github.com/arvidn/libtorrent.git
|
PKG_SOURCE_URL:=https://github.com/arvidn/libtorrent.git
|
||||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||||
PKG_SOURCE_VERSION:=6f1250c6535730897909240ea0f4f2a81937d21a
|
PKG_SOURCE_VERSION:=078f7b956ef0d992948852a801e626b1118a1fc5
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
|
|
||||||
PKG_LICENSE:=BSD
|
PKG_LICENSE:=BSD
|
||||||
@ -24,7 +24,7 @@ define Package/rblibtorrent
|
|||||||
CATEGORY:=Libraries
|
CATEGORY:=Libraries
|
||||||
TITLE:=Rasterbar BitTorrent library
|
TITLE:=Rasterbar BitTorrent library
|
||||||
URL:=https://www.libtorrent.org/
|
URL:=https://www.libtorrent.org/
|
||||||
DEPENDS:=+libstdcpp +libopenssl +boost +boost-system +boost-chrono +boost-random
|
DEPENDS:=+libstdcpp +libopenssl +boost +boost-system +boost-chrono +boost-random $(ICONV_DEPENDS)
|
||||||
MAINTAINER:=Arvid Norberg <arvid@libtorrent.org>
|
MAINTAINER:=Arvid Norberg <arvid@libtorrent.org>
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user