Compare commits

...

3 Commits

Author SHA1 Message Date
Logykk 5da27d32a1 version bump 2024-02-07 18:10:08 +13:00
Zotify 55a5e6a355
Merge pull request #46 from SimsesLab/main
Added 'Defaults' column to Options table in README.md
2024-02-07 04:38:39 +00:00
Simon 5b705a1d7d
Update README.md
Added 'Defaults' column to Options table
2023-11-15 17:50:10 +01:00
5 changed files with 42 additions and 31 deletions

View File

@ -1,5 +1,9 @@
# Changelog
## 0.6.13
- Only replace chars with _ when required
- Added defaults to README
## 0.6.12
- Dockerfile works again
- Fixed lrc file extension replacement

View File

@ -56,34 +56,34 @@ Basic options:
All these options can either be configured in the config or via the commandline, in case of both the commandline-option has higher priority.
Be aware you have to set boolean values in the commandline like this: `--download-real-time=True`
| Key (config) | commandline parameter | Description
|------------------------------|----------------------------------|---------------------------------------------------------------------|
| CREDENTIALS_LOCATION | --credentials-location | The location of the credentials.json
| OUTPUT | --output | The output location/format (see below)
| SONG_ARCHIVE | --song-archive | The song_archive file for SKIP_PREVIOUSLY_DOWNLOADED
| ROOT_PATH | --root-path | Directory where Zotify saves music
| ROOT_PODCAST_PATH | --root-podcast-path | Directory where Zotify saves podcasts
| SPLIT_ALBUM_DISCS | --split-album-discs | Saves each disk in its own folder
| DOWNLOAD_LYRICS | --download-lyrics | Downloads synced lyrics in .lrc format, uses unsynced as fallback.
| MD_ALLGENRES | --md-allgenres | Save all relevant genres in metadata
| MD_GENREDELIMITER | --md-genredelimiter | Delimiter character used to split genres in metadata
| DOWNLOAD_FORMAT | --download-format | The download audio format (aac, fdk_aac, m4a, mp3, ogg, opus, vorbis)
| DOWNLOAD_QUALITY | --download-quality | Audio quality of downloaded songs (normal, high, very_high*)
| TRANSCODE_BITRATE | --transcode-bitrate | Overwrite the bitrate for ffmpeg encoding
| SKIP_EXISTING_FILES | --skip-existing | Skip songs with the same name
| SKIP_PREVIOUSLY_DOWNLOADED | --skip-previously-downloaded | Use a song_archive file to skip previously downloaded songs
| RETRY_ATTEMPTS | --retry-attempts | Number of times Zotify will retry a failed request
| BULK_WAIT_TIME | --bulk-wait-time | The wait time between bulk downloads
| OVERRIDE_AUTO_WAIT | --override-auto-wait | Totally disable wait time between songs with the risk of instability
| CHUNK_SIZE | --chunk-size | Chunk size for downloading
| DOWNLOAD_REAL_TIME | --download-real-time | Downloads songs as fast as they would be played, should prevent account bans.
| LANGUAGE | --language | Language for spotify metadata
| PRINT_SPLASH | --print-splash | Show the Zotify logo at startup
| PRINT_SKIPS | --print-skips | Show messages if a song is being skipped
| PRINT_DOWNLOAD_PROGRESS | --print-download-progress | Show download/playlist progress bars
| PRINT_ERRORS | --print-errors | Show errors
| PRINT_DOWNLOADS | --print-downloads | Print messages when a song is finished downloading
| TEMP_DOWNLOAD_DIR | --temp-download-dir | Download tracks to a temporary directory first
| Key (config) | Commandline parameter | Defaults | Description
|------------------------------|----------------------------------|----------|---------------------------------------------------------------------|
| CREDENTIALS_LOCATION | --credentials-location | | The location of the credentials.json
| OUTPUT | --output | | The output location/format (see below)
| SONG_ARCHIVE | --song-archive | | The song_archive file for SKIP_PREVIOUSLY_DOWNLOADED
| ROOT_PATH | --root-path | | Directory where Zotify saves music
| ROOT_PODCAST_PATH | --root-podcast-path | | Directory where Zotify saves podcasts
| SPLIT_ALBUM_DISCS | --split-album-discs | False | Saves each disk in its own folder
| DOWNLOAD_LYRICS | --download-lyrics | True | Downloads synced lyrics in .lrc format, uses unsynced as fallback.
| MD_ALLGENRES | --md-allgenres | False | Save all relevant genres in metadata
| MD_GENREDELIMITER | --md-genredelimiter | , | Delimiter character used to split genres in metadata
| DOWNLOAD_FORMAT | --download-format | ogg | The download audio format (aac, fdk_aac, m4a, mp3, ogg, opus, vorbis)
| DOWNLOAD_QUALITY | --download-quality | auto | Audio quality of downloaded songs (normal, high, very_high*)
| TRANSCODE_BITRATE | --transcode-bitrate | auto | Overwrite the bitrate for ffmpeg encoding
| SKIP_EXISTING_FILES | --skip-existing | True | Skip songs with the same name
| SKIP_PREVIOUSLY_DOWNLOADED | --skip-previously-downloaded | False | Use a song_archive file to skip previously downloaded songs
| RETRY_ATTEMPTS | --retry-attempts | 1 | Number of times Zotify will retry a failed request
| BULK_WAIT_TIME | --bulk-wait-time | 1 | The wait time between bulk downloads
| OVERRIDE_AUTO_WAIT | --override-auto-wait | False | Totally disable wait time between songs with the risk of instability
| CHUNK_SIZE | --chunk-size | 20000 | Chunk size for downloading
| DOWNLOAD_REAL_TIME | --download-real-time | False | Downloads songs as fast as they would be played, should prevent account bans.
| LANGUAGE | --language | en | Language for spotify metadata
| PRINT_SPLASH | --print-splash | False | Show the Zotify logo at startup
| PRINT_SKIPS | --print-skips | True | Show messages if a song is being skipped
| PRINT_DOWNLOAD_PROGRESS | --print-download-progress | True | Show download/playlist progress bars
| PRINT_ERRORS | --print-errors | True | Show errors
| PRINT_DOWNLOADS | --print-downloads | False | Print messages when a song is finished downloading
| TEMP_DOWNLOAD_DIR | --temp-download-dir | | Download tracks to a temporary directory first
*very-high is limited to premium only

