feat: ed2k protocol support (#1316)

This commit is contained in:
Levi authored and GitHub committed 2026-03-17 19:42:16 +08:00
1 parent f7b26753c1
commit 09f7c88ed3
35 files changed
+1129 -35

No files matched your search

@@ -59,7 +59,7 @@ class CreateView extends GetView<CreateController> {
final _btTrackerController = TextEditingController();
final _archivePasswordController = TextEditingController();
final _availableSchemes = ["http:", "https:", "magnet:"];
final _availableSchemes = ["http:", "https:", "magnet:", "ed2k:"];
final _skipVerifyCertController = false.obs;
final _autoTorrentController = Rxn<bool>();
@@ -116,6 +116,7 @@ class CreateView extends GetView<CreateController> {
jsonDecode(jsonEncode(routerParams.req!.extra)));
_btTrackerController.text = reqExtra.trackers.join("\n");
},
Protocol.ed2k: null,
};
if (routerParams.req?.extra != null) {
extraHandlers[protocol]?.call();
@@ -139,6 +140,7 @@ class CreateView extends GetView<CreateController> {
}
},
Protocol.bt: null,
Protocol.ed2k: null,
};
if (routerParams.opts?.extra != null) {
optionsHandlers[protocol]?.call();
@@ -804,6 +806,9 @@ class CreateView extends GetView<CreateController> {
uppercaseUrl.endsWith(".TORRENT")) {
protocol = Protocol.bt;
}
if (uppercaseUrl.startsWith("ED2K:")) {
protocol = Protocol.ed2k;
}
return protocol;
}
@@ -1007,6 +1012,9 @@ class CreateView extends GetView<CreateController> {
..trackers = Util.textToLines(_btTrackerController.text);
}
break;
case Protocol.ed2k:
case null:
break;
}
return reqExtra;
}