This is a .NET port of the wonderful ytmusicapi created by sigma67.
Still very much in-progress but have been able to use this to facilitate basic browsing of artists, albums and tracks in other applications
Setting up the client to interface with the library is as easy as creating a new instance like so:
using YtMusicNet;
YtMusicClient client = await YtMusicClient.CreateAsync();
Currently, YtMusicNet supports authenticated logins through the 'Browser' authentication method detailed here. Once you have the request headers, you can generate the browser.json through the NetworkHandler
using YtMusicNet;
var json = NetworkHandler.BrowserSetup(requestHeaders);
File.WriteAllText(authPath, json);
Where 'authPath' is the path to the 'browser.json' file on your end.
Once this is generated, or if you already had one from using ytmusicapi - you can pass this through to the factory creator.
using YtMusicNet;
YtMusicClient client = await YtMusicClient.CreateAsync(authFilePath:"browser.json");
YtMusicNet also allows you to provide your own proxy URL, particularily useful for further debugging
using YtMusicNet;
YtMusicClient client = await YtMusicClient.CreateAsync(proxyUrl:"http://localhost:8000");
The library currently has 3 endpoints, with progress supporting the full coverage of the original API ongoing. These endpoints are:
Returns a Artist object based on the provided browseId, typically found within a Result
Artist? artistObj = await client?.Browse.GetArtist("UC8txE2ZyN2Sh8XxH5OkHLSw");
- GetHome
- GetArtist
- GetArtistAlbums
- GetAlbum
- GetUser
- GetUserPlaylists
- GetUserVideos
- GetSong
- GetSongRelated
- GetLyrics
- GetTasteProfile
- SetTasteProfile
- Search
- GetSearchSuggestions
- RemoveSearchSuggestions
- GetPlaylist
- CreatePlaylist
- EditPlaylist
- DeletePlaylist
- AddPlaylistItems
- RemovePlaylistItems