mirror of
https://github.com/KevinMidboe/spotify-downloader.git
synced 2025-10-29 18:00:15 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2290167af4 | |||
|
|
252d945996 | ||
|
|
d53a6ea471 | ||
|
|
c1b3949edb | ||
|
|
6288e3c6e5 | ||
|
|
2aa7dce4a4 |
13
CHANGES.md
13
CHANGES.md
@@ -8,6 +8,19 @@ The release dates mentioned follow the format `DD-MM-YYYY`.
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [2.0.5] - 20-05-2020
|
||||||
|
### Fixed
|
||||||
|
- In some cases when using `-f` to create sub-directories from metadata, where the
|
||||||
|
full slugified download filename and the non-slugified download directory happen
|
||||||
|
to differ, the download would fail. The download directory will now be derived from
|
||||||
|
filename itself so that the sub-directory name always overlaps.
|
||||||
|
([@ritiek](https://github.com/ritiek/spotify-downloader))
|
||||||
|
(2aa7dce4a42feb5cd3ceb9324e58da524cdb4b6f)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Disable unneeded logs from `chardet`. ([@ritiek](https://github.com/ritiek))
|
||||||
|
(c1b3949edb943cc21a63c34d6a01ed59e9b6536d)
|
||||||
|
|
||||||
## [2.0.4] - 19-05-2020
|
## [2.0.4] - 19-05-2020
|
||||||
### Fixed
|
### Fixed
|
||||||
- Do not remove the currently downloading track from file on `KeyboardInterrupt`
|
- Do not remove the currently downloading track from file on `KeyboardInterrupt`
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ from spotdl.command_line.exceptions import ArgumentError
|
|||||||
|
|
||||||
# hardcode loglevel for dependencies so that they do not spew generic
|
# hardcode loglevel for dependencies so that they do not spew generic
|
||||||
# log messages along with spotdl.
|
# log messages along with spotdl.
|
||||||
for module in ("urllib3", "spotipy", "pytube"):
|
for module in ("chardet", "urllib3", "spotipy", "pytube"):
|
||||||
logging.getLogger(module).setLevel(logging.CRITICAL)
|
logging.getLogger(module).setLevel(logging.CRITICAL)
|
||||||
|
|
||||||
coloredlogs.DEFAULT_FIELD_STYLES = {
|
coloredlogs.DEFAULT_FIELD_STYLES = {
|
||||||
|
|||||||
@@ -261,16 +261,7 @@ class Spotdl:
|
|||||||
if not self.arguments["no_metadata"]:
|
if not self.arguments["no_metadata"]:
|
||||||
metadata["lyrics"].start()
|
metadata["lyrics"].start()
|
||||||
|
|
||||||
filter_space_chars = self.output_filename_filter(not self.arguments["no_spaces"])
|
os.makedirs(os.path.dirname(filename) or ".", exist_ok=True)
|
||||||
directory = os.path.dirname(
|
|
||||||
spotdl.metadata.format_string(
|
|
||||||
self.arguments["output_file"],
|
|
||||||
metadata,
|
|
||||||
output_extension=output_extension,
|
|
||||||
sanitizer=filter_space_chars
|
|
||||||
)
|
|
||||||
)
|
|
||||||
os.makedirs(directory or ".", exist_ok=True)
|
|
||||||
|
|
||||||
logger.info('Downloading to "{filename}"'.format(filename=filename))
|
logger.info('Downloading to "{filename}"'.format(filename=filename))
|
||||||
if self.arguments["no_encode"]:
|
if self.arguments["no_encode"]:
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ from spotdl.authorize.services import AuthorizeSpotify
|
|||||||
import spotdl.util
|
import spotdl.util
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
import spotipy
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|||||||
@@ -13,6 +13,36 @@ def directory_fixture(tmpdir_factory):
|
|||||||
return dir_path
|
return dir_path
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize("value", [
|
||||||
|
5,
|
||||||
|
"string",
|
||||||
|
{"a": 1, "b": 2},
|
||||||
|
(10, 20, 30, "string"),
|
||||||
|
[2, 4, "sample"]
|
||||||
|
])
|
||||||
|
def test_thread_with_return_value(value):
|
||||||
|
returner = lambda x: x
|
||||||
|
thread = spotdl.util.ThreadWithReturnValue(
|
||||||
|
target=returner,
|
||||||
|
args=(value,)
|
||||||
|
)
|
||||||
|
thread.start()
|
||||||
|
assert value == thread.join()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize("track, track_type", [
|
||||||
|
("https://open.spotify.com/track/3SipFlNddvL0XNZRLXvdZD", "spotify"),
|
||||||
|
("spotify:track:3SipFlNddvL0XNZRLXvdZD", "spotify"),
|
||||||
|
("3SipFlNddvL0XNZRLXvdZD", "spotify"),
|
||||||
|
("https://www.youtube.com/watch?v=oMiNsd176NM", "youtube"),
|
||||||
|
("oMiNsd176NM", "youtube"),
|
||||||
|
("kodaline - saving grace", "query"),
|
||||||
|
("or anything else", "query"),
|
||||||
|
])
|
||||||
|
def test_track_type(track, track_type):
|
||||||
|
assert spotdl.util.track_type(track) == track_type
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("str_duration, sec_duration", [
|
@pytest.mark.parametrize("str_duration, sec_duration", [
|
||||||
("0:23", 23),
|
("0:23", 23),
|
||||||
("0:45", 45),
|
("0:45", 45),
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
__version__ = "2.0.4"
|
__version__ = "2.0.5"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user