Skip to content

Commit b361976

Browse files
author
Zotify
committed
various changes
1 parent 360e342 commit b361976

17 files changed

Lines changed: 573 additions & 353 deletions

.vscode/settings.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
2-
"editor.defaultFormatter": "ms-python.black-formatter",
32
"editor.formatOnSave": true,
43
"editor.codeActionsOnSave": {
5-
"source.organizeImports": true
4+
"source.organizeImports": "explicit"
5+
},
6+
"[python]": {
7+
"editor.defaultFormatter": "ms-python.black-formatter"
68
},
79
}

CHANGELOG.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@
1515
- Setting `--config` (formerly `--config-location`) can be set to "None" to not use any config file
1616
- Search result selector now accepts both comma-seperated and hyphen-seperated values at the same time
1717
- Renamed `--liked`/`-l` to `--liked-tracks`/`-lt`
18-
- Renamed `root_path` and `root_podcast_path` to `music_library` and `podcast_library`
18+
- Renamed `root_path` and `root_podcast_path` to `album_library` and `podcast_library`
1919
- `--username` and `--password` arguments now take priority over saved credentials
20-
- Regex pattern for cleaning filenames is now OS specific, allowing more usable characters on Linux & macOS.
2120
- On Linux both `config.json` and `credentials.json` are now kept under `$XDG_CONFIG_HOME/zotify/`, (`~/.config/zotify/` by default).
2221
- The output template used is now based on track info rather than search result category
2322
- Search queries with spaces no longer need to be in quotes
@@ -29,7 +28,7 @@
2928

3029
- New library location for playlists `playlist_library`
3130
- Added new command line arguments
32-
- `--library`/`-l` overrides both `music_library` and `podcast_library` options similar to `--output`/`-o`
31+
- `--library`/`-l` overrides both `album_library` and `podcast_library` options similar to `--output`/`-o`
3332
- `--category`/`-c` will limit search results to a certain type, accepted values are "album", "artist", "playlist", "track", "show", "episode". Accepts multiple choices.
3433
- `--debug` shows full tracebacks on crash instead of just the final error message
3534
- Added new shorthand aliases to some options:
@@ -55,6 +54,9 @@
5554
- `{explicit}`
5655
- `{isrc}`
5756
- `{licensor}`
57+
- `{playlist}`
58+
- `{playlist_number}`
59+
- `{playlist_owner}`
5860
- `{popularity}`
5961
- `{release_date}`
6062
- `{track_number}`

Pipfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ requests = "*"
1313
tqdm = "*"
1414

1515
[dev-packages]
16+
black = "*"
17+
flake8 = "*"
18+
mypy = "*"
19+
types-protobuf = "*"
20+
types-requests = "*"
1621

1722
[requires]
1823
python_version = "3.11"

Pipfile.lock

