Skip to content

Commit

Permalink
misc: fix warnings (#1400)
Browse files Browse the repository at this point in the history
* misc: fix warnings

* misc: fix spotipy warning
  • Loading branch information
xnetcat committed Oct 22, 2021
1 parent 2b5f9cf commit 209dfde
Show file tree
Hide file tree
Showing 10 changed files with 24,811 additions and 24,827 deletions.
3 changes: 2 additions & 1 deletion spotdl/parsers/query_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,10 @@ def get_youtube_meta_track(
return None

# (try to) Get lyrics from musixmatch/genius
# use musixmatch as the default provider
if lyrics_provider == "genius":
lyrics = lyrics_providers.get_lyrics_genius(song_name, contributing_artist)
elif lyrics_provider == "musixmatch":
else:
lyrics = lyrics_providers.get_lyrics_musixmatch(song_name, contributing_artist)

return SongObject(
Expand Down
2 changes: 1 addition & 1 deletion spotdl/providers/lyrics_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def get_lyrics_musixmatch(
lyrics = get_lyrics_musixmatch(song_name, song_artists, track_search=True)
return lyrics

song_url = "https://www.musixmatch.com" + song_url_tag.get("href")
song_url = "https://www.musixmatch.com" + str(song_url_tag.get("href", ""))
lyrics_resp = get(song_url, headers=user_agent)
if not lyrics_resp.ok:
return ""
Expand Down
5 changes: 3 additions & 2 deletions spotdl/search/song_gatherer.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ def from_spotify_url(
print(f'Found YouTube URL for "{display_name}" : {youtube_link}')

# (try to) Get lyrics from musixmatch/genius
# use musixmatch as the default provider
if lyrics_provider == "genius":
lyrics = lyrics_providers.get_lyrics_genius(song_name, contributing_artists)
elif lyrics_provider == "musixmatch":
else:
lyrics = lyrics_providers.get_lyrics_musixmatch(song_name, contributing_artists)

return SongObject(
Expand Down Expand Up @@ -270,7 +271,7 @@ def from_playlist(
spotify_client = SpotifyClient()
tracks = []

playlist_response = spotify_client.playlist_tracks(playlist_url)
playlist_response = spotify_client.playlist_items(playlist_url)
if playlist_response is None:
raise ValueError("Wrong playlist id")

Expand Down
22,943 changes: 11,457 additions & 11,486 deletions tests/cassettes/test_download_a_playlist.yaml

Large diffs are not rendered by default.

2,003 changes: 1,001 additions & 1,002 deletions tests/cassettes/test_download_a_single_song.yaml

Large diffs are not rendered by default.

14,917 changes: 7,445 additions & 7,472 deletions tests/cassettes/test_download_an_album.yaml

Large diffs are not rendered by default.

3,421 changes: 1,733 additions & 1,688 deletions tests/cassettes/test_download_long_artists_song.yaml

Large diffs are not rendered by default.

3,404 changes: 1,700 additions & 1,704 deletions tests/cassettes/test_download_single_song.yaml

Large diffs are not rendered by default.

2,936 changes: 1,467 additions & 1,469 deletions tests/cassettes/test_multiple_elements.yaml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions tests/cassettes/test_search_and_download.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interactions:
Accept-Encoding:
- gzip, deflate
Authorization:
- Bearer BQBGxr4bsEeZw-udeKLnYy-8FkJEL0FAO12t_kjp-3S1tZUDUBsNPJskuU4h8oZZx7cbs5NuVIz97PvwSNI
- Bearer BQAeY1_FgliDCv6ftZU-L8OnXPukGtSTkkOYEX_4HbUapDE7YErp-7eRaoR6jTvwKL4Fnl45ufR68_J4iHY
Connection:
- keep-alive
Content-Type:
Expand Down Expand Up @@ -48,7 +48,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Thu, 21 Oct 2021 16:42:21 GMT
- Fri, 22 Oct 2021 08:52:15 GMT
server:
- envoy
strict-transport-security:
Expand Down

0 comments on commit 209dfde

Please sign in to comment.