Skip to content

Commit f1df1e8

Browse files
committed
added playlists support and fixed bugs
1 parent 0454c5a commit f1df1e8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+33
-54
lines changed

GUI/backend.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ def artist(uri):
5252

5353
lf_artist_info = lastfm.getArtistsInfo(sp_artist_info['name'])
5454

55-
print(len(sp_artist_alb))
56-
print(len(sp_artist_alb_full))
57-
5855
#creating tags
5956
name = str(sp_artist_info['name']).replace(' ','')
6057

@@ -176,7 +173,6 @@ def search(q):
176173

177174
query = ' '.join(str(q).split('+'))
178175

179-
print(query)
180176

181177
results = user.search(query)
182178

@@ -222,7 +218,6 @@ def song(uri):
222218
def album(uri):
223219

224220
sp_album_data = user.getAlbumInfo(uri)[0]
225-
print(sp_album_data['art_id'])
226221
sp_artist_alb = user.getArtistsAlbums(sp_album_data['art_id'])
227222
sp_artist_r_a = user.getArtistsRelatedArtists(sp_album_data['art_id'])
228223

@@ -295,6 +290,21 @@ def downloadAlbum(uri):
295290
}
296291
)
297292

293+
@app.route("/downloadPlaylist/<uri>", methods=['GET','POST'])
294+
def downloadPlaylist(uri):
295+
296+
if request.method == 'POST':
297+
298+
music = expanduser("~") + '/Music'
299+
300+
subprocess.Popen(["python3", f"{os.getcwd()}/main.py", '-sp', f'https://open.spotify.com/playlist/{uri}', '-p', music])
301+
302+
return json.dumps(
303+
{
304+
'status': True
305+
}
306+
)
307+
298308
@app.route('/login', methods=['GET','POST'])
299309
def login():
300310

GUI/run.sh

Lines changed: 0 additions & 2 deletions
This file was deleted.

GUI/spotify.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,8 +1187,5 @@ def getAlbum(self, uri):
11871187
except: return None
11881188

11891189
if __name__ == '__main__':
1190-
u = Spotify.User()
1191-
s = Spotify()
1192-
1193-
res = u.search('Love')
1194-
print(res)
1190+
1191+
u = Spotify.User()

GUI/static/images/1.gif

-1.52 MB
Binary file not shown.

GUI/static/images/1.jpg

-163 KB
Binary file not shown.

GUI/static/images/1.webp

-175 KB
Binary file not shown.

GUI/static/images/10.jpg

-3.95 KB
Binary file not shown.

GUI/static/images/11.jpg

-123 KB
Binary file not shown.

GUI/static/images/2.gif

-432 KB
Binary file not shown.

GUI/static/images/2.jpg

-14.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)