Lines changed: 327 additions & 144 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,20 @@ Built on [Librespot](https://github.com/kokarare1212/librespot-python).
1010

1111
## Features
1212

13-
- Save tracks at up to 320kbps\*
13+
- Save tracks at up to 320kbps<sup>**1**</sup>
1414
- Save to most popular audio formats
1515
- Built in search
1616
- Bulk downloads
17-
- Downloads synced lyrics
17+
- Downloads synced lyrics<sup>**2**</sup>
1818
- Embedded metadata
1919
- Downloads all audio, metadata and lyrics directly, no substituting from other services.
2020

21-
\*Non-premium accounts are limited to 160kbps
21+
**1**: Non-premium accounts are limited to 160kbps \
22+
**2**: Requires premium
2223

2324
## Installation
2425

25-
Requires Python 3.10 or greater. \
26+
Requires Python 3.11 or greater. \
2627
Optionally requires FFmpeg to save tracks as anything other than Ogg Vorbis.
2728

2829
Enter the following command in terminal to install Zotify. \
@@ -64,8 +65,6 @@ Downloads specified items. Accepts any combination of track, album, playlist, ep
6465
| ffmpeg_path | --ffmpeg-path | Path to ffmpeg binary | |
6566
| ffmpeg_args | --ffmpeg-args | Additional ffmpeg arguments when transcoding | |
6667
| save_credentials | --save-credentials | Save login credentials to a file | |
67-
| save_subtitles | --save-subtitles |
68-
| save_artist_genres | --save-arist-genres |
6968

7069
</details>
7170

@@ -104,15 +103,15 @@ file.write_cover_art(track.get_cover_art())
104103

105104
## Contributing
106105

107-
Pull requests are always welcome, but if adding an entirely new feature we encourage you to create an issue proposing the feature first so we can ensure it's something that fits sthe scope of the project.
106+
Pull requests are always welcome, but if adding an entirely new feature we encourage you to create an issue proposing the feature first so we can ensure it's something that fits the scope of the project.
108107

109108
Zotify aims to be a comprehensive and user-friendly tool for downloading music and podcasts.
110109
It is designed to be simple by default but offer a high level of configuration for users that want it.
111110
All new contributions should follow this principle to keep the program consistent.
112111

113112
## Will my account get banned if I use this tool?
114113

115-
There have been no confirmed cases of accounts getting banned as a result of using Zotify.
114+
There have been no *confirmed* cases of accounts getting banned as a result of using Zotify.
116115
However, it is still a possiblity and it is recommended you use Zotify with a burner account where possible.
117116

118117
Consider using [Exportify](https://watsonbox.github.io/exportify/) to keep backups of your playlists.

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
librespot>=0.0.9
1+
librespot@git+https://github.com/kokarare1212/librespot-python
22
music-tag@git+https://zotify.xyz/zotify/music-tag
33
mutagen
44
Pillow

requirements_dev.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
black
22
flake8
33
mypy
4-
pre-commit
54
types-protobuf
65
types-requests
76
wheel

setup.cfg

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[metadata]
22
name = zotify
3-
version = 0.9.4
3+
version = 0.9.5
44
author = Zotify Contributors
55
description = A highly customizable music and podcast downloader
66
long_description = file: README.md
77
long_description_content_type = text/markdown
8-
keywords = python, music, podcast, downloader
8+
keywords = music, podcast, downloader
99
licence = Zlib
1010
classifiers =
1111
Programming Language :: Python :: 3
@@ -17,9 +17,9 @@ classifiers =
1717

1818
[options]
1919
packages = zotify
20-
python_requires = >=3.10
20+
python_requires = >=3.11
2121
install_requires =
22-
librespot>=0.0.9
22+
librespot@git+https://github.com/kokarare1212/librespot-python
2323
music-tag@git+https://zotify.xyz/zotify/music-tag
2424
mutagen
2525
Pillow

zotify/__init__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def __init__(
9797
self.__language = language
9898

9999
@staticmethod
100-
def from_file(cred_file: Path, language: str = "en") -> Session:
100+
def from_file(cred_file: Path | str, language: str = "en") -> Session:
101101
"""
102102
Creates session using saved credentials file
103103
Args:
@@ -106,6 +106,8 @@ def from_file(cred_file: Path, language: str = "en") -> Session:
106106
Returns:
107107
Zotify session
108108
"""
109+
if not isinstance(cred_file, Path):
110+
cred_file = Path(cred_file).expanduser()
109111
conf = (
110112
LibrespotSession.Configuration.Builder()
111113
.set_store_credentials(False)
@@ -118,7 +120,7 @@ def from_file(cred_file: Path, language: str = "en") -> Session:
118120
def from_userpass(
119121
username: str,
120122
password: str,
121-
save_file: Path | None = None,
123+
save_file: Path | str | None = None,
122124
language: str = "en",
123125
) -> Session:
124126
"""
@@ -133,6 +135,8 @@ def from_userpass(
133135
"""
134136
builder = LibrespotSession.Configuration.Builder()
135137
if save_file:
138+
if not isinstance(save_file, Path):
139+
save_file = Path(save_file).expanduser()
136140
save_file.parent.mkdir(parents=True, exist_ok=True)
137141
builder.set_stored_credential_file(str(save_file))
138142
else:
@@ -144,7 +148,9 @@ def from_userpass(
144148
return Session(session, language)
145149

146150
@staticmethod
147-
def from_prompt(save_file: Path | None = None, language: str = "en") -> Session:
151+
def from_prompt(
152+
save_file: Path | str | None = None, language: str = "en"
153+
) -> Session:
148154
"""
149155
Creates a session with username + password supplied from CLI prompt
150156
Args:

zotify/__main__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@
55

66
from zotify.app import App
77
from zotify.config import CONFIG_PATHS, CONFIG_VALUES
8-
from zotify.utils import OptionalOrFalse, SimpleHelpFormatter
8+
from zotify.utils import OptionalOrFalse
99

10-
VERSION = "0.9.4"
10+
VERSION = "0.9.5"
1111

1212

1313
def main():
1414
parser = ArgumentParser(
1515
prog="zotify",
1616
description="A fast and customizable music and podcast downloader",
17-
formatter_class=SimpleHelpFormatter,
1817
)
1918
parser.add_argument(
2019
"-v",
@@ -53,7 +52,7 @@ def main():
5352
)
5453
parser.add_argument("--username", type=str, default="", help="Account username")
5554
parser.add_argument("--password", type=str, default="", help="Account password")
56-
group = parser.add_mutually_exclusive_group(required=False)
55+
group = parser.add_mutually_exclusive_group(required=True)
5756
group.add_argument(
5857
"urls",
5958
type=str,

0 commit comments

Comments
 (0)