Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: replaced youtube-dl with yt-dlp #1374

Merged
merged 2 commits into from
Aug 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ classifiers =
[options]
include_package_data = true
install_requires =
spotipy
pytube
spotipy >= 2.19.0
pytube >= 11.0.0
rich
rapidfuzz
mutagen
ytmusicapi
youtube_dl
yt-dlp
tqdm
beautifulsoup4
requests
Expand Down
2 changes: 1 addition & 1 deletion spotdl/download/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import concurrent.futures

from pathlib import Path
from youtube_dl import YoutubeDL
from yt_dlp import YoutubeDL
from typing import List, Optional

from spotdl.search import SongObject
Expand Down
4 changes: 2 additions & 2 deletions spotdl/providers/provider_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def _get_smaller_file_path(input_song, output_format: str) -> Path:

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

return converted_file_path
28,643 changes: 14,644 additions & 13,999 deletions tests/cassettes/test_download_a_playlist.yaml

Large diffs are not rendered by default.

3,218 changes: 1,615 additions & 1,603 deletions tests/cassettes/test_download_a_single_song.yaml

Large diffs are not rendered by default.

62,386 changes: 30,964 additions & 31,422 deletions tests/cassettes/test_download_an_album.yaml

Large diffs are not rendered by default.

3,309 changes: 1,880 additions & 1,429 deletions tests/cassettes/test_download_long_artists_song.yaml

Large diffs are not rendered by default.

3,367 changes: 1,893 additions & 1,474 deletions tests/cassettes/test_download_single_song.yaml

Large diffs are not rendered by default.

7,284 changes: 3,724 additions & 3,560 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 BQBbSe1hJOnpkb4G2InTMhA2mE7A3uZ05jxOiHTHKUNJlqUPy0mFp-z7-01Xe0NC_Ldg7uZrycpwAafON5c
- Bearer BQAZWdfkrJFAjE_JkZzWo0qEVvfs8s1lJyQ5JfACHhyqE8TcFYily0YtM1ssFOWV_So9JTEDgcP7vzoVkLw
Connection:
- keep-alive
Content-Type:
Expand Down Expand Up @@ -48,7 +48,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Mon, 26 Jul 2021 23:10:26 GMT
- Tue, 24 Aug 2021 22:59:17 GMT
server:
- envoy
strict-transport-security:
Expand Down