View File

@ -1,6 +1,6 @@
[metadata]
name = zotify
version = 0.6.12
version = 0.6.13
author = Zotify Contributors
description = A highly customizable music and podcast downloader
long_description = file: README.md

View File

@ -92,6 +92,8 @@ USER_LIBRARY_READ = 'user-library-read'
WINDOWS_SYSTEM = 'Windows'
LINUX_SYSTEM = 'Linux'
CODEC_MAP = {
'aac': 'aac',
'fdk_aac': 'libfdk_aac',

View File

@ -12,7 +12,7 @@ import music_tag
import requests
from zotify.const import ARTIST, GENRE, TRACKTITLE, ALBUM, YEAR, DISCNUMBER, TRACKNUMBER, ARTWORK, \
WINDOWS_SYSTEM, ALBUMARTIST
WINDOWS_SYSTEM, LINUX_SYSTEM, ALBUMARTIST
from zotify.zotify import Zotify
@ -258,7 +258,12 @@ def fix_filename(name):
>>> all('_' == fix_filename(chr(i)) for i in list(range(32)))
True
"""
return re.sub(r'[/\\:|<>"?*\0-\x1f]|^(AUX|COM[1-9]|CON|LPT[1-9]|NUL|PRN)(?![^.])|^\s|[\s.]$', "_", str(name), flags=re.IGNORECASE)
if platform.system() == WINDOWS_SYSTEM:
return re.sub(r'[/\\:|<>"?*\0-\x1f]|^(AUX|COM[1-9]|CON|LPT[1-9]|NUL|PRN)(?![^.])|^\s|[\s.]$', "_", str(name), flags=re.IGNORECASE)
elif platform.system() == LINUX_SYSTEM:
return re.sub(r'[/\0]', "_", str(name))
else: # MacOS
return re.sub(r'[/:\0]', "_", str(name))
def fmt_seconds(secs: float) -> str: