# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     name: python3
# ---

# + [markdown] id="view-in-github" colab_type="text"
# <a href="https://colab.research.google.com/github/UmbraVenus/DreamscapeColab/blob/main/coverart.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>

# + colab={"base_uri": "https://localhost:8080/"} id="DUkwlNp0LExi" outputId="1189f3b5-6442-47ed-d46f-a100aab587b0"
# !pip install pylast
# !pip install pillow

# + id="kiqqqT4uLIJs"
import pylast
import requests
from PIL import Image
import urllib.request

# + id="aT7tz9LOMIGB"
API_KEY = "<KEY>"
API_SECRET = "07ca82ca31889f736dd709c4501506b8"

# + id="_ehpYgvXMyLn"
network = pylast.LastFMNetwork(
    api_key = API_KEY,
    api_secret = API_SECRET,
)

# + colab={"base_uri": "https://localhost:8080/"} id="MdFMHqlCTIxR" outputId="1e1ae5ae-cfb4-41ca-cf1f-0015862bdf79"
network.get_top_tracks()[0]

# + id="nqrRVp0UTjOI"
top = network.get_album("<NAME>",'good 4 u')

# + colab={"base_uri": "https://localhost:8080/", "height": 317} id="qbqwtZzlT7fa" outputId="c496b304-2a38-4431-cead-9a5fa48313a6"
sample = requests.get(top.get_cover_image(),stream=True).raw
Image.open(sample)

# + id="u4p5NYhtVbpn"


StarcoderdataJupyterScriptsDedupFiltered