Skip to content

Commit

Permalink
v4.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
xnetcat committed Mar 28, 2024
2 parents f90cfb3 + 11f71d6 commit c646615
Show file tree
Hide file tree
Showing 81 changed files with 175,785 additions and 63,692 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:

- name: Run tests
run: |
poetry run pytest -vvv --ignore tests/test_matching.py --ignore tests/utils/test_ffmpeg.py --ignore tests/utils/test_metadata.py
poetry run pytest -vvv --ignore tests/test_matching.py --ignore tests/utils/test_ffmpeg.py --ignore tests/utils/test_metadata.py --ignore tests/providers/lyrics/test_azlyrics.py --ignore tests/providers/lyrics/test_musixmatch.py
env:
PLATFORM: ${{ matrix.platform }}

Expand Down Expand Up @@ -73,6 +73,6 @@ jobs:

- name: Run tests
run: |
poetry run pytest -vvv --disable-vcr --vcr-record=none --ignore tests/providers/lyrics --ignore tests/utils/test_github.py --ignore tests/utils/test_ffmpeg.py --ignore tests/utils/test_metadata.py
poetry run pytest -vvv --record-mode=none --disable-recording --ignore tests/providers/lyrics --ignore tests/utils/test_github.py --ignore tests/utils/test_ffmpeg.py --ignore tests/utils/test_metadata.py
env:
PLATFORM: ${{ matrix.platform }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Ignore IDE folders
.idea

# Spotdl stuff
*.skip
*.mp3
*.m4a
*.wav
Expand Down
9 changes: 8 additions & 1 deletion docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ If you don't want config to load automatically change `load_config` option in co
"format": "mp3",
"save_file": null,
"filter_results": true,
"album_type": null,
"threads": 4,
"cookie_file": null,
"restrict": null,
Expand All @@ -310,7 +311,8 @@ If you don't want config to load automatically change `load_config` option in co
"keep_alive": false,
"allowed_origins": null,
"keep_sessions": false,
"only_verified_results": false
"only_verified_results": false,
"skip_album_art": false
}
```

Expand Down Expand Up @@ -382,6 +384,8 @@ Main options:
{tracks-count}, {isrc}, {track-id}, {publisher}, {list-length}, {list-position}, {list-name}, {output-ext}
--dont-filter-results
Disable filtering results.
--album-type {single, album}
Type of the album to filter the songs
--only-verified-results
Use only verified results. (Not all providers support this)
Expand Down Expand Up @@ -454,10 +458,13 @@ Output options:
--detect-formats [{mp3,flac,ogg,opus,m4a,wav} ...]
Detect already downloaded songs with file format different from the --format option (When combined with --m3u option, only first detected format will be added to m3u file)
--redownload to redownload the local song in diffrent format using --format for meta operation
--skip-album-art Skip downloading album art for meta operation
--ignore-albums [IGNORE_ALBUMS ...]
ignores the song of the given albums
--skip-explicit Skip explicit songs
--proxy PROXY Http(s) proxy server for download song. Example: http://host:port
--create-skip-file Create skip file for successfully downloaded file
--respect-skip-file If a file with the extension .skip exists, skip download
Web options:
--host HOST The host to use for the web server.
Expand Down
1,871 changes: 968 additions & 903 deletions poetry.lock

Large diffs are not rendered by default.

59 changes: 31 additions & 28 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "spotdl"
version = "4.2.4"
version = "4.2.5"
description = "Download your Spotify playlists and songs along with album art and metadata"
license = "MIT"
authors = ["spotDL Team <spotdladmins@googlegroups.com>"]
Expand Down Expand Up @@ -30,54 +30,57 @@ classifiers = [
python = ">=3.8,<3.13"

spotipy = "^2.23.0"
ytmusicapi = "^1.3.2"
ytmusicapi = [
{version = "^1.3.2", python = "<3.10"},
{version = "^1.4.1", python = ">=3.10"},
]
pytube = "^15.0.0"
yt-dlp = "^2023.11.16"
yt-dlp = "^2024.3.10"
mutagen = "^1.47.0"
rich = "^13.7.0"
beautifulsoup4 = "^4.12.2"
rich = "^13.7.1"
beautifulsoup4 = "^4.12.3"
requests = "^2.31.0"
rapidfuzz = "^3.5.2"
python-slugify = {extras = ["unidecode"], version = "^8.0.1"}
rapidfuzz = "^3.7.0"
python-slugify = {extras = ["unidecode"], version = "^8.0.4"}
uvicorn = "^0.23.2"
pydantic = "^2.5.2"
pydantic = "^2.6.4"
fastapi = "^0.103.0"
platformdirs = "^3.11.0"
platformdirs = "^4.2.0"
pykakasi = "^2.2.1"
syncedlyrics = "^0.7.0"
soundcloud-v2 = "^1.3.1"
setuptools = "^69.0.2"
soundcloud-v2 = "^1.3.7"
setuptools = "^69.2.0"

[tool.poetry.group.dev.dependencies]
pytest = "^7.4.3"
pytest-mock = "^3.12.0"
pytest-vcr = "^1.0.2"
pyfakefs = "^5.3.2"
pytest-cov = "^4.1.0"
pytest = "^8.1.1"
pytest-mock = "^3.14.0"
pyfakefs = "^5.3.5"
pytest-cov = "^5.0.0"
pytest-subprocess = "^1.5.0"
pytest-asyncio = "^0.21.1"
mypy = "^1.7.1"
pylint = "^3.0.2"
black = "^23.11.0"
mypy = "^1.9.0"
pylint = "^3.1.0"
black = "^24.3.0"
mdformat-gfm = "^0.3.5"
types-orjson = "^3.6.2"
types-python-slugify = "^8.0.0.3"
types-python-slugify = "^8.0.2.20240310"
types-requests = "==2.31.0.6"
types-setuptools = "^69.0.0.0"
types-setuptools = "^69.2.0.20240317"
types-toml = "^0.10.8.7"
types-ujson = "^5.8.0.1"
pyinstaller = "^6.2.0"
types-ujson = "^5.9.0.0"
pyinstaller = "^6.5.0"
mkdocs = "^1.5.3"
isort = "^5.12.0"
isort = "^5.13.2"
dill = "^0.3.7"
mkdocs-material = "^9.4.14"
mkdocs-material = "^9.5.15"
mkdocstrings = "^0.22.0"
mkdocstrings-python = "^1.7.5"
pymdown-extensions = "^10.5"
mkdocstrings-python = "^1.9.0"
pymdown-extensions = "^10.7.1"
mkdocs-gen-files = "^0.5.0"
mkdocs-literate-nav = "^0.6.0"
mkdocs-section-index = "^0.3.5"
vcrpy = "^5.1.0"
vcrpy = "^6.0.1"
pytest-recording = "^0.13.1"

[tool.poetry.scripts]
spotdl = "spotdl:console_entry_point"
Expand Down
4 changes: 2 additions & 2 deletions scripts/termux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ termux-setup-storage
pkg update -y

# install python and ffmpeg
pkg install -y python ffmpeg
pkg install -y python ffmpeg rust binutils

# install spotdl
pip install -U spotdl
Expand All @@ -30,4 +30,4 @@ if [[ $1 == *"open.spotify.com"* ]]; then
$SPOTDL "$1"
read -n 1 -s -p "Press Any Key To Exit."
fi
EOL
EOL
9 changes: 5 additions & 4 deletions spotdl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,11 @@ def search(self, query: List[str]) -> List[Song]:
"""

return parse_query(
query,
self.downloader.settings["threads"],
self.downloader.settings["ytm_data"],
self.downloader.settings["playlist_numbering"],
query=query,
threads=self.downloader.settings["threads"],
use_ytm_data=self.downloader.settings["ytm_data"],
playlist_numbering=self.downloader.settings["playlist_numbering"],
album_type=self.downloader.settings["album_type"],
)

def get_download_urls(self, songs: List[Song]) -> List[Optional[str]]:
Expand Down
2 changes: 1 addition & 1 deletion spotdl/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Version module for spotdl.
"""

__version__ = "4.2.4"
__version__ = "4.2.5"
1 change: 1 addition & 0 deletions spotdl/console/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def download(
use_ytm_data=downloader.settings["ytm_data"],
playlist_numbering=downloader.settings["playlist_numbering"],
albums_to_ignore=downloader.settings["ignore_albums"],
album_type=downloader.settings["album_type"],
)

# Download the songs
Expand Down
15 changes: 14 additions & 1 deletion spotdl/console/entry_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ def console_entry_point():
# If the application is frozen start web ui
# or if the operation is `web`
if is_executable() or arguments.operation == "web":

# Default to the current directory when running a frozen application
if is_executable():
web_settings["web_use_output_dir"] = True

# Start web ui
web(web_settings, downloader_settings)

Expand Down Expand Up @@ -138,7 +143,15 @@ def graceful_exit(_signal, _frame):
query=arguments.query,
downloader=downloader,
)
except Exception:
except Exception as exc:
if downloader_settings["save_errors"]:
with open(
downloader_settings["save_errors"], "a", encoding="utf-8"
) as error_file:
error_file.write("\n".join([exc + "\n" for exc in exc.args]))

logger.debug("Saved errors to %s", downloader_settings["save_errors"])

end_time = time.perf_counter()
logger.debug("Took %d seconds", end_time - start_time)

Expand Down
11 changes: 6 additions & 5 deletions spotdl/console/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def process_file(file: Path):
song.lyrics = song_meta.get("lyrics")

# Apply metadata to the song
embed_metadata(file, song)
embed_metadata(file, song, skip_album_art=downloader.settings["skip_album_art"])

logger.info("Applied metadata to %s", file.name)

Expand Down Expand Up @@ -171,10 +171,11 @@ async def pool_worker(file_path: Path) -> None:
songs_url.append(meta_data["url"])

songs_list = parse_query(
songs_url,
downloader.settings["threads"],
downloader.settings["ytm_data"],
downloader.settings["playlist_numbering"],
query=songs_url,
threads=downloader.settings["threads"],
use_ytm_data=downloader.settings["ytm_data"],
playlist_numbering=downloader.settings["playlist_numbering"],
album_type=downloader.settings["album_type"],
)

downloader.download_multiple_songs(songs_list)
9 changes: 5 additions & 4 deletions spotdl/console/save.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ def save(

# Parse the query
songs = parse_query(
query,
downloader.settings["threads"],
downloader.settings["ytm_data"],
downloader.settings["playlist_numbering"],
query=query,
threads=downloader.settings["threads"],
use_ytm_data=downloader.settings["ytm_data"],
playlist_numbering=downloader.settings["playlist_numbering"],
album_type=downloader.settings["album_type"],
)
save_data = [song.json for song in songs]

Expand Down
18 changes: 10 additions & 8 deletions spotdl/console/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,11 @@ def sync(

# Parse the query
songs_list = parse_query(
query,
downloader.settings["threads"],
downloader.settings["ytm_data"],
downloader.settings["playlist_numbering"],
query=query,
threads=downloader.settings["threads"],
use_ytm_data=downloader.settings["ytm_data"],
playlist_numbering=downloader.settings["playlist_numbering"],
album_type=downloader.settings["album_type"],
)

# Create sync file
Expand Down Expand Up @@ -101,10 +102,11 @@ def sync(

# Parse the query
songs_playlist = parse_query(
sync_data["query"],
downloader.settings["threads"],
downloader.settings["ytm_data"],
downloader.settings["playlist_numbering"],
query=sync_data["query"],
threads=downloader.settings["threads"],
use_ytm_data=downloader.settings["ytm_data"],
playlist_numbering=downloader.settings["playlist_numbering"],
album_type=downloader.settings["album_type"],
)

# Get the names and URLs of previously downloaded songs from the sync file
Expand Down
9 changes: 5 additions & 4 deletions spotdl/console/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ def url(

# Parse the query
songs = parse_query(
query,
downloader.settings["threads"],
downloader.settings["ytm_data"],
downloader.settings["playlist_numbering"],
query=query,
threads=downloader.settings["threads"],
use_ytm_data=downloader.settings["ytm_data"],
playlist_numbering=downloader.settings["playlist_numbering"],
album_type=downloader.settings["album_type"],
)

def process_song(song: Song):
Expand Down
8 changes: 5 additions & 3 deletions spotdl/console/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,11 @@ def web(web_settings: WebOptions, downloader_settings: DownloaderOptions):
# Add the CORS middleware
app_state.api.add_middleware(
CORSMiddleware,
allow_origins=ALLOWED_ORIGINS + web_settings["allowed_origins"]
if web_settings["allowed_origins"]
else ALLOWED_ORIGINS,
allow_origins=(
ALLOWED_ORIGINS + web_settings["allowed_origins"]
if web_settings["allowed_origins"]
else ALLOWED_ORIGINS
),
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
Expand Down

0 comments on commit c646615

Please sign in to comment.