Soulseek.NET で構築された Soulseek の自動ダウンローダー。 CSV ファイルだけでなく、Spotify や YouTube の URL も受け入れます。
プレイリストとアルバムのダウンロードをサポートします。ユーザーが設定したファイル条件とヒューリスティックに従って最適なファイルを選択します。
使用例を参照してください。
Usage: sldl <input> [OPTIONS]
<input> A url, search string, or path to a local CSV file.
Run --help "input" to view the accepted inputs.
Can also be passed with -i, --input <input>
--user <username> Soulseek username
--pass <password> Soulseek password
-p, --path <path> Download directory
--input-type <type> [csv|youtube|spotify|bandcamp|string|list]
--name-format <format> Name format for downloaded tracks. See --help name-format
-n, --number <maxtracks> Download the first n tracks of a playlist
-o, --offset <offset> Skip a specified number of tracks
-r, --reverse Download tracks in reverse order
-c, --config <path> Set config file location. Set to 'none' to ignore config
--profile <names> Configuration profile(s) to use. See --help ""config"".
--concurrent-downloads <num> Max concurrent downloads (default: 2)
--write-playlist Create an m3u playlist file in the output directory
--playlist-path <path> Override default path for m3u playlist file
--no-skip-existing Do not skip downloaded tracks
--no-write-index Do not create a file indexing all downloaded tracks
--index-path <path> Override default path for sldl index
--skip-check-cond Check file conditions when skipping existing files
--skip-check-pref-cond Check preferred conditions when skipping existing files
--skip-music-dir <path> Also skip downloading tracks found in a music library by
comparing filenames. Not 100% reliable.
--skip-not-found Skip searching for tracks that weren't found on Soulseek
during the last run.
--listen-port <port> Port for incoming connections (default: 49998)
--on-complete <command> Run a command whenever a file is downloaded.
Available placeholders: {path} (local save path), {title},
{artist},{album},{uri},{length},{failure-reason},{state}.
Prepend a state number to only run in specific cases:
1:, 2:, 3:, 4: for the Downloaded, Failed, Exists, and
NotFoundLastTime states respectively.
E.g: '1:<cmd>' will only run the command if the file is
downloaded successfully. Prepend 's:' to use the system
shell to execute the command.
--print <option> Print tracks or search results instead of downloading:
'tracks': Print all tracks to be downloaded
'tracks-full': Print extended information about all tracks
'results': Print search results satisfying file conditions
'results-full': Print search results including full paths.
--no-progress Disable progress bars/percentages, only simple printing
--debug Print extra debug info
--fast-search Begin downloading as soon as a file satisfying the preferred
conditions is found. Only for normal download mode.
--remove-ft Remove 'feat.' and everything after before searching
--no-remove-special-chars Do not remove special characters before searching
--remove-brackets Remove square brackets and their contents before searching
--regex <regex> Remove a regexp from all track titles and artist names.
Optionally specify a replacement regex after a semicolon.
Add 'T:', 'A:' or 'L:' at the start to only apply this to
the track title, artist, or album respectively.
--artist-maybe-wrong Performs an additional search without the artist name.
Useful for sources like SoundCloud where the "artist"
could just be an uploader. Note that when downloading a
YouTube playlist via url, this option is set automatically
on a per-track basis, so it is best kept off in that case.
-d, --desperate Tries harder to find the desired track by searching for the
artist/album/title only, then filtering. (slower search)
--fails-to-downrank <num> Number of fails to downrank a user's shares (default: 1)
--fails-to-ignore <num> Number of fails to ban/ignore a user's shares (default: 2)
--yt-dlp Use yt-dlp to download tracks that weren't found on
Soulseek. yt-dlp must be available from the command line.
--yt-dlp-argument <str> The command line arguments when running yt-dlp. Default:
"{id}" -f bestaudio/best -cix -o "{savepath}.%(ext)s"
Available vars are: {id}, {savedir}, {savepath} (w/o ext).
Note that -x causes yt-dlp to download webms in case ffmpeg
is unavailable.
--search-timeout <ms> Max search time in ms (default: 6000)
--max-stale-time <ms> Max download time without progress in ms (default: 50000)
--searches-per-time <num> Max searches per time interval. Higher values may cause
30-minute bans, see --help "search". (default: 34)
--searches-renew-time <sec> Controls how often available searches are replenished.
See --help "search". (default: 220)
--spotify-id <id> Spotify client ID
--spotify-secret <secret> Spotify client secret
--spotify-token <token> Spotify access token
--spotify-refresh <token> Spotify refresh token
--remove-from-source Remove downloaded tracks from source playlist
--youtube-key <key> Youtube data API key
--get-deleted Attempt to retrieve titles of deleted videos from wayback
machine. Requires yt-dlp.
--deleted-only Only retrieve & download deleted music.
--artist-col Artist column name
--title-col Track title column name
--album-col Album column name
--length-col Track length column name
--album-track-count-col Album track count column name (sets --album-track-count)
--yt-desc-col Youtube description column (improves --yt-parse)
--yt-id-col Youtube video id column (improves --yt-parse)
--time-format <format> Time format in Length column of the csv file (e.g h:m:s.ms
for durations like 1:04:35.123). Default: s
--yt-parse Enable if the CSV contains YouTube video titles and channel
names; attempt to parse them into title and artist names.
--remove-from-source Remove downloaded tracks from source CSV file
--format <formats> Accepted file format(s), comma-separated, without periods
--length-tol <sec> Length tolerance in seconds
--min-bitrate <rate> Minimum file bitrate
--max-bitrate <rate> Maximum file bitrate
--min-samplerate <rate> Minimum file sample rate
--max-samplerate <rate> Maximum file sample rate
--min-bitdepth <depth> Minimum bit depth
--max-bitdepth <depth> Maximum bit depth
--strict-title File name must contain title
--strict-artist File path must contain artist name
--strict-album File path must contain album name
--banned-users <list> Comma-separated list of users to ignore
--pref-format <formats> Preferred file format(s), comma-separated (default: mp3)
--pref-length-tol <sec> Preferred length tolerance in seconds (default: 3)
--pref-min-bitrate <rate> Preferred minimum bitrate (default: 200)
--pref-max-bitrate <rate> Preferred maximum bitrate (default: 2500)
--pref-min-samplerate <rate> Preferred minimum sample rate
--pref-max-samplerate <rate> Preferred maximum sample rate (default: 48000)
--pref-min-bitdepth <depth> Preferred minimum bit depth
--pref-max-bitdepth <depth> Preferred maximum bit depth
--pref-banned-users <list> Comma-separated list of users to downrank
--strict-conditions Skip files with missing properties instead of accepting by
default; if --min-bitrate is set, ignores any files with
unknown bitrate.
-a, --album Album download mode: Download a folder
-t, --interactive Interactive mode, allows to select the folder and images
--album-track-count <num> Specify the exact number of tracks in the album. Add a + or
- for inequalities, e.g '5+' for five or more tracks.
--album-art <option> Retrieve additional images after downloading the album:
'default': No additional images
'largest': Download from the folder with the largest image
'most': Download from the folder containing the most images
--album-art-only Only download album art for the provided album
--no-browse-folder Do not automatically browse user shares to get all files in
in the folder
--failed-album-path Path to move all album files to when one of the items from
the directory fails to download. Set to 'delete' to delete
the files instead. Set to 'disable' keep it where it is.
Default: {configured output dir}/failed
-g, --aggregate Aggregate download mode: Find and download all distinct
songs associated with the provided artist, album, or title.
--aggregate-length-tol <tol> Max length tolerance in seconds to consider two tracks or
albums equal. (Default: 3)
--min-shares-aggregate <num> Minimum number of shares of a track or album for it to be
downloaded in aggregate mode. (Default: 2)
--relax-filtering Slightly relax file filtering in aggregate mode to include
more results
--twf など、2 語および --3 語のフラグの頭字語も受け入れられます。オプションに「max」という単語が含まれる場合、m は大文字にする必要があります。 「bitrate」、「sameplerate」、「bit Depth」はすべて 2 つの別個の単語として扱う必要があります (例: --max-bitrate の場合は --Mbr)。
フラグを false に設定することで明示的に無効にできます (例: '--interactive false')。
入力タイプは通常、自動的に決定されます。特定の入力タイプを強制するには、 --input-type [spotify|youtube|csv|string|bandcamp|list] を設定します。次の入力タイプが使用可能です。
ローカル CSV ファイルへのパス: ダウンロードする曲のトラック情報を含む CSV ファイルを使用します。列の名前はアーティスト、タイトル、アルバム、長さである必要がありますが、通常は別の名前も検出されます。必須なのはタイトルまたはアルバム列のみですが、追加情報があると検索結果のランキングが向上する可能性があります。タイトル列のテキストが含まれていないすべての行は、アルバムのダウンロードとして扱われます。
プレイリスト URL: YouTube プレイリストから曲をダウンロードします。プレイリストを取得するデフォルトの方法では、常にすべてのビデオが返されるとは限りません。特に、利用できないビデオは返されません。すべてのビデオ タイトルを取得するには、--youtube-key でキーを指定して公式 API を使用できます。 https://console.cloud.google.com から入手してください。新しいプロジェクトを作成し、「API を有効にする」をクリックして「youtube データ」を検索し、プロンプトに従います。
プレイリスト/アルバムの URL または「spotify-likes」:Spotify のプレイリスト、アルバム、またはお気に入りの曲をダウンロードします。プライベート プレイリストや気に入った音楽をダウンロードする場合は、認証情報が必要です。
https://developer.spotify.com/dashboard/applications にリダイレクト URL http://localhost:48721/callback を使用して Spotify アプリケーションを作成します。作成したアプリケーション ダッシュボードからアプリケーション ID とシークレットを取得します。
取得した認証情報と承認されたアクションを使用して sldl を開始し、Spotify アプリのログイン フローをトリガーします。
sldl spotify-likes --spotify-id 123456 --spotify-secret 123456 -n 1 --print-tracks
sldl はブラウザを自動的に開こうとしますが、ログイン フロー URL をログに記録して出力します。ログイン フローが完了すると、sldl はトークンとリフレッシュ トークンを出力し、現在のコマンドの実行を終了します。
sldl が使用されるたびにログイン フローを要求することをスキップするには、トークンとリフレッシュ トークンを sldl に提供できます (ヒント: コマンドの冗長性を軽減するために、この情報を構成ファイルに保存します)。
sldl spotify-likes --spotify-id 123456 --spotify-secret 123456 --spotify-refresh 123456 --spotify-token 123456 -n 1 --pt
Spotify-token アクセスは 1 時間のみ有効です。 Spotify-refresh を使用すると、sldl が実行されるたびにアクセスを更新できるようになります (また、spotify-token を含めずに使用することもできます)。
Bandcamp URL: 単一トラック、アルバム、またはアーティストのディスコグラフィー全体をダウンロードします。アーティスト名、アルバム名を抽出し、--album-track-count="n+" を設定します。n は、bandcamp ページに表示されるトラックの数です。
検索するトラック、アルバム、またはアーティストの名前: 一般的な検索文字列 (Soulseek 検索バーに入力する文字列など)、または「title=曲名、アーティスト=」のようなプロパティのカンマ区切りリストのいずれかを指定できます。アーティスト名、長さ=215'。
次のプロパティが受け入れられます。
title
artist
album
length (in seconds)
artist-maybe-wrong
album-track-count
入力例とその解釈:
Input String | Artist | Title | Album | Length
---------------------------------------------------------------------------------
'Foo Bar' (without any hyphens) | | Foo Bar | |
'Foo - Bar' | Foo | Bar | |
'Foo - Bar' (with --album enabled) | Foo | | Bar |
'Artist - Title, length=42' | Artist | Title | | 42
'artist=AR, title=T, album=AL' | AR | T | AL |
各行が次の形式になっているテキスト ファイルへのパス。
"some input" "conditions" "preferred conditions"
例えば:
"artist=Artist, album=Album" "format=mp3; br > 128" "br >= 320"
ここで、「some input」は上記の入力タイプのいずれかです。フィールドにスペースが含まれていない場合は、引用符を省略できます。条件フィールドは、設定された条件の上に追加されますが、省略することもできます。リスト入力は --input-type=list を使用して手動で有効にする必要があります。
また、アルバム ダウンロードの短縮形a:"Artist - Album"
も受け入れます。 a:
引用符の外側に指定する必要があることに注意してください。
デフォルト。入力エントリごとに 1 つのファイルをダウンロードします。
sldl はアルバムを検索し、非オーディオ ファイルを含むフォルダー全体をダウンロードします。入力が Spotify または Bandcamp アルバムへのリンクである場合、入力文字列または CSV 行にトラック タイトルがない場合、または -a/--album が有効な場合にアクティブになります。
-g/--aggregate を指定すると、sldl は入力に対して通常の検索を実行し、結果を個別の曲にグループ化し、最も多くのユーザーが共有した曲から始めて、各種類の 1 つをダウンロードしようとします。
--min-shares-aggregate はデフォルトで 2 であることに注意してください。これは、1 人のユーザーのみが共有した曲は無視されることを意味します。
--album と --aggregate の両方が有効な場合にアクティブになります。 sldl は共有をグループ化し、最も多くのユーザーが共有したアルバムから順に、それぞれのアルバムを 1 つずつダウンロードします。これを --interactive と組み合わせることが推奨されます。
--min-shares-aggregate はデフォルトで 2 であることに注意してください。これは、1 人のユーザーのみによって共有されているアルバムは無視されることを意味します。
検索クエリは次のように決定されます。
短期間に検索が多すぎると、サーバーは 30 分間アクセスを禁止します。プログラムには、--searches-per-time および --searches-renew-time で調整できる検索制限があります (制限に達すると、ダウンロードのステータスは「待機中」になります)。デフォルトでは、220 秒ごとに最大 34 件の検索を許可するように構成されています。デフォルト値は実験によって決定されたものであるため、正しくない可能性があります。
次のオプションを使用すると処理が高速になりますが、検索結果の品質が低下したり、不安定になる可能性があります。
必要な条件を満たしていないファイルはダウンロードされません。優先条件を満たすファイルが優先されます。 --pref-format "flac,wav" を設定すると、利用可能な場合はロスレス ファイルがダウンロードされ、他に何もない場合はロスレス ファイルのみがダウンロードされます。
デフォルトの必須条件はありません。デフォルトの優先条件は次のとおりです。
pref-format = mp3
pref-length-tol = 3
pref-min-bitrate = 200
pref-max-bitrate = 2500
pref-max-samplerate = 48000
pref-strict-title = true
pref-strict-album = true
pref-accept-no-length = false
したがって、sldl は、ビットレートが 200 ~ 2500 kbps で、指定された長さとの差が 3 秒以内である mp3 ファイルを優先します。また、パスに指定されたタイトルとアルバムが含まれ (大文字と小文字は無視され、境界文字で囲まれている)、ヌル以外の長さを持つファイルが優先されます。最後の 3 つの優先条件を変更することはお勧めできません。
優先条件のサブセットを満たすファイルは、どの条件も満たさないファイルよりも優先されますが、一部の条件は他の条件より優先されることに注意してください。たとえば、strict-title のみを満たすファイル (有効な場合) は、フォーマット条件のみを満たすファイルよりも常に優先されます。 --print "results-full" を指定して実行すると、並べ替えロジックが表示されます。
条件は、 --cond と --pref を使用してセミコロン区切りの文字列として指定することもできます (例: --cond "br >= 320; format = mp3,ogg; sr < 96000")。
オプション --strict-title、--strict-artist、および --strict-album は、ファイル名にタイトル/アーティスト/アルバムを含まないファイルをフィルタリングします (大文字と小文字は無視され、境界文字で区切られます)。
誤ったダウンロードを防ぐもう 1 つの方法は、 --length-tol を 3 以下に設定して、入力と 3 秒以上異なる曲を無視するようにすることです。ただし、4 つのオプションはすべてデフォルトで「優先」条件としてすでに有効になっており、そのようなファイルはいずれにせよ最後の手段としてのみダウンロードされることを意味します。したがって、誤ったダウンロードを可能な限り最小限に抑える必要がある場合、または名前が 1 文字または 2 文字だけのトラックやアルバムなどの特殊な場合にのみ、有効にすることをお勧めします。
ピアが使用するクライアントによっては、一部の情報が利用できない場合があります。たとえば、標準の Soulseek クライアントはファイルのビットレートを共有しません。 (例) --min-bitrate が設定されている場合でも、sldl はビットレートが不明なファイルを受け入れます。 --strict-conditions を有効にすることで、チェックされたプロパティの 1 つ以上が null (不明) であるすべてのファイルを拒否するように構成できます。
その結果、 --min-bitrate も設定されている場合、ユーザーがデフォルトのクライアントと共有しているファイルはすべて無視されます。また、ビットレートとサンプルレートのチェックにより、デフォルトの優先条件がこのオプションのランキングにすでに影響していることにも注意してください。
{} で囲まれた変数は、対応するファイル タグの値に置き換えられます。名前形式は、サブディレクトリだけでなく、{tag1|tag2} のような条件式もサポートしています - tag1 が null の場合は、tag2 を使用します。括弧で囲まれた文字列リテラルは、null チェックでは無視されます。
artist First artist (from the file tags)
sartist Source artist (as on CSV/Spotify/YouTube/etc)
artists Artists, joined with '&'
albumartist First album artist
albumartists Album artists, joined with '&'
title Track title
stitle Source track title
album Album name
salbum Source album name
year Track year or date
track Track number
disc Disc number
filename Soulseek filename without extension
foldername Soulseek folder name
extractor Name of the extractor used (CSV/Spotify/YouTube/etc)
default-folder Default sldl folder name (usually the playlist name)
sldl は、次の場所で sldl.conf という名前のファイルを検索します。
~/AppData/Roaming/sldl/sldl.conf
~/.config/sldl/sldl.conf
実行可能ファイルのディレクトリ内にもあります。
設定ファイルの例:
username = your-username
password = your-password
pref-format = flac
fast-search = true
ハッシュタグ (#) で始まる行は無視されます。パス内のチルダはユーザー ディレクトリとして展開されます。
プロファイルがサポートされています:
[lossless]
pref-format = flac,wav
上記のプロファイルをアクティブにするには、--profile "lossless" を実行します。使用可能なプロファイルをすべてリストするには、--profile "help" を実行します。
プロファイルは、いくつかの簡単な条件に基づいて自動的にアクティブ化できます。
[no-stale]
profile-cond = interactive && download-mode == "album"
max-stale-time = 999999
# album downloads will never be automatically cancelled in interactive mode
[youtube]
profile-cond = input-type == "youtube"
path = ~/downloads/sldl-youtube
# download to another location for youtube
profile-cond での使用がサポートされている演算子: &&、||、==、!=、!{bool}。
次の変数が使用可能です。
input-type ("youtube"|"csv"|"string"|"bandcamp"|"spotify")
download-mode ("normal"|"aggregate"|"album"|"album-aggregate")
interactive (bool)
CSV ファイルからトラックをダウンロードします。
sldl test.csv
Spotify の「いいね!」をダウンロード:
sldl spotify-likes
インタラクティブなアルバムのダウンロード:
sldl "Some Album" -a -t
ロスレスを優先して、名前で特定の曲をダウンロードします。
sldl "MC MENTAL @ HIS BEST, length=242" --pref-format "flac,wav"
Spotify プレイリスト内のすべての曲のアルバムをダウンロードします。
sldl https://spotify/playlist/id -a
削除されたビデオ名を取得し、yt-dlp にフォールバックして YouTube プレイリストからダウンロードします。
sldl https://www.youtube.com/playlist/id --get-deleted --yt-dlp
ライブラリにないアーティストの曲をすべて印刷します。
sldl "artist=MC MENTAL" --aggregate --skip-music-dir "path/to/music" --print results-full
soulseek で見つかったアーティストのすべてのアルバムをダウンロード:
sldl "artist=MC MENTAL" -a -g -t
wishlist.txt
という名前のファイルを作成し、「入力タイプ: リスト」で説明されているようにいくつかの項目を追加します。
" Artist - My Favorite Song "
a: " Artist - Some Album, album-track-count=5 " " format=flac "
プロファイルをsldl.conf
に追加します。
[wishlist]
input = ~/sldl/wishlist.txt
input-type = list
index-path = ~/sldl/wishlist-index.sldl
これにより、グローバル インデックス ファイルwishlist-index.sldl
が作成され、sldl が実行されるたびにこのファイルがスキャンされ、既にダウンロードされているウィッシュリスト アイテムがスキップされます。優先条件を満たすバージョンがダウンロードされるまで検索を続ける場合は、 skip-check-pref-cond = true
も追加します (これには、ファイルがダウンロード後に同じ場所に残る必要があることに注意してください)。
最後に、次のオプションを使用して sldl を定期的に実行する cron ジョブ (または Windows ではスケジュールされたタスク) を設定します。
sldl --profile wishlist
chmod +x publish.sh && sh publish.sh
を実行します。 Intel Mac の場合は、x64 のコメントを解除し、publish.sh の arm64 セクションをコメント化します。--no-progress
使用してください。 sldl
実行するための Docker コンテナは、このリポジトリから構築できます。イメージは Linux x86/ARM をサポートします。
コンテナを構築して起動するには:
clone https://github.com/fiso64/slsk-batchdl
cd slsk-batchdl
docker compose up -d
コンテナにexec
sldl
の使用を開始します。
docker compose exec sldl sh
sldl --help
Compose スタックは、 docker-compose.yml
が配置されている場所に関連して、ファイル管理に使用できる 2 つのディレクトリをマウントします。
/config
(ホスト上の./config
にあります) - sldl.conf
構成をこのディレクトリに配置し、 sldl -c /config ...
使用して、コンテナーで構成を使用します。/data
(ホスト上の./data
にあります) - ダウンロード ディレクトリとして使用します IE sldl -p /data ...
Linux ホスト上で Docker を実行している場合は、Docker ファイルのアクセス許可の問題を回避するために、ホスト上の構成およびデータ ディレクトリを所有するユーザーのuser:group
アクセス許可を指定する必要があります。これらは、環境変数PUIDおよびPGID を使用して指定できます。
現在のユーザーの UID と GID を取得するには、ターミナルから次のコマンドを実行します。
id -u
-- UID を出力しますid -g
-- GID を出力しますこれらをdocker-compose.yml
内の対応する変数 ( PUID
PGID
) に置き換えます。
コンテナーに組み込まれている cron を使用して、1 つ以上のsldl
コマンドをスケジュールに従って実行できます。
スケジュールを作成するには、ホスト./config/crontabs/abc
上に新しいファイルを作成し、それを標準の crontab 構文で使用します。
cron ファイルに変更を加えた後は、必ずコンテナーを再起動してください。
例 => 毎週日曜日の午前 1 時にsldl
実行し、指定された Spotify プレイリストから不足しているトラックを検索します
# min hour day month weekday command
0 1 * * 0 sldl https://open.spotify.com/playlist/6sf1WR5grXGJ6dET -c /config -p /data --skip-existing --m3u-path /data/index.sldl"
crontab.guru は、スケジュール式を支援するために使用できます。