Skip to content

Hendo16/YtMusicNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YTMusicNet

codecov

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

Setup

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");

Usage

The library currently has 3 endpoints, with progress supporting the full coverage of the original API ongoing. These endpoints are:

GetArtist

Returns a Artist object based on the provided browseId, typically found within a Result

Artist? artistObj = await client?.Browse.GetArtist("UC8txE2ZyN2Sh8XxH5OkHLSw");

YTMusicAPI Porting Progress

Progress Progress Progress

Browse (5/12)

  • GetHome
  • GetArtist
  • GetArtistAlbums
  • GetAlbum
  • GetUser
  • GetUserPlaylists
  • GetUserVideos
  • GetSong
  • GetSongRelated
  • GetLyrics
  • GetTasteProfile
  • SetTasteProfile

Search (1/3)

  • Search
  • GetSearchSuggestions
  • RemoveSearchSuggestions

Playlists (4/6)

  • GetPlaylist
  • CreatePlaylist
  • EditPlaylist
  • DeletePlaylist
  • AddPlaylistItems
  • RemovePlaylistItems

About

.NET port of ytmusicapi

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages