diff --git a/spotdl/internals.py b/spotdl/internals.py index 854a3dc..64a3acc 100644 --- a/spotdl/internals.py +++ b/spotdl/internals.py @@ -258,7 +258,7 @@ def remove_duplicates(tracks): def content_available(url): try: response = urllib.request.urlopen(url) - except HTTPError: + except urllib.request.HTTPError: return False else: return response.getcode() < 300 diff --git a/test/test_patcher.py b/test/test_patcher.py index f0f92aa..3c9ba65 100644 --- a/test/test_patcher.py +++ b/test/test_patcher.py @@ -23,12 +23,12 @@ class TestMethodCalls: def test_pafy_getbestthumb(self, content_fixture): thumbnail = patcher._getbestthumb(content_fixture) - assert thumbnail == "https://i.ytimg.com/vi/3nQNiWdeH2Q/maxresdefault.jpg" + assert thumbnail == "https://i.ytimg.com/vi/3nQNiWdeH2Q/hqdefault.jpg" def test_pafy_getbestthumb_without_ytdl(self, content_fixture): content_fixture._ydl_info["thumbnails"][0]["url"] = None thumbnail = patcher._getbestthumb(content_fixture) - assert thumbnail == "https://i.ytimg.com/vi/3nQNiWdeH2Q/maxresdefault.jpg" + assert thumbnail == "https://i.ytimg.com/vi/3nQNiWdeH2Q/sddefault.jpg" def test_pafy_content_available(self): diff --git a/test/test_spotify_tools.py b/test/test_spotify_tools.py index e0bc28d..b7d3dfe 100644 --- a/test/test_spotify_tools.py +++ b/test/test_spotify_tools.py @@ -141,7 +141,7 @@ class TestFetchAlbumsFromArtist: return albums def test_len(self, albums_from_artist_fixture): - assert len(albums_from_artist_fixture) == 53 + assert len(albums_from_artist_fixture) == 54 def test_zeroth_album_name(self, albums_from_artist_fixture): assert albums_from_artist_fixture[0]["name"] == "Revolution Radio"