• Stars
    star
    168
  • Rank 224,461 (Top 5 %)
  • Language
    C#
  • License
    GNU General Publi...
  • Created almost 6 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A .NET Standard client library for the Soulseek network.

Soulseek.NET

NuGet version Semantic Versioning license

CircleCI codecov Maintainability Rating Reliability Rating Security Rating

A .NET Standard client library for the Soulseek network.

Quick Start

Install from NuGet.

Connect to a Soulseek server

var client = new SoulseekClient();
await client.ConnectAsync("Username", "Password");

Search for something

IEnumerable<SearchResponse> responses = await Client.SearchAsync(SearchQuery.FromText("some search"));

Note: SearchAsync accepts a SearchQuery with the constructor SearchQuery(string query, IEnumerable<string> exclusions, int? minimumBitrate, int? minimumFileSize, int? minimumFilesInFolder, bool isVBR, bool isCBR), allowing all of the options provided by the official client.

SearchResponse has the following shape:

int FileCount
IReadOnlyCollection<File> Files
int LockedFileCount
IReadOnlyCollection<File> LockedFiles
int FreeUploadSlots
long QueueLength
int Token
int UploadSpeed
string Username

File has a number of properties; you'll need for Filename and Size for downloading.

Download a file

byte[] file = await Client.DownloadAsync(username: "some username", filename: "some fully qualified filename", size: 42);

OR (ideally)

var fs = new FileStream("c:\downloads\local filename", FileMode.Create);
await Client.DownloadAsync(username: "some username", filename: "some fully qualified filename", outputStream: fs, size: 42);

Note: Download to a stream where possible to reduce memory overhead.

Documentation

The external interface of the library is sparse and well documented; the best resource is the code itself. Of particular interest:

Example Web Application

Note that the example application as been superseded by slskd and will no longer be maintained.

Included is a small web application which serves as an example.

It's important to note that there are currently no controls over uploads; anything you share can be downloaded by any number of people at any given time. With this in mind, consider sharing a small number of files from the example.

It's also important to note that some displays in the application poll the daemon for updates; this is inefficient, and you really shouldn't use this application over a mobile data connection.

Running with Docker

A Docker image containing the application can be pulled from jpdillingham/slsk-web-example.

A minimal run would look like:

docker run -i \
    -p 5000:5000 \
    -v <path/to/downloads>:/var/slsk/download \
    -v <path/to/shared>:/var/slsk/shared \
    -e "SLSK_USERNAME=<your username>" \
    -e "SLSK_PASSWORD=<your password>" \
    jpdillingham/slsk-web-example:latest

