TorrentSearchNet 1.0.0
dotnet add package TorrentSearchNet --version 1.0.0
NuGet\Install-Package TorrentSearchNet -Version 1.0.0
<PackageReference Include="TorrentSearchNet" Version="1.0.0" />
<PackageVersion Include="TorrentSearchNet" Version="1.0.0" />
<PackageReference Include="TorrentSearchNet" />
paket add TorrentSearchNet --version 1.0.0
#r "nuget: TorrentSearchNet, 1.0.0"
#:package TorrentSearchNet@1.0.0
#addin nuget:?package=TorrentSearchNet&version=1.0.0
#tool nuget:?package=TorrentSearchNet&version=1.0.0
TorrentSearchNet
A small library that helps with finding torrents for legal file sharing.
Supports searching and file inspection through multiple torrent APIs.
NuGet: TorrentSearchNet on nuget.org
๐ฆ Installation
Install via NuGet:
dotnet add package TorrentSearchNet
๐ Quick Start
Search for torrents:
using TorrentSearchNet;
SearchResult result = await TorrentFinder.SearchAsync("ubuntu", Category.AppOther);
foreach (TorrentFileInfo file in result.Files)
{
Console.WriteLine(file); // see output example below for what this outputs
Console.WriteLine(file.GetMagnetLink()); // see output example below
}
๐ค Output Example
Ubuntu 22.04 ISO | AppOther | 3,155 MB | Seeders: 195 | Leechers: 12 | Added: 2024-06-01 | By: linuxfan
magnet:?xt=urn:btih:ABC123...&dn=Ubuntu+22.04+ISO&tr=...
Get the files contained in a torrent:
ContainedFilesResult contents = await TorrentFinder.GetContainedFilesAsync("36418511");
foreach (ContainedFilesInfo file in contents.Files)
{
Console.WriteLine($"{file.Name} - {file.Size} bytes");
}
๐ Generate a Magnet Link
You can easily get a magnet link from a TorrentFileInfo
:
TorrentFileInfo file = ...;
MagnetLink magnet = file.GetMagnetLink();
Console.WriteLine(magnet); // prints the full magnet URI
โ๏ธ Configuration
๐ Adding Custom Providers
You can add your own implementations of ITorrentApi
using:
TorrentFinder.AddTorrentApi(new MyCustomApi());
By default, the library uses a built-in provider called PhpApi
, which targets the PirateBay-like API structure. Adding your own ITorrentApi
allows you to extend or replace the default behavior, e.g., to support private trackers or alternative backends.
๐ Setting the PhpApi Base URL
The default base URL for the PhpApi
is:
PhpApiSettings.Url = "https://apibay.org";
You can override it to point to any other compatible API:
PhpApiSettings.Url = "https://thepiratebay.cloud";
๐ก Magnet Link Trackers
By default, generated magnet links include public trackers. You can view and modify them using:
MagnetLinkSettings.PublicTrackers.Add("udp://your.custom.tracker:1337/announce");
MagnetLinkSettings.PublicTrackers.RemoveAt(0); // if you want to remove defaults
๐ Models
TorrentFileInfo
.Name
โ Display name of the torrent.InfoHash
โ The info hash used in the magnet link.Size
โ Size in bytes.Seeders
,.Leechers
โ Stats.Category
โ Enum-based category.GetMagnetLink()
โ Returns aMagnetLink
instance
ContainedFilesInfo
.Name
โ File name inside the torrent.Size
โ File size in bytes
๐งช Testing
You can run your own unit tests using MSTest or another compatible test framework. The library is designed to be testable, with mockable APIs via ITorrentApi
.
โ๏ธ Legal Disclaimer
Torrenting and peer-to-peer file sharing are not inherently illegal. This library is intended solely for legal use cases, such as downloading or distributing open-source software, public domain content, or other freely licensed material.
Illegal activity, such as sharing or downloading copyrighted material without proper authorization, is illegal and may result in legal consequences depending on your jurisdiction.
The developer of this library does not condone, support, or take responsibility for the misuse of this library in any unlawful manner. Use responsibly.
๐ License
MIT License
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.0.0 | 164 | 4/20/2025 |