mirror of
https://github.com/THIS-IS-NOT-A-BACKUP/zspotify.git
synced 2024-11-26 09:53:17 +01:00
Merge branch 'main' of https://github.com/Footsiefat/zspotify
This commit is contained in:
commit
6c0fc89696
@ -8,7 +8,7 @@
|
|||||||
<img src="https://user-images.githubusercontent.com/12180913/138040605-c9d46e45-3830-4a4b-a7ac-c56bb0d76335.png">
|
<img src="https://user-images.githubusercontent.com/12180913/138040605-c9d46e45-3830-4a4b-a7ac-c56bb0d76335.png">
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
[Discord Server](https://discord.gg/skVNQKtyFq) - [Matrix Server](https://matrix.to/#/#zspotify:matrix.org) - [Gitea Mirror](https://git.robinsmediateam.dev/Footsiefat/zspotify)
|
[Discord Server](https://discord.gg/skVNQKtyFq) - [Matrix Server](https://matrix.to/#/#zspotify:matrix.org) - [Gitea Mirror](https://git.robinsmediateam.dev/Footsiefat/zspotify) - [Main Site](https://footsiefat.github.io/)
|
||||||
```
|
```
|
||||||
Requirements:
|
Requirements:
|
||||||
|
|
||||||
|
49
zspotify.py
49
zspotify.py
@ -69,6 +69,20 @@ def sanitize_data(value):
|
|||||||
return value.replace("|", "-")
|
return value.replace("|", "-")
|
||||||
|
|
||||||
|
|
||||||
|
def split_input(selection):
|
||||||
|
""" Returns a list of inputted strings """
|
||||||
|
inputs = []
|
||||||
|
if "-" in selection:
|
||||||
|
for number in range(int(selection.split("-")[0]), int(selection.split("-")[1]) + 1):
|
||||||
|
inputs.append(number)
|
||||||
|
return inputs
|
||||||
|
else:
|
||||||
|
selections = selection.split(",")
|
||||||
|
for i in selections:
|
||||||
|
inputs.append(i.strip())
|
||||||
|
return inputs
|
||||||
|
|
||||||
|
|
||||||
def splash():
|
def splash():
|
||||||
""" Displays splash screen """
|
""" Displays splash screen """
|
||||||
print("=================================\n"
|
print("=================================\n"
|
||||||
@ -373,22 +387,25 @@ def search(search_term):
|
|||||||
if len(tracks) + len(albums) + len(playlists) == 0:
|
if len(tracks) + len(albums) + len(playlists) == 0:
|
||||||
print("NO RESULTS FOUND - EXITING...")
|
print("NO RESULTS FOUND - EXITING...")
|
||||||
else:
|
else:
|
||||||
position = int(input("SELECT ITEM BY ID: "))
|
selection = str(input("SELECT ITEM(S) BY ID: "))
|
||||||
|
inputs = split_input(selection)
|
||||||
if position <= total_tracks:
|
for pos in inputs:
|
||||||
track_id = tracks[position - 1]["id"]
|
position = int(pos)
|
||||||
download_track(track_id)
|
if position <= total_tracks:
|
||||||
elif position <= total_albums + total_tracks:
|
track_id = tracks[position - 1]["id"]
|
||||||
download_album(albums[position - total_tracks - 1]["id"])
|
download_track(track_id)
|
||||||
else:
|
elif position <= total_albums + total_tracks:
|
||||||
playlist_choice = playlists[position -
|
download_album(albums[position - total_tracks - 1]["id"])
|
||||||
total_tracks - total_albums - 1]
|
else:
|
||||||
playlist_songs = get_playlist_songs(token, playlist_choice['id'])
|
playlist_choice = playlists[position -
|
||||||
for song in playlist_songs:
|
total_tracks - total_albums - 1]
|
||||||
if song['track']['id'] is not None:
|
playlist_songs = get_playlist_songs(
|
||||||
download_track(song['track']['id'], sanitize_data(
|
token, playlist_choice['id'])
|
||||||
playlist_choice['name'].strip()) + "/")
|
for song in playlist_songs:
|
||||||
print("\n")
|
if song['track']['id'] is not None:
|
||||||
|
download_track(song['track']['id'], sanitize_data(
|
||||||
|
playlist_choice['name'].strip()) + "/")
|
||||||
|
print("\n")
|
||||||
|
|
||||||
|
|
||||||
def get_song_info(song_id):
|
def get_song_info(song_id):
|
||||||
|
Loading…
Reference in New Issue
Block a user