This repository was archived by the owner on Apr 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Getting Started
Mathias Maes edited this page Dec 21, 2017
·
5 revisions
This can be done by either adding the dll or installing the nuget package
PM> Install-Package NetflixShakti.net
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);
}
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));
}
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();
}