Getting Started - WatcherWhale/Netflix-Shakti.net GitHub Wiki
Getting Started
1. Add Shakti.net to your project
This can be done by either adding the dll or installing the nuget package
PM> Install-Package NetflixShakti.net
2. Login to Netflix
To log into Netflix we first have to ask the user's credentials, hereby we can log them into their account.
The Login
method is a static method that returns a instance with type Netflix
.
public Netflix _netflix;
public async void Login(string email, string password)
{
_netflix = await Netflix.Login(email,password);
}
3. Get Profiles
Now we can obtain all profile info from the diffrent profiles and add them to a dropdown for changing the current active profile.
public void LoadProfiles()
{
foreach (Profile prof in _netflix.Profiles.profiles)
{
//Skip the Kids profile, if you like
if (prof.rawFirstName == "Kids") continue;
//Load in the profile's avatar
var task = prof.GetAvatarImageStream(AvatarSizes.Size64);
//add profiles to a dropdown or somthing else
var dropItem = profilesDropDown.Items.Add(prof.firstName);
dropItem.Image = Image.FromStream(await task);
dropItem.Click += dropItem_Clicked;
}
}
private async void DropItem_Click(DropDownItem sender, EventArgs e)
{
//Switch the profile
await _netflix.SwitchProfile(_netflix.Profiles.GetProfileByName(e.Text));
}
4. Load View/Ratings History of current profile
Now we can switch between profiles and login to our Netflix account, the most logical step is to load our View/Ratings History.
public async void LoadViewHistory()
{
var history = await _netflix.GetViewHistory();
}
public async void LoadRatingHistory()
{
var ratings = await _netflix.GetRatingHistory();
}