1
0
Fork 0
mirror of https://github.com/fiso64/slsk-batchdl.git synced 2024-12-22 22:42:41 +00:00

clean help display

This commit is contained in:
fiso64 2023-06-01 15:06:43 +02:00
parent e103cff6bd
commit da8f5f6f86
2 changed files with 92 additions and 66 deletions

View file

@ -3,6 +3,8 @@ using System.Text.RegularExpressions;
using Soulseek; using Soulseek;
using Konsole; using Konsole;
using System.Net.NetworkInformation; using System.Net.NetworkInformation;
using System.Xml.Linq;
using TagLib.Matroska;
class Program class Program
{ {
@ -25,68 +27,93 @@ class Program
static void PrintHelp() static void PrintHelp()
{ {
Console.WriteLine("Usage: slsk-batchdl.exe [OPTIONS]"); Console.WriteLine("Usage: slsk-batchdl.exe [OPTIONS]" +
Console.WriteLine("Options:"); "\nOptions:" +
Console.WriteLine(" -p --parent <path> Downloaded music will be placed here"); "\n -p --parent <path> Downloaded music will be placed here" +
Console.WriteLine(" -n --name <name> Folder / playlist name. If not specified, the name of the csv file / spotify / yt playlist is used."); "\n -n --name <name> Folder / playlist name. If not specified, the name of the" +
Console.WriteLine(" --username <username> Soulseek username"); "\n csv file / spotify / yt playlist is used." +
Console.WriteLine(" --password <password> Soulseek password"); "\n --username <username> Soulseek username" +
Console.WriteLine(); "\n --password <password> Soulseek password" +
Console.WriteLine(" --spotify <url> Download a spotify playlist. \"likes\" to download all your liked music."); "\n" +
Console.WriteLine(" --spotify-id <id> Your spotify client id (use if the default fails or if playlist private)"); "\n --spotify <url> Download a spotify playlist. \"likes\" to download all your" +
Console.WriteLine(" --spotify-secret <sec> Your spotify client secret (use if the default fails or if playlist private)"); "\n liked music." +
Console.WriteLine(); "\n --spotify-id <id> Your spotify client id (use if the default fails or if" +
Console.WriteLine(" --youtube <url> Get tracks from a YouTube playlist"); "\n playlist private)" +
Console.WriteLine(" --youtube-key <key> Provide an API key if you also want to search for unavailable uploads"); "\n --spotify-secret <sec> Your spotify client secret (use if the default fails or if" +
Console.WriteLine(" --no-channel-search Enable to also perform a search without channel name if nothing was found (only for yt)."); "\n playlist private)" +
Console.WriteLine(); "\n" +
Console.WriteLine(" --csv <path> Use a csv file containing track info to download"); "\n --youtube <url> Get tracks from a YouTube playlist" +
Console.WriteLine(" --artist-col <column> Artist or uploader name column"); "\n --youtube-key <key> Provide an API key if you also want to search for" +
Console.WriteLine(" --title-col <column> Title or track name column"); "\n unavailable uploads" +
Console.WriteLine(" --album-col <column> CSV album column name. Optional, may improve searching, slower"); "\n --no-channel-search Enable to also perform a search without channel name if" +
Console.WriteLine(" --length-col <column> CSV duration column name. Recommended, will improve accuracy"); "\n nothing was found (only for yt)" +
Console.WriteLine(" --time-unit <unit> Time unit for the track duration column, ms or s (default: s)"); "\n" +
Console.WriteLine(" --yt-desc-col <column> Description column name. Use with --yt-parse."); "\n --csv <path> Use a csv file containing track info to download" +
Console.WriteLine(" --yt-id-col <column> Youtube video ID column (only needed if length-col or yt-desc-col don't exist). Use with --yt-parse."); "\n --artist-col <column> Artist or uploader name column" +
Console.WriteLine(" --yt-parse Enable if you have a csv file of YouTube video titles and channel names; attempt to parse."); "\n --title-col <column> Title or track name column" +
Console.WriteLine(); "\n --album-col <column> CSV album column name. Optional, may improve searching," +
Console.WriteLine(" -s --single <str> Search & download a specific track"); "\n slower" +
Console.WriteLine(" -a --album <str> Does nothing"); "\n --length-col <column> CSV duration column name. Recommended, will improve" +
Console.WriteLine(); "\n accuracy" +
Console.WriteLine(" --pref-format <format> Preferred file format (default: mp3)"); "\n --time-unit <unit> Time unit in track duration column, ms or s (default: s)" +
Console.WriteLine(" --pref-length-tol <tol> Preferred length tolerance (if length col provided) (default: 3)"); "\n --yt-desc-col <column> Description column name. Use with --yt-parse." +
Console.WriteLine(" --pref-min-bitrate <rate> Preferred minimum bitrate (default: 200)"); "\n --yt-id-col <column> Youtube video ID column (only needed if length-col or" +
Console.WriteLine(" --pref-max-bitrate <rate> Preferred maximum bitrate (default: 2200)"); "\n yt-desc-col don't exist). Use with --yt-parse." +
Console.WriteLine(" --pref-max-samplerate <rate> Preferred maximum sample rate (default: 96000)"); "\n --yt-parse Enable if you have a csv file of YouTube video titles and" +
Console.WriteLine(" --pref-danger-words <list> Comma separated list of words that must appear in either both search result and track title, or in neither of the two. Case-insensitive. (default: \"mix, edit,dj ,cover\")"); "\n channel names; attempt to parse." +
Console.WriteLine(" --nec-format <format> Necessary file format"); "\n" +
Console.WriteLine(" --nec-length-tolerance <tol> Necessary length tolerance (default: 3)"); "\n -s --single <str> Search & download a specific track" +
Console.WriteLine(" --nec-min-bitrate <rate> Necessary minimum bitrate"); "\n -a --album <str> Does nothing" +
Console.WriteLine(" --nec-max-bitrate <rate> Necessary maximum bitrate"); "\n" +
Console.WriteLine(" --nec-max-samplerate <rate> Necessary maximum sample rate"); "\n --pref-format <format> Preferred file format (default: mp3)" +
Console.WriteLine(" --nec-danger-words <list> Comma separated list of words that must appear in either both search result and track title, or in neither of the two. Case-insensitive. (default: \"mix, edit,dj ,cover\")"); "\n --pref-length-tol <tol> Preferred length tolerance (default: 3)" +
Console.WriteLine(); "\n --pref-min-bitrate <rate> Preferred minimum bitrate (default: 200)" +
Console.WriteLine(" --album-search Also search for \"[Album name] [track name]\". Occasionally helps to find more, slower."); "\n --pref-max-bitrate <rate> Preferred maximum bitrate (default: 2200)" +
Console.WriteLine(" --no-diacr-search Also perform a search without diacritics"); "\n --pref-max-samplerate <rate> Preferred maximum sample rate (default: 96000)" +
Console.WriteLine(" --skip-existing Skip if a track matching the conditions is found in the output folder or your music library (if provided)"); "\n --pref-danger-words <list> Comma separated list of words that must appear in either" +
Console.WriteLine(" --skip-notfound Skip searching for tracks that weren't found in Soulseek last time"); "\n both search result and track title, or in neither of the" +
Console.WriteLine(" --remove-ft Remove \"ft.\" or \"feat.\" and everything after from the track names."); "\n two, case-insensitive (default:\"mix, edit, dj, cover\")" +
Console.WriteLine(" --remove-strings <strings> Comma separated list of strings to remove when searching for tracks. Case insesitive."); "\n --nec-format <format> Necessary file format" +
Console.WriteLine(" --music-dir <path> Specify to also skip downloading tracks which are in your library, use with --skip-existing"); "\n --nec-length-tolerance <tol> Necessary length tolerance (default: 3)" +
Console.WriteLine(" --reverse Download tracks in reverse order"); "\n --nec-min-bitrate <rate> Necessary minimum bitrate" +
Console.WriteLine(" --skip-if-pref-failed Skip if preferred versions of a track exist but failed to download. If no pref. versions were found, download as normal."); "\n --nec-max-bitrate <rate> Necessary maximum bitrate" +
Console.WriteLine(" --create-m3u Create an m3u playlist file"); "\n --nec-max-samplerate <rate> Necessary maximum sample rate" +
Console.WriteLine(" --m3u-only Only create an m3u playlist file with existing tracks and exit"); "\n --nec-danger-words <list> Comma separated list of words that must appear in either" +
Console.WriteLine(" --m3u <path> Where to place created m3u files (--parent by default)"); "\n both search result and track title, or in neither of the" +
Console.WriteLine(" --yt-dlp Use yt-dlp to download tracks that weren't found on Soulseek. yt-dlp must be available from the command line."); "\n two. Case-insensitive. (default:\"mix, edit, dj, cover\")" +
Console.WriteLine(" --yt-dlp-f <format> yt-dlp audio format (default: \"bestaudio/best\")"); "\n" +
Console.WriteLine(); "\n --album-search Also search for \"[Album name][track name]\". Occasionally" +
Console.WriteLine(" --search-timeout <ms> Maximal search time (default: 10000)"); "\n helps to find more, slower." +
Console.WriteLine(" --max-stale-time <ms> Maximal download time with no progress (default: 60000)"); "\n --no-diacr-search Also perform a search without diacritics" +
Console.WriteLine(" --concurrent-processes <num> Max concurrent searches / downloads (default: 2)"); "\n --skip-existing Skip if a track matching the conditions is found in the" +
Console.WriteLine(" --max-retries <num> Maximum number of users to try downloading from before skipping track (default: 30)"); "\n output folder or your music library (if provided)" +
Console.WriteLine(); "\n --skip-notfound Skip searching for tracks that weren't found in Soulseek" +
Console.WriteLine(" --slow-output Enable if the progress bars aren't properly updated (bug)"); "\n last time" +
"\n --remove-ft Remove \"ft.\" or \"feat.\" and everything after from the track" +
"\n names." +
"\n --remove-strings <strings> Comma separated list of strings to remove when searching" +
"\n for tracks. Case insesitive." +
"\n --music-dir <path> Specify to also skip downloading tracks which are in your" +
"\n library, use with --skip-existing" +
"\n --reverse Download tracks in reverse order" +
"\n --skip-if-pref-failed Skip if preferred versions of a track exist but failed to" +
"\n download. If no pref. versions were found, download as " +
"\n usual." +
"\n --create-m3u Create an m3u playlist file" +
"\n --m3u-only Only create an m3u playlist file with existing tracks and" +
"\n exit" +
"\n --m3u <path> Where to place created m3u files (--parent by default)" +
"\n --yt-dlp Use yt-dlp to download tracks that weren't found on" +
"\n Soulseek. yt-dlp must be available from the command line." +
"\n --yt-dlp-f <format> yt-dlp audio format (default: \"bestaudio / best\")" +
"\n" +
"\n --search-timeout <ms> Maximal search time (default: 8000)" +
"\n --max-stale-time <ms> Maximal download time with no progress (default: 60000)" +
"\n --concurrent-processes <num> Max concurrent searches / downloads (default: 2)" +
"\n --max-retries <num> Maximum number of users to try downloading from before" +
"\n skipping track (default: 30)" +
"\n" +
"\n --slow-output Enable if the progress bars aren't properly updated (bug)");
} }
static async Task Main(string[] args) static async Task Main(string[] args)
@ -100,7 +127,7 @@ class Program
Console.ResetColor(); Console.ResetColor();
Console.OutputEncoding = System.Text.Encoding.UTF8; Console.OutputEncoding = System.Text.Encoding.UTF8;
if (args.Contains("--help") || args.Length == 0) if (args.Contains("--help") || args.Contains("-h") || args.Length == 0)
{ {
PrintHelp(); PrintHelp();
return; return;
@ -141,7 +168,7 @@ class Program
bool albumSearch = false; bool albumSearch = false;
bool createM3u = false; bool createM3u = false;
bool m3uOnly = false; bool m3uOnly = false;
int searchTimeout = 10000; int searchTimeout = 8000;
downloadMaxStaleTime = 60000; downloadMaxStaleTime = 60000;
int maxConcurrentProcesses = 2; int maxConcurrentProcesses = 2;
int maxRetriesPerTrack = 30; int maxRetriesPerTrack = 30;

View file

@ -1,8 +1,7 @@
{ {
"profiles": { "profiles": {
"slsk-batchdl": { "slsk-batchdl": {
"commandName": "Project", "commandName": "Project"
"commandLineArgs": "-s \"nanoray mimicloq\""
}, },
"YouTube": { "YouTube": {
"commandName": "Project", "commandName": "Project",