Skip to content

Commit

Permalink
Update UI
Browse files Browse the repository at this point in the history
  • Loading branch information
rickystar04 committed Sep 5, 2023
1 parent 7fd08c2 commit 3b602b3
Show file tree
Hide file tree
Showing 13 changed files with 12 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .cache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"access_token": "BQC0RCFKCRLQ0nsB--RjG_e3ImRvJSPRyVTOE3biPusfzDdv9ftDHsYtUeVHa1XdQSkxGkzLu2vZsaoRKSztAImV1U10gkg5LEuaUXkYJzuO_FJNJc5c3mGn7nXo_lAXXfTo9NuSWvB8K9lX9jNmq_SrHpsEoUs9qB5lRDmJPqXsF3kRQdH63Wa58yeFVt3vpV5LNtxgBr2IZKtp0l4xwJWgi0GHF3RoSfcQ0_g", "token_type": "Bearer", "expires_in": 3600, "scope": "playlist-read-private", "expires_at": 1693936114, "refresh_token": "AQDqUnHtRMiT07gOyNOlmNIRJH4AbRbLC0Ao0ZkDxeg5TyzS5onWV-RfwqTlay5E_k7Tajn2LPnqtf2lUkkv_jTal6dxpK0XBAxU-DYUiudJC7AFM-FKLIZPjNvgAX0hI7E"}
{"access_token": "BQA76tRyrhR8HhCsWbcjJ-38oqQa_m5Qf36NKEevDIpUwgDn7Q-UHUs8Zg0A0yf15JILQUOKUz9tz2okdIhYg305J9INQlUcnzGAfKeKondpGYEE7KfIWY1IyRiXzGZI7JfSiCSgEQGRnTwQVcI1NAzfeGShy58oHpUMm94L8YNo7J3JlWLgKg4VUZXaeQmUxCs9neYnCD2Cpc4", "token_type": "Bearer", "expires_in": 3600, "refresh_token": "AQDgdu1MRTjae1XBBj8lfG8JMTq5EsFTZR_WS34JWnm11e_F07krfSrz_am9QSNgMNwcUzuYRhd8NGMwoVHESCkt0rBcSDcDz_6DK9EzHQaPfirjcSEPLIZ4POHU9UgtHgE", "scope": "playlist-read-private", "expires_at": 1693938102}
1 change: 0 additions & 1 deletion modules/.cache

This file was deleted.

Binary file removed modules/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file removed modules/__pycache__/banner.cpython-311.pyc
Binary file not shown.
Binary file removed modules/__pycache__/color.cpython-311.pyc
Binary file not shown.
Binary file removed modules/__pycache__/convert.cpython-311.pyc
Binary file not shown.
Binary file removed modules/__pycache__/cred.cpython-311.pyc
Binary file not shown.
Binary file removed modules/__pycache__/download_thread.cpython-311.pyc
Binary file not shown.
Binary file removed modules/__pycache__/metadata.cpython-311.pyc
Binary file not shown.
Binary file removed modules/__pycache__/spotify.cpython-311.pyc
Binary file not shown.
4 changes: 2 additions & 2 deletions modules/cred.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
client_ID = ""
client_SECRET = ""
client_ID = "ae49e6be16674c81a0ebdb8f68fcc029"
client_SECRET = "e4503a68d1ee42f59595362825fc411d"
redirect_url = "http://localhost:9000"
4 changes: 2 additions & 2 deletions modules/download_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@

def download_songs(record, filelocation, i, playlist, progress_callback):
url = record["song_link"]
tqdm.write(f"Downloading song {i}...")
# tqdm.write(f"Downloading song {i}...")
try:
html = urllib.request.urlopen(url)
link = re.findall(r"watch\?v=(\S{11})", html.read().decode())
if len(link) > 0:
url = "https://www.youtube.com/watch?v=" + link[0]
print("URL:" + url)
# yt = YouTube(url)# , use_oauth=True, allow_oauth_cache=False)
# video = yt.streams.first()

# original = video.default_filename
# video.download(filelocation)
ydl_opts = {
"noprogress": True,
"quiet": True,
"no_warnings": True,
"format": "mp3/bestaudio/best",
Expand Down
20 changes: 7 additions & 13 deletions modules/spotify.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,15 @@ def checkAuth():
scope = "playlist-read-private"
try:
# sp = spotipy.Spotify(auth_manager=SpotifyOAuth(client_id=cred.client_ID,
# client_secret=cred.client_SECRET, redirect_uri=cred.redirect_url, scope=scope))
# client_secret=cred.client_SECRET, redirect_uri=cred.redirect_url, scope=scope))
client_id = cred.client_ID
client_secret = cred.client_SECRET
# print("ID: " + client_id)
# print("SECRET: " + client_secret)
sp = spotipy.Spotify(
auth_manager=SpotifyOAuth(
client_id="ae49e6be16674c81a0ebdb8f68fcc029",
client_secret="e4503a68d1ee42f59595362825fc411d",
client_id=client_id,
client_secret=client_secret,
redirect_uri="http://localhost:9000",
scope=scope,
)
Expand All @@ -144,29 +148,19 @@ def song_download(playlist_id):
scope=scope,
)
)
print("3")
playlist_id = playlist_id
print("4")
print(playlist_id)
playlist_URI = playlist_id.split("/")[-1].split("?")[0]
print(playlist_URI)
print("5")
try:
playlist = sp.playlist(playlist_URI)
print("6")
results = sp.playlist_tracks(playlist_URI)
print("7")

return playlist_download(playlist, results)

except Exception:
try:
album = sp.album(playlist_URI)
print("8")
results = sp.album_tracks(playlist_URI)
print("9")
image_link = album["images"][0]["url"]
print(image_link)
return album_download(album, results, image_link)
except Exception as e:
print("ERRORE: " + str(e))
Expand Down

0 comments on commit 3b602b3

Please sign in to comment.