public static RawMercuryRequest Sub(string uri) { var r = new RawMercuryRequest(uri, "SUB"); r.AddUserField("Accept-Language", "1202656e"); return(r); }
public T Request <T>( [NotNull] SearchRequest <T> req, bool outputString) where T : SearchBase { if (req.Username.IsEmpty()) { req.Username = _session.Username; } if (req.Country.IsEmpty()) { req.Country = _session.CountryCode; } if (req.Locale.IsEmpty()) { req.Locale = _session.Locale; } if (!outputString) { return(_session.Mercury().SendSync(new JsonMercuryRequest <T>(RawMercuryRequest.Get(req.BuildUrl())))); } else { var test = _session.Mercury().SendSync(new JsonMercuryRequest <string>(RawMercuryRequest.Get(req.BuildUrl()))); Debug.WriteLine(test); return(default(T)); } }
public static ProtobuffedMercuryRequest <MercuryMultiGetReply> MultiGet(string uri, IEnumerable <MercuryRequest> requests) { var request = new RawMercuryRequest( uri, "GET", requests) .ContentType("vnd.spotify/mercury-mget-request"); return(new ProtobuffedMercuryRequest <MercuryMultiGetReply>(request, MercuryMultiGetReply.Parser)); }
public JsonMercuryRequest([NotNull] RawMercuryRequest request) { this.Request = request; }
public ProtobuffedMercuryRequest([NotNull] RawMercuryRequest request, MessageParser <T> parser) { this.Request = request; _parser = parser; }
public static JsonMercuryRequest <string> GetStationFor([NotNull] string context) { return(new JsonMercuryRequest <string>(RawMercuryRequest.Get("hm://radio-apollo/v3/stations/" + context))); }
public static RawMercuryRequest AutoplayQuery([NotNull] string context) { return(RawMercuryRequest.Get("hm://autoplay-enabled/query?uri=" + context)); }
public static JsonMercuryRequest <MercuryArtist> GetArtist([NotNull] ArtistId id) { return(new JsonMercuryRequest <MercuryArtist>(RawMercuryRequest.Get(id.ToMercuryUri()))); }
public static JsonMercuryRequest <string> GetGenericJson([NotNull] string uri) { return(new JsonMercuryRequest <string>(RawMercuryRequest.Get(uri))); }
public static JsonMercuryRequest <StoredToken> RequestToken([NotNull] string deviceId, [NotNull] string[] scope) { return(new JsonMercuryRequest <StoredToken>(RawMercuryRequest.Get( $"hm://keymaster/token/authenticated?scope={string.Join(",", scope)}&client_id={KEYMASTER_CLIENT_ID}&device_id={deviceId}"))); }
public static JsonMercuryRequest <string> ResolveContext([NotNull] string uri) { return(new JsonMercuryRequest <string>(RawMercuryRequest.Get( $"hm://context-resolve/v1/{uri}"))); }