1
0
Fork 0
mirror of https://github.com/fiso64/slsk-batchdl.git synced 2024-12-22 22:42:41 +00:00
This commit is contained in:
fiso64 2023-11-28 14:31:42 +01:00
parent 05d8accf93
commit 20d8310d20
3 changed files with 666 additions and 399 deletions

View file

@ -4,37 +4,37 @@ A batch downloader for Soulseek using Soulseek.NET. Accepts CSV files and Spotif
#### Download tracks from a csv file: #### Download tracks from a csv file:
``` ```
slsk-batchdl -i test.csv slsk-batchdl test.csv
``` ```
Use `--print tracks` before downloading to check if everything has been parsed correctly. The names of the columns should be: `Artist`, `Title`, `Album`, `Length`. Only the title column is required, but any additional info improves search. Use `--print tracks` before downloading to check if everything has been parsed correctly. The names of the columns should be: `Artist`, `Title`, `Album`, `Length`. Only the title column is required, but any additional info improves search.
#### Download spotify likes while skipping existing songs: #### Download spotify likes while skipping existing songs:
``` ```
slsk-batchdl -i spotify-likes --skip-existing slsk-batchdl spotify-likes --skip-existing
``` ```
To download private playlists or liked songs you will need to provide a client id and secret, which you can get here https://developer.spotify.com/dashboard/applications. Create an app and add `http://localhost:48721/callback` as a redirect url in its settings. To download private playlists or liked songs you will need to provide a client id and secret, which you can get here https://developer.spotify.com/dashboard/applications. Create an app and add `http://localhost:48721/callback` as a redirect url in its settings.
#### Download youtube playlist (with fallback to yt-dlp), including deleted videos: #### Download youtube playlist (with fallback to yt-dlp), including deleted videos:
``` ```
slsk-batchdl --get-deleted --yt-dlp -i "https://www.youtube.com/playlist?list=PLI_eFW8NAFzYAXZ5DrU6E6mQ_XfhaLBUX" slsk-batchdl --get-deleted --yt-dlp "https://www.youtube.com/playlist?list=PLI_eFW8NAFzYAXZ5DrU6E6mQ_XfhaLBUX"
``` ```
Playlists are retrieved using the YoutubeExplode library which unfortunately doesn't always return all videos. You can use the official API by providing a key with `--youtube-key`. Get it here https://console.cloud.google.com. Create a new project, click "Enable Api" and search for "youtube data", then follow the prompts. Playlists are retrieved using the YoutubeExplode library which unfortunately doesn't always return all videos. You can use the official API by providing a key with `--youtube-key`. Get it here https://console.cloud.google.com. Create a new project, click "Enable Api" and search for "youtube data", then follow the prompts.
#### Search & download a specific song: #### Search & download a specific song:
``` ```
slsk-batchdl -i "title=MC MENTAL @ HIS BEST,length=242" --pref-format "flac,wav" slsk-batchdl "title=MC MENTAL @ HIS BEST,length=242" --pref-format "flac,wav"
``` ```
#### Find an artist's songs which aren't in your library: #### Find an artist's songs which aren't in your library:
``` ```
slsk-batchdl -i "artist=MC MENTAL" --aggregate --print tracks --skip-existing --music-dir "path\to\music" slsk-batchdl "artist=MC MENTAL" --aggregate --print tracks --skip-existing --music-dir "path\to\music"
``` ```
### Options: ### Options:
``` ```
Usage: slsk-batchdl -i <input> [OPTIONS] Usage: slsk-batchdl <input> [OPTIONS]
-i --input <input> <input> is one of the following: <input> <input> is one of the following:
Spotify playlist url or "spotify-likes": Download a spotify Spotify playlist url or "spotify-likes": Download a spotify
playlist or your liked songs. --spotify-id and playlist or your liked songs. --spotify-id and
@ -84,12 +84,12 @@ Options:
-n --number <maxtracks> Download the first n tracks of a playlist -n --number <maxtracks> Download the first n tracks of a playlist
-o --offset <offset> Skip a specified number of tracks -o --offset <offset> Skip a specified number of tracks
--reverse Download tracks in reverse order --reverse Download tracks in reverse order
--remove-from-playlist Remove downloaded tracks from playlist (for spotify only) --remove-from-playlist Remove downloaded tracks from playlist (spotify only)
--name-format <format> Name format for downloaded tracks, e.g "{artist} - {title}" --name-format <format> Name format for downloaded tracks, e.g "{artist} - {title}"
--m3u Create an m3u8 playlist file --m3u Create an m3u8 playlist file
--format <format> Accepted file format(s), comma-separated --format <format> Accepted file format(s), comma-separated
--length-tol <tol> Length tolerance in seconds (default: 3) --length-tol <sec> Length tolerance in seconds (default: 3)
--min-bitrate <rate> Minimum file bitrate --min-bitrate <rate> Minimum file bitrate
--max-bitrate <rate> Maximum file bitrate --max-bitrate <rate> Maximum file bitrate
--max-samplerate <rate> Maximum file sample rate --max-samplerate <rate> Maximum file sample rate
@ -100,7 +100,7 @@ Options:
both search result and track title or in neither of the both search result and track title or in neither of the
two. Case-insensitive. (default:"remix, edit,cover") two. Case-insensitive. (default:"remix, edit,cover")
--pref-format <format> Preferred file format(s), comma-separated (default: mp3) --pref-format <format> Preferred file format(s), comma-separated (default: mp3)
--pref-length-tol <tol> Preferred length tolerance in seconds (default: 2) --pref-length-tol <sec> Preferred length tolerance in seconds (default: 2)
--pref-min-bitrate <rate> Preferred minimum bitrate (default: 200) --pref-min-bitrate <rate> Preferred minimum bitrate (default: 200)
--pref-max-bitrate <rate> Preferred maximum bitrate (default: 2200) --pref-max-bitrate <rate> Preferred maximum bitrate (default: 2200)
--pref-max-samplerate <rate> Preferred maximum sample rate (default: 96000) --pref-max-samplerate <rate> Preferred maximum sample rate (default: 96000)
@ -108,7 +108,7 @@ Options:
--pref-banned-users <list> Comma-separated list of users to deprioritize --pref-banned-users <list> Comma-separated list of users to deprioritize
--pref-danger-words <list> Comma-separated list of words that should appear in either --pref-danger-words <list> Comma-separated list of words that should appear in either
both search result and track title or in neither of the both search result and track title or in neither of the
two. (default: see github) two. (default: "mix,dj , edit,cover,(")
-s --skip-existing Skip if a track matching file conditions is found in the -s --skip-existing Skip if a track matching file conditions is found in the
output folder or your music library (if provided) output folder or your music library (if provided)
@ -122,20 +122,28 @@ Options:
during the last run. during the last run.
--remove-ft Remove "ft." or "feat." and everything after from the --remove-ft Remove "ft." or "feat." and everything after from the
track names before searching track names before searching
--remove-regex <regex> Remove a regex from all track names and artist names --remove-regex <regex> Remove a regex from all track titles and artist names
--no-artist-search Perform a search without artist name if nothing was --no-artist-search Perform a search without artist name if nothing was
found. Only use for sources such as youtube or soundcloud found. Only use for sources such as youtube or soundcloud
where the "artist" could just be an uploader. where the "artist" could just be an uploader.
--artist-search Also try to find track by searching for the artist only --artist-search Also try to find track by searching for the artist only
--no-diacr-search Also perform a search without diacritics --no-diacr-search Also perform a search without diacritics
--no-regex-search <regex> Also perform a search without a regex pattern --no-regex-search <regex> Also perform a search without a regex pattern
--levenshtein-weight <num> Results are sorted by the distance between the filename
and track title times the weight (among other things). 1
means each differing character will downrank the result, 0
disables this part of the sorting algorithm. (default: 0.5)
--yt-dlp Use yt-dlp to download tracks that weren't found on --yt-dlp Use yt-dlp to download tracks that weren't found on
Soulseek. yt-dlp must be available from the command line. Soulseek. yt-dlp must be available from the command line.
--config <path> Specify config file location --config <path> Manually specify config file location
--search-timeout <ms> Max search time in ms (default: 6000) --search-timeout <ms> Max search time in ms (default: 6000)
--max-stale-time <ms> Max download time without progress in ms (default: 50000) --max-stale-time <ms> Max download time without progress in ms (default: 50000)
--concurrent-downloads <num> Max concurrent searches & downloads (default: 2) --concurrent-downloads <num> Max concurrent downloads (default: 2)
--searches-per-time <num> Max searches per time interval. Higher values may cause
30-minute bans. (default: 34)
--searches-time <sec> Controls how often available searches are replenished.
Lower values may cause 30-minute bans. (default: 220)
--display <option> Changes how searches and downloads are displayed: --display <option> Changes how searches and downloads are displayed:
single (default): Show transfer state and percentage single (default): Show transfer state and percentage
double: Transfer state and a large progress bar double: Transfer state and a large progress bar
@ -160,3 +168,4 @@ Configuration files: Create a file named `slsk-batchdl.conf` in the same directo
### Notes: ### Notes:
- The CSV file must use `"` as string delimiter and be encoded with UTF8 - The CSV file must use `"` as string delimiter and be encoded with UTF8
- `--display single` and especially `double` can cause the printed lines to be duplicated or overwritten on some configurations. Use `simple` if that's an issue. - `--display single` and especially `double` can cause the printed lines to be duplicated or overwritten on some configurations. Use `simple` if that's an issue.
- The server will ban you for 30 minutes if too many searches are performed within a short timespan. Adjust `--searches-per-time` and `--searches-time` in case it happens. By default it's configured to allow up to 34 searches every 220 seconds. These values were determined through experimentation as unfortunately I couldn't find any information regarding soulseek's rate limits, so they may be incorrect. You can also use `--random-login` to re-login with a random username and password automatically.

File diff suppressed because it is too large Load diff

View file

@ -25,7 +25,7 @@
<PackageReference Include="SpotifyAPI.Web" Version="7.0.2" /> <PackageReference Include="SpotifyAPI.Web" Version="7.0.2" />
<PackageReference Include="SpotifyAPI.Web.Auth" Version="7.0.2" /> <PackageReference Include="SpotifyAPI.Web.Auth" Version="7.0.2" />
<PackageReference Include="TagLibSharp" Version="2.3.0" /> <PackageReference Include="TagLibSharp" Version="2.3.0" />
<PackageReference Include="YoutubeExplode" Version="6.3.7" /> <PackageReference Include="YoutubeExplode" Version="6.3.8" />
</ItemGroup> </ItemGroup>
</Project> </Project>