Skip to content

Commit ef6a166

Browse files
authored
bugfix: replaced youtube-dl with yt-dlp (spotDL#1374)
* bugfix: removed wrong (and unused) exception * bugfix: replaced yt-dl with yt-dlp misc: regenerate cassettes misc: regenerate cassettes again
1 parent a6adf7b commit ef6a166

10 files changed

+54728
-53495
lines changed

setup.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ classifiers =
2828
[options]
2929
include_package_data = true
3030
install_requires =
31-
spotipy
32-
pytube
31+
spotipy >= 2.19.0
32+
pytube >= 11.0.0
3333
rich
3434
rapidfuzz
3535
mutagen
3636
ytmusicapi
37-
youtube_dl
37+
yt-dlp
3838
tqdm
3939
beautifulsoup4
4040
requests

spotdl/download/downloader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import concurrent.futures
66

77
from pathlib import Path
8-
from youtube_dl import YoutubeDL
8+
from yt_dlp import YoutubeDL
99
from typing import List, Optional
1010

1111
from spotdl.search import SongObject

spotdl/providers/provider_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def _get_smaller_file_path(input_song, output_format: str) -> Path:
126126

127127
try:
128128
return Path(f"{smaller_name}.{output_format}").resolve()
129-
except (OSError, WindowsError):
129+
except OSError:
130130
# Expected to happen in the rare case when the saved path is too long,
131131
# even with the short filename
132132
raise OSError("Cannot save song due to path issues.")
@@ -166,7 +166,7 @@ def _get_converted_file_path(song_obj, output_format: str = None) -> Path:
166166
if len(str(converted_file_path.resolve().name)) > 256:
167167
print("Path was too long. Using Small Path.")
168168
return _get_smaller_file_path(song_obj, output_format)
169-
except (OSError, WindowsError):
169+
except OSError:
170170
return _get_smaller_file_path(song_obj, output_format)
171171

172172
return converted_file_path

tests/cassettes/test_download_a_playlist.yaml

Lines changed: 14644 additions & 13999 deletions
Large diffs are not rendered by default.

tests/cassettes/test_download_a_single_song.yaml

Lines changed: 1615 additions & 1603 deletions
Large diffs are not rendered by default.

tests/cassettes/test_download_an_album.yaml

Lines changed: 30964 additions & 31422 deletions
Large diffs are not rendered by default.

tests/cassettes/test_download_long_artists_song.yaml

Lines changed: 1880 additions & 1429 deletions
Large diffs are not rendered by default.

tests/cassettes/test_download_single_song.yaml

Lines changed: 1893 additions & 1474 deletions
Large diffs are not rendered by default.

tests/cassettes/test_multiple_elements.yaml

Lines changed: 3724 additions & 3560 deletions
Large diffs are not rendered by default.

tests/cassettes/test_search_and_download.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ interactions:
77
Accept-Encoding:
88
- gzip, deflate
99
Authorization:
10-
- Bearer BQBbSe1hJOnpkb4G2InTMhA2mE7A3uZ05jxOiHTHKUNJlqUPy0mFp-z7-01Xe0NC_Ldg7uZrycpwAafON5c
10+
- Bearer BQAZWdfkrJFAjE_JkZzWo0qEVvfs8s1lJyQ5JfACHhyqE8TcFYily0YtM1ssFOWV_So9JTEDgcP7vzoVkLw
1111
Connection:
1212
- keep-alive
1313
Content-Type:
@@ -48,7 +48,7 @@ interactions:
4848
content-type:
4949
- application/json; charset=utf-8
5050
date:
51-
- Mon, 26 Jul 2021 23:10:26 GMT
51+
- Tue, 24 Aug 2021 22:59:17 GMT
5252
server:
5353
- envoy
5454
strict-transport-security:

0 commit comments

Comments
 (0)