// using System.Net; // at beginning of code.
String spotiuri = "spotify:user:spotify:playlist:5O2ERf8kAYARVVdfCKZ9G7";
String spotibase = "https://abcdefghij.spotilocal.com:4370/";
WebClient web = new WebClient();
web.Headers.Add("Origin", "https://open.spotify.com");
String csrf = web.DownloadString(spotibase + "simplecsrf/token.json");
csrf = csrf.Substring(12);
csrf = csrf.Substring(0, 32);
String oauth = web.DownloadString("https://open.spotify.com/token");
oauth = oauth.Substring(6);
oauth = oauth.Substring(0, oauth.Length - 2);
web.DownloadString(spotibase + "remote/play.json?oauth=" + oauth + "&csrf=" + csrf + "&uri=" + spotiuri + "&context=" + spotiuri);using System;
using System.Drawing;
using System.Net;
public static class VoiceBotScript
{
public static void Run(IntPtr windowHandle)
{
string spotiuri = "spotify:user:spotify:playlist:5O2ERf8kAYARVVdfCKZ9G7";
string spotibase = "https://abcdefghij.spotilocal.com:4370/";
WebClient web = new WebClient();
web.Headers.Add("Origin", "https://open.spotify.com");
string csrf = web.DownloadString(spotibase + "simplecsrf/token.json");
csrf = csrf.Substring(12);
csrf = csrf.Substring(0, 32);
string oauth = web.DownloadString("https://open.spotify.com/token");
oauth = oauth.Substring(6);
oauth = oauth.Substring(0, oauth.Length - 2);
web.DownloadString(spotibase + "remote/play.json?oauth=" + oauth + "&csrf=" + csrf + "&uri=" + spotiuri + "&context=" + spotiuri);
}
}