mirror of
https://github.com/cooperhammond/irs.git
synced 2025-07-07 15:50:31 +00:00
added to README and hopefully fixed the authorization bug.
This commit is contained in:
parent
40ae6b3561
commit
10334d8e19
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
> A music downloader that understands your metadata needs.
|
> A music downloader that understands your metadata needs.
|
||||||
|
|
||||||
A tool to download your music with metadata. It uses [Spotify](https://www.spotify.com/) for finding metadata and [Youtube](https://www.youtube.com/) for the actual audio source.
|
A tool to download your music with metadata. It uses [Spotify](https://www.spotify.com/) for finding metadata and [Youtube](https://www.youtube.com/) for the actual audio source. You will need to have some Spotify tokens, the instructions to set them up are [here](https://github.com/kepoorhampond/irs#spotify-tokens).
|
||||||
|
|
||||||
Works with Python 2 and 3.
|
Works with Python 2 and 3.
|
||||||
|
|
||||||
|
@ -74,9 +74,11 @@ Other than `ffmpeg` though, all other dependencies are automatically installed w
|
||||||
$ sudo pip install irs
|
$ sudo pip install irs
|
||||||
```
|
```
|
||||||
|
|
||||||
## Spotify Playlists
|
**You will need to have some Spotify tokens, the instructions to set them up are [here](https://github.com/kepoorhampond/irs#spotify-tokens).**
|
||||||
|
|
||||||
To download spotify playlists, you'll want to head to their Dev Apps page, [here](https://developer.spotify.com/my-applications/). After doing that you'll want to create a new app. Name it whatever you want and then once you've done that, find the `Client ID` and `Client Secret` keys. You'll want to take those keys and paste them into your system's environment variables as `SPOTIFY_CLIENT_ID` and `SPOTIFY_CLIENT_SECRET`, correspondingly. Viola! You can now download playlists!
|
## Spotify Tokens
|
||||||
|
|
||||||
|
To download metadata through spotify, you'll want to head to their Dev Apps page, [here](https://developer.spotify.com/my-applications/). After doing that you'll want to create a new app. Name it whatever you want and then once you've done that, find the `Client ID` and `Client Secret` keys. You'll want to take those keys and paste them into your system's environment variables as `SPOTIFY_CLIENT_ID` and `SPOTIFY_CLIENT_SECRET`, correspondingly. Viola! You can now download metadata with IRS!
|
||||||
|
|
||||||
## Metadata
|
## Metadata
|
||||||
|
|
||||||
|
|
|
@ -56,9 +56,9 @@ class Metadata:
|
||||||
mp3.save()
|
mp3.save()
|
||||||
|
|
||||||
|
|
||||||
def find_album_and_track(song, artist):
|
def find_album_and_track(song, artist, spotify=spotipy.Spotify()):
|
||||||
tracks = spotipy.Spotify().search(q=song, type="track"
|
tracks = spotify.search(q=song, type="track")["tracks"]["items"]
|
||||||
)["tracks"]["items"]
|
|
||||||
for track in tracks:
|
for track in tracks:
|
||||||
if om.blank_include(track["name"], song):
|
if om.blank_include(track["name"], song):
|
||||||
if om.blank_include(track["artists"][0]["name"], artist):
|
if om.blank_include(track["artists"][0]["name"], artist):
|
||||||
|
|
|
@ -324,7 +324,7 @@ with init, or in method arguments.")
|
||||||
return locations
|
return locations
|
||||||
|
|
||||||
def parse_song_data(self, song, artist):
|
def parse_song_data(self, song, artist):
|
||||||
album, track = find_album_and_track(song, artist)
|
album, track = find_album_and_track(song, artist, self.spotify)
|
||||||
if album is False:
|
if album is False:
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
# from irs.ripper import Ripper
|
from irs.ripper import Ripper
|
||||||
|
|
||||||
# print ("[*] Testing `song.py`")
|
print ("[*] Testing `song.py`")
|
||||||
|
Ripper().song("Da Frame 2R", "Arctic Monkeys")
|
||||||
print("Currently spotify has made it required for you to have a token to \
|
print ("[+] Passed!")
|
||||||
search through songs, so I'm skipping testing this file for Travic CI.")
|
|
||||||
|
|
||||||
# Ripper().song("Da Frame 2R", "Arctic Monkeys")
|
|
||||||
# print ("[+] Passed!")
|
|
||||||
|
|
Loading…
Reference in a new issue