The application will then be accessible on port 5000 (e.g. http://localhost:5000). With this configuration the application won't be able to accept incoming connections and won't connect to the distributed network. You may receive limited search results and users won't find your files via search. Other users may have difficulty browsing your shares.

The full set of options is as follows:

docker run -i \
    -p 5000:5000 \
    -p 50000:50000 \
    -v <path/to/downloads>:/var/slsk/download \
    -v <path/to/shared>:/var/slsk/shared \
    -e "SLSK_USERNAME=<your username>" \
    -e "SLSK_PASSWORD=<your password>" \
    -e "SLSK_LISTEN_PORT=50000" \
    -e "SLSK_CONNECT_TIMEOUT=5000" \
    -e "SLSK_INACTIVITY_TIMEOUT=15000" \
    -e "SLSK_READ_BUFFER_SIZE=16384" \
    -e "SLSK_WRITE_BUFFER_SIZE=16384" \
    -e "SLSK_ENABLE_DNET=true" \
    -e "SLSK_DNET_CHILD_LIMIT=10" \
    -e "SLSK_DIAGNOSTIC=Info" \
    -e "SLSK_SHARED_CACHE_TTL=3600000" \
    -e "SLSK_ENABLE_SECURITY=true" \
    -e "SLSK_SECURITY_TOKEN_TTL=604800000" \
    -e "SLSK_ROOM_MESSAGE_LIMIT=250" \
    -e "SLSK_BASE_PATH=/"
    jpdillingham/slsk-web-example:latest

With this configuration the application will listen on port 50000 and will connect to the distributed network, allowing up to 10 child connections. The application shouldn't have any trouble connecting provided you've forwarded port 50000 properly, and will receive and respond to distributed search requests.

If SLSK_ENABLE_SECURITY is true, you will be prompted to log in. Supply the values you specified for the SLSK_USERNAME and SLSK_PASSWORD fields. Setting this option to false will disable the prompt.

If you would like to run the application behind a reverse proxy, set SLSK_BASE_PATH to your proxied path.

For convenience, two scripts, run and start, have been included in examples/Web/bin for running the example interactively and as a daemon, respectively.

Running without Docker

The example application is split into two projects; a .NET 5.0 WebAPI and a React application bootstrapped with create-react-app. If you'd like to run these outside of Docker you'll need to start both applications; dotnet run for the API and yarn|npm start for the React application. You can connect to http://localhost:3000, or the API serves Swagger UI at http://localhost:5000/swagger.

A build script included in the bin directory of the example which will build the React app, copy the static files to the wwwroot directory of the API, build the API, then attempt to build the Docker image.

See also

References

Alternative Clients and Libraries

Much of Soulseek.NET was made possible by the work of others. The following resources were used as a reference:

More Repositories

1

Utility.CommandLine.Arguments

A C# .NET class library containing tools for parsing the command line arguments of console applications.
C#
118
star
2

ILMergeGUI

Unofficial fork of ILMergeGUI from CodePlex (https://ilmergegui.codeplex.com/)
C#
73
star
3

NLog.xLogger

A C# .NET class library that extends NLog.Logger to provide additional functionality for tracing the entry and exit, arbitrary checkpoints, exceptions and stack traces within methods.
C#
34
star
4

SWoT

A web application for designing, tracking, and reporting progress on workouts. Written in JavaScript with React, Redux, Material UI, and hosted by a serverless AWS backend.
JavaScript
15
star
5

B2MML.NET

A C# .NET class library containing an implementation of the MESA International standards B2MML and BatchML.
C#
13
star
6

slack-desktop-dark-theme

My Frankensteined CSS to add a dark theme to the Slack desktop app, based on slack-black-theme.
CSS
13
star
7

Utility.CommandLine.Progress

A C# .NET class library containing tools for displaying progress in console applications.
C#
11
star
8

brainz

A lightweight MusicBrainz CLI in Go.
Go
8
star
9

Utility.OperationResult

A C# .NET class library designed to represent the result of an operation. Includes a result code and a list of messages generated during the operation.
C#
7
star
10

NLog.RealtimeLogger

A C# .NET class library that works in conjunction with the NLog 'MethodCall' logging target to expose log messages via an event in real time.
C#
7
star
11

KPI-ML.NET

A C# .NET class library containing an implementation of the MESA International standard KPI-ML.
C#
5
star
12

Utility.BigFont

A C# .NET class library for transforming strings into large, stylized characters.
C#
4
star
13

AWSPricingExplorer

A microservice for the AWS Pricing Api, written in JavaScript with Express, React, and blueprintjs.
JavaScript
4
star
14

B2MML4j

A Java package containing an implementation of the MESA International standards B2MML and BatchML.
Java
4
star
15

FileHistorian

A C# .NET application to keep track of changes to a filesystem.
C#
3
star
16

Functal

Decompiled source from the Functal library (https://functal.com/)
C#
3
star
17

Utility.PGPSignatureTools

A C# .NET class library for signing and verifying data using PGP encryption.
C#
3
star
18

SeedboxSync

A Java console application for syncing files with a seedbox account via FTP.
Java
2
star
19

CalcuPlate

A cross-platform mobile application for calculating barbell plate configurations, written in React Native.
JavaScript
2
star
20

HMACAuth

HMAC authentication for ASP.NET
C#
2
star
21

MTS-2.0-Documentation

Design documentation for a next-gen (circa 2005) mIRC theming standard
HTML
2
star
22

backend-seed

A backend application project seed in C# .NET.
JavaScript
2
star
23

SWoT-Backend

JavaScript
1
star
24

Archivist

A simple Golang application for tracking changes to files and directories on a system.
Go
1
star
25

deployments

Testing GitHub deployments APIs
HTML
1
star
26

Socks5.NET

A quick implementation of a SOCKS5 proxy client through TcpClient
C#
1
star
27

LazyCsv

Experimenting with an on-demand CSV parser
C#
1
star
28

react-sandbox

JavaScript
1
star
29

KPI-ML4j

A Java package containing an implementation of the MESA International standard KPI-ML.
Java
1
star
30

2opt.NET.WinForms

Crappy Windows forms application for visualizing 2opt.NET results.
C#
1
star
31

ServerlessTask

1
star
32

Governor

Proof of concept for a multi-tier bandwidth limiting algorithm
C#
1
star
33

FileWatcher

A quick and simple implementation of Microsoft's FileSystemWatcher to track and monitor changes to files on my computer.
C#
1
star
34

Scorecard

A proof of concept for a generic scorecard application
C#
1
star
35

stig-service

A service to track STIGs
JavaScript
1
star
36

SqlBulkCopyBenchmark

.NET Core console application for testing performance aspects of SqlBulkCopy against indexed and non-indexed tables
C#
1
star
37

sfn-syncex

A node.js script for synchronous execution of an AWS Step Function
JavaScript
1
star
38

SQLite-Benchmarks

Benchmarking various SQLite use cases
C#
1
star
39

DotnetCoreWorker

Experimenting with IHostedService
C#
1
star
40

pd-cci-test

1
star
41

github-action

Proof of concept for a custom GitHub action
JavaScript
1
star
42

SpanBenchmark

A quick .NET Core 2.1 application to examine the performance of the new Span<T>
C#
1
star
43

use-github-action

Uses the custom action created in the `github-action` repo
1
star
44

cypress-test

JavaScript
1
star
45

Channels

Playing around with .NET's Channel<T>
C#
1
star
46

Battleship

A simple Battleship game written in Java in 2005.
Java
1
star
47

rails-blog

Repository for the 'Getting Started with Rails' tutorial.
Ruby
1
star
48

slack-desktop-patcher

A console application to patch the Slack (4.x) desktop application to load custom CSS, written in Go.
Go
1
star
49

2opt.NET

An implementation of the 2-opt algorithm in .NET Core 2.
C#
1
star
50

circleci-test-report

Proof of concept for fetching test data from the CircleCI API during a workflow run
JavaScript
1
star
51

HTTPSStreaming

A proof of concept for concurrent file streaming over HTTPS
C#
1
star
52

Serverless

JavaScript
1
star
53

graphql-sandbox

Playing around with GraphQL
JavaScript
1
star
54

ColloquialTypeName

C# method to return a colloquial or "pretty" name for a given Type
C#
1
star
55

Sokoban

A Sokoban game written in VB6, made in 2002.
Visual Basic
1
star
56

apm-sandbox

Sandbox for testing APM with Prometheus, Grafana and Loki
C#
1
star
57

Kodi-StereoSnitch

A Python script which searches a directory of files for Kodi metadata and reports any files with a stereo (two channel) audio track.
Python
1
star
58

frisbee

Free ESB
Java
1
star
59

dotnetAPM

Quick WebAPI for testing APM with AppMetrics and Prometheus
C#
1
star
60

FunWithWebApi

C#
1
star
61

lets-code-ci-session-2

Let's Code: Unit Testing and Continuous Integration Part 2: C# .NET
C#
1
star
62

DotNetCore-Lambda

A quick .NET Core 2.1 Web API implementation for AWS Lambda
C#
1
star
63

circleci-insights-summary

Fetches Insights Summary data from Circle CI
JavaScript
1
star
64

VSTSTest

Testing VSTS build pipelines originating from GitHub
TypeScript
1
star
65

Utility.Extensions.Configuration.Yaml

A C# .NET Class Library containing an IConfigurationSource for Yaml files.
C#
1
star
66

WCFApi

A simple .NET 3.5 console application demonstrating how to host a RESTful API with WCF
C#
1
star
67

aws-lambda-express-bare-bones

A bare-bones, bare minimum implementation of an AWS Lambda script using Express.js
JavaScript
1
star
68

backstage

Trying out Backstage: https://backstage.io/
TypeScript
1
star
69

serverless-todo

A serverless AWS todo app for QC Coders.
JavaScript
1
star
70

OnAir

C#
1
star
71

lets-code-ci-session-1

Let's Code: Unit Testing and Continuous Integration Part 1: JavaScript
JavaScript
1
star
72

ServerlessExpress

JavaScript
1
star
73

dump-urself

A .NET console application that dumps its own memory using dotnet-dump
C#
1
star
74

nodets

TypeScript
1
star
75

MetadataBenchmark

Benchmarking music file metadata libraries
C#
1
star
76

dagger

Testing Dagger (dagger.io)
JavaScript
1
star
77

Utility.EnvironmentVariables

A C# .NET Class Library containing tools for populating properties from environment variables.
C#
1
star
78

ConsoleService.NET

A C# .NET project template for a Windows service application which also runs as a console application in user mode and/or on non-Windows platforms.
C#
1
star