import discogs_client as dc
import json
import requests

#d = discogs_client.Client('DJ_Release_Dates')
#d.set_consumer_key('wpWGqDotakGvrspWyVSA', 'oZJfCfUuJxJlXRnDhUuOTqlYFzDrhwrZ')
#d.get_authorize_url()
#('request-token', 'request-secret', 'authorize-url-here')
#print(d.user)

#ds = dc.Client('my_user_agent/1.0', user_token='wbocwJpmlZUGfyTPSgoYdhGBrIETiyfYEMqEgdnA')

#https://api.discogs.com/database/search?q=Nirvana" -H "Authorization: Discogs key=wpWGqDotakGvrspWyVSA, secret=oZJfCfUuJxJlXRnDhUuOTqlYFzDrhwrZ

#query = "https://api.discogs.com/database/search?q=Wishbone%20Ash"
#query = "http://api.discogs.com/database/search?type=master&artist=Santana&release_title=Samba+Pa+Ti"
#headers={"Content-type": "application/json","Authorization": "Discogs key=wpWGqDotakGvrspWyVSA, secret=oZJfCfUuJxJlXRnDhUuOTqlYFzDrhwrZ"}
#response = requests.request("get", url=query, headers=headers)

query = "http://musicbrainz.org/ws/2/release/?query=release:Milk%20AND%20Alcohol&fmt=json"
headers={"Content-type": "application/json"}
response = requests.request("get", url=query, headers=headers)

json_data = json.loads(response.text)
print(json_data)
print()
print()
print(json_data["releases"][0]["title"])
#print(json_data["results"][3]["title"])
print(json_data["releases"][0]["date"])
#query = "https://api.spotify.com/v1/me/player/currently-playing"
#headers={"Content-type": "application/json","Authorization": "Bearer {}".format(self.spotify_token)}
#response = requests.request("get", url=query, headers=headers)

