Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading;
- using System.Threading.Tasks;
- using SpotifyAPI.Web;
- using SpotifyAPI.Web.Auth;
- using SpotifyAPI.Web.Enums;
- using SpotifyAPI.Web.Models;
- namespace SpotifyLocalAPI
- {
- class Program
- {
- private static SpotifyWebAPI _spotify = null;
- private static async void RunAuthentication()
- {
- WebAPIFactory webApiFactory = new WebAPIFactory(
- "http://localhost",
- 8000,
- "YOUR_APPLICATION_SECRET_KEY_KEY_HERE",
- Scope.UserReadPrivate | Scope.UserReadEmail | Scope.PlaylistReadPrivate | Scope.UserLibraryRead |
- Scope.UserReadPrivate | Scope.UserFollowRead | Scope.UserReadBirthdate | Scope.UserTopRead | Scope.PlaylistReadCollaborative |
- Scope.UserReadRecentlyPlayed | Scope.UserReadPlaybackState | Scope.UserModifyPlaybackState);
- try
- {
- _spotify = await webApiFactory.GetWebApi();
- }
- catch (Exception ex)
- {
- Console.WriteLine(ex.Message);
- }
- }
- static void Main(string[] args)
- {
- Task.Run(() => RunAuthentication()).Wait();
- Console.WriteLine("Hello");
- _spotify.PausePlayback();
- Thread.Sleep(2000);
- _spotify.ResumePlayback();
- var g = _spotify.GetPlayback();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement