CSharpSpotiLyrics 1.0.2
dotnet add package CSharpSpotiLyrics --version 1.0.2
NuGet\Install-Package CSharpSpotiLyrics -Version 1.0.2
<PackageReference Include="CSharpSpotiLyrics" Version="1.0.2" />
<PackageVersion Include="CSharpSpotiLyrics" Version="1.0.2" />
<PackageReference Include="CSharpSpotiLyrics" />
paket add CSharpSpotiLyrics --version 1.0.2
#r "nuget: CSharpSpotiLyrics, 1.0.2"
#:package CSharpSpotiLyrics@1.0.2
#addin nuget:?package=CSharpSpotiLyrics&version=1.0.2
#tool nuget:?package=CSharpSpotiLyrics&version=1.0.2
CSharpSpotiLyrics
A command-line tool built with C# to download lyrics from Spotify and save them as .lrc
files. This tool can fetch lyrics for individual tracks, albums, playlists, your currently playing song, items from your library, or even attempt to find lyrics for local audio files based on their metadata. (Included with dll.)
Alternative Languages (For README)
Türkçe
⚠️ Disclaimer ⚠️
This project might violate Spotify's Terms of Service. Use it responsibly and at your own risk. The developers assume no liability for any consequences resulting from its use.
Features
- Download lyrics for Spotify tracks, albums, or playlists using their URL or ID.
- Fetch lyrics for local audio files in a specified directory by reading metadata and searching Spotify.
- Download lyrics for the song currently playing on your Spotify account.
- Interactively select and download lyrics for albums or playlists saved in your Spotify library.
- Save lyrics in the standard
.lrc
format (synced lyrics). - Configuration file (
config.json
) for persistent settings (download path,sp_dc
token). - Command-line options to override configuration settings (download path, force overwrite).
- Interactive configuration management (edit, reset, open config file location).
- Authenticates using your Spotify
sp_dc
cookie. - Reports tracks for which lyrics could not be found or downloaded.
Prerequisites
- .NET SDK: You need the .NET SDK installed (e.g., .NET 6.0 or later recommended) to build and run the project. Download from here.
- Spotify
sp_dc
Cookie: The application requires a validsp_dc
cookie from your Spotify web session for authentication.
Installation / Setup
- Clone the Repository:
git clone https://github.com/s0rp/CSharpSpotiLyrics cd CSharpSpotiLyrics
- Build the Project (Optional but Recommended):
This compiles the code. You can run it directly usingdotnet build -c Release
dotnet run
or publish it for a standalone executable. (Dont forget to cd Cli dir!)
Configuration
Before using the application, you must configure your Spotify sp_dc
cookie.
1. How to get your sp_dc
Cookie:
Open your web browser and log in to open.spotify.com.
Open your browser's Developer Tools (usually by pressing
F12
).Go to the "Application" (Chrome/Edge) or "Storage" (Firefox) tab.
Find "Cookies" in the sidebar and select
https://open.spotify.com
.Locate the cookie named
sp_dc
.Copy its value. This is your token.
Security Note: Keep your
sp_dc
token secure. Do not share it, as it grants access to your Spotify account.
2. Setting the sp_dc
Cookie in the App:
- Run the application with the
edit
config action for the first time:
Or, if you have published an executable (e.g.,# From the project directory dotnet run -- --config edit
CSharpSpotiLyrics.exe
orCSharpSpotiLyrics
):./CSharpSpotiLyrics --config edit
- The application will guide you through creating/editing the configuration file (
config.json
). - Paste your copied
sp_dc
token when prompted. - Set your desired default download path.
- Configure other options like
ForceDownload
if needed.
The configuration file is typically stored in a platform-specific application data folder. The application will show the path when you first run it or when editing.
Other Config Actions:
--config reset
: Resets the configuration to default values (you will need to enter thesp_dc
token again).--config open
: Attempts to open the directory containing theconfig.json
file in your file explorer.
Usage
Run the application from your terminal within the project directory using dotnet run --
followed by arguments and options, or run the published executable directly.
Basic Syntax:
# Using dotnet run
dotnet run -- [options] [<url_or_path>]
# Using published executable (example)
./CSharpSpotiLyrics [options] [<url_or_path>]
Arguments:
url_or_path
(Optional): The Spotify URL/ID (track, album, playlist) or the path to a local directory containing audio files.
Options:
-d
,--directory <path>
: Specify a download directory for this run, overriding the config.-f
,--force
: Force download, even if.lrc
files already exist. Overrides config setting.-c
,--config <action>
: Manage configuration (edit
,reset
,open
).-u
,--user <item>
: Interact with the logged-in user's library (current
,album
,play
).
Examples:
- Download lyrics for a specific track URL:
dotnet run -- "https://open.spotify.com/track/your_track_id"
- Download lyrics for an album ID:
dotnet run -- spotify:album:your_album_id
- Download lyrics for a playlist URL:
dotnet run -- "https://open.spotify.com/playlist/your_playlist_id"
- Fetch lyrics for local files in a directory:
dotnet run -- "/path/to/your/music/folder"
- Download lyrics for the currently playing song:
dotnet run -- --user current
- Download lyrics for an album from your library (interactive selection):
dotnet run -- --user album
- Download lyrics for a playlist from your library (interactive selection):
dotnet run -- --user play
- Download track lyrics, overriding download path:
dotnet run -- --directory "/custom/lyrics/path" "spotify:track:your_track_id"
- Force download lyrics for an album:
dotnet run -- --force "spotify:album:your_album_id"
Credits
- Development & C# Implementation: S0rp
- Code Rewriting & Arrangement: Dixiz 3A
- Original Concept / Python Implementation Inspiration: syrics by akashrchandran
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- System.Net.Http.Json (>= 9.0.4)
- System.Runtime (>= 4.3.1)
- System.Text.Json (>= 9.0.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.