Skip to content

Commit d6e720f

Browse files
committed
Merge branch 'main' of https://github.com/bgeorgakas/zotify
2 parents cf85b1c + b4b03de commit d6e720f

1 file changed

Lines changed: 47 additions & 141 deletions

File tree

README.md

Lines changed: 47 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -1,161 +1,67 @@
1-
# Zotify
1+
# Zotify Fork
2+
### See https://github.com/zotify-dev/zotify for docs
23

3-
### A highly customizable music and podcast downloader.
4+
This fork provides workarounds for the audio key error which occurs when you hit spotify's rate limit (see https://github.com/zotify-dev/zotify/issues/186). Once you hit the rate limit the it takes a significant amount of time to cool off. So there are 2 steps to the solution.
5+
1. Sleep after each successful download. @HxDxRx found that the optimal sleep time is 30 seconds (see https://github.com/zotify-dev/zotify/issues/186#issuecomment-2608381052). This prevents from hitting the rate limit
6+
**Implementation:** Set --get-bulk-wait-time 30
7+
2. If rate limit is hit and audio key error is raised, sleep and retry
48

5-
<p align="center">
6-
<img src="https://i.imgur.com/hGXQWSl.png" width="50%" alt="Zotify logo">
7-
</p>
9+
**Implementation:** The version of librespot referenced in the setup.cfg is different to the version of librespot referenced in the requirements.txt. The former does not implement retries for audio key errors where as the latter does. This means that to get the version with retry logic implemented you have to clone the repo into your local environment and then install from that (which uses the requirements.txt rather than the setup.cfg).
810

9-
### Features
10-
- Downloads at up to 320kbps*
11-
- Downloads directly from the source**
12-
- Downloads podcasts, playlists, liked songs, albums, artists, singles.
13-
- Downloads synced lyrics from the source
14-
- Option to download in real time to appear more legitimate***
15-
- Supports multiple audio formats
16-
- Download directly from URL or use built-in in search
17-
- Bulk downloads from a list of URLs in a text file or parsed directly as arguments
11+
## Instructions
12+
I am running ubuntu 22.04. If you are on windows I suggest you install Windows Subsytem for Linux (https://learn.microsoft.com/en-us/windows/wsl/install) because Windows Sux
1813

19-
*Free accounts are limited to 160kbps. \
20-
**Audio files are NOT substituted with ones from other sources such as YouTube or Deezer, they are sourced directly. \
21-
***'real time' refers to downloading at the speed it would normally be streamed at (the duration of the track).
14+
### Requirements
15+
pyenv ffmpeg and python 3.11
16+
```
17+
Install ffmpeg
18+
sudo apt update
19+
sudo apt install ffmpeg
2220
23-
### Install
21+
Install pyenv, or your preferred env tool (https://github.com/pyenv/pyenv)
22+
curl -fsSL https://pyenv.run | bash
2423
24+
Install python 3.11
25+
pyenv install 3.11
2526
```
26-
Dependencies:
27+
### Get credentials
28+
The current code on the main branch does not authenticate correctly. As a work around for this clone the dev branch, log in and extract the credentials.json file
29+
```
30+
Create venv
31+
pyenv virtualenv 3.11 {env_name}
2732
28-
- Python 3.9 or greater
29-
- FFmpeg
33+
Clone repo and install
34+
git clone --branch v1.0-dev https://github.com/zotify-dev/zotify.git
35+
cd zotify
36+
pip install .
3037
31-
Installation:
38+
Run any zotify command and follow the steps to authenticate. This will out put credentials to /.config/Zotify/credentials.json . Save this credentials file somewhere for later.
3239
33-
python -m pip install git+https://zotify.xyz/zotify/zotify.git
40+
Deactivate env
41+
pyenv deactivate {venv_name}
3442
```
3543

36-
See [INSTALLATION](INSTALLATION.md) for a more detailed and opinionated installation walkthrough.
37-
38-
### Command line usage
44+
### Install
3945

4046
```
41-
Basic command line usage:
42-
zotify <track/album/playlist/episode/artist url> Downloads the track, album, playlist or podcast episode specified as a command line argument. If an artist url is given, all albums by specified artist will be downloaded. Can take multiple urls.
47+
Create a fresh environment
48+
pyenv virtualenv 3.11 {venv_name}
4349
44-
Basic options:
45-
(nothing) Download the tracks/albums/playlists URLs from the parameter
46-
-d, --download Download all tracks/albums/playlists URLs from the specified file
47-
-p, --playlist Downloads a saved playlist from your account
48-
-l, --liked Downloads all the liked songs from your account
49-
-f, --followed Downloads all songs by all artists you follow
50-
-s, --search Searches for specified track, album, artist or playlist, loads search prompt if none are given.
51-
-h, --help See this message.
50+
Clone this repo and install zotify
51+
git clone https://github.com/bgeorgakas/zotify.git
52+
cd zotify
53+
pip install .
5254
```
5355

54-
### Options
55-
56-
All these options can either be configured in the config or via the commandline, in case of both the commandline-option has higher priority.
57-
Be aware you have to set boolean values in the commandline like this: `--download-real-time=True`
58-
59-
| Key (config) | Commandline parameter | Defaults | Description
60-
|------------------------------|----------------------------------|----------|---------------------------------------------------------------------|
61-
| CREDENTIALS_LOCATION | --credentials-location | | The location of the credentials.json
62-
| OUTPUT | --output | | The output location/format (see below)
63-
| SONG_ARCHIVE | --song-archive | | The song_archive file for SKIP_PREVIOUSLY_DOWNLOADED
64-
| ROOT_PATH | --root-path | | Directory where Zotify saves music
65-
| ROOT_PODCAST_PATH | --root-podcast-path | | Directory where Zotify saves podcasts
66-
| SPLIT_ALBUM_DISCS | --split-album-discs | False | Saves each disk in its own folder
67-
| DOWNLOAD_LYRICS | --download-lyrics | True | Downloads synced lyrics in .lrc format, uses unsynced as fallback.
68-
| MD_ALLGENRES | --md-allgenres | False | Save all relevant genres in metadata
69-
| MD_GENREDELIMITER | --md-genredelimiter | , | Delimiter character used to split genres in metadata
70-
| DOWNLOAD_FORMAT | --download-format | ogg | The download audio format (aac, fdk_aac, m4a, mp3, ogg, opus, vorbis)
71-
| DOWNLOAD_QUALITY | --download-quality | auto | Audio quality of downloaded songs (normal, high, very_high*)
72-
| TRANSCODE_BITRATE | --transcode-bitrate | auto | Overwrite the bitrate for ffmpeg encoding
73-
| SKIP_EXISTING_FILES | --skip-existing | True | Skip songs with the same name
74-
| SKIP_PREVIOUSLY_DOWNLOADED | --skip-previously-downloaded | False | Use a song_archive file to skip previously downloaded songs
75-
| RETRY_ATTEMPTS | --retry-attempts | 1 | Number of times Zotify will retry a failed request
76-
| BULK_WAIT_TIME | --bulk-wait-time | 1 | The wait time between bulk downloads
77-
| OVERRIDE_AUTO_WAIT | --override-auto-wait | False | Totally disable wait time between songs with the risk of instability
78-
| CHUNK_SIZE | --chunk-size | 20000 | Chunk size for downloading
79-
| DOWNLOAD_REAL_TIME | --download-real-time | False | Downloads songs as fast as they would be played, should prevent account bans.
80-
| LANGUAGE | --language | en | Language for spotify metadata
81-
| PRINT_SPLASH | --print-splash | False | Show the Zotify logo at startup
82-
| PRINT_SKIPS | --print-skips | True | Show messages if a song is being skipped
83-
| PRINT_DOWNLOAD_PROGRESS | --print-download-progress | True | Show download/playlist progress bars
84-
| PRINT_ERRORS | --print-errors | True | Show errors
85-
| PRINT_DOWNLOADS | --print-downloads | False | Print messages when a song is finished downloading
86-
| TEMP_DOWNLOAD_DIR | --temp-download-dir | | Download tracks to a temporary directory first
87-
88-
*very-high is limited to premium only
89-
90-
### Configuration
91-
92-
You can find the configuration file in following locations:
93-
| OS | Location
94-
|-----------------|-------------------------------------------------------------------|
95-
| Windows | `C:\Users\<USERNAME>\AppData\Roaming\Zotify\config.json` |
96-
| MacOS | `/Users/<USERNAME>/Library/ApplicationSupport/Zotify/config.json` |
97-
| Linux | `/home/<USERNAME>/.config/zotify/config.json` |
98-
99-
To log out, just remove the configuration file. Uninstalling Zotify does not remove the config file.
100-
101-
### Output format
102-
103-
With the option `OUTPUT` (or the commandline parameter `--output`) you can specify the output location and format.
104-
The value is relative to the `ROOT_PATH`/`ROOT_PODCAST_PATH` directory and can contain the following placeholder:
56+
### Usage
57+
links.txt is a text file with all the links i want to download
10558

106-
| Placeholder | Description
107-
|-----------------|--------------------------------
108-
| {artist} | The song artist
109-
| {album} | The song album
110-
| {song_name} | The song name
111-
| {release_year} | The song release year
112-
| {disc_number} | The disc number
113-
| {track_number} | The track_number
114-
| {id} | The song id
115-
| {track_id} | The track id
116-
| {ext} | The file extension
117-
| {album_id} | (only when downloading albums) ID of the album
118-
| {album_num} | (only when downloading albums) Incrementing track number
119-
| {playlist} | (only when downloading playlists) Name of the playlist
120-
| {playlist_num} | (only when downloading playlists) Incrementing track number
121-
122-
Example values could be:
123-
~~~~
124-
{playlist}/{artist} - {song_name}.{ext}
125-
{playlist}/{playlist_num} - {artist} - {song_name}.{ext}
126-
{artist} - {song_name}.{ext}
127-
{artist}/{album}/{album_num} - {artist} - {song_name}.{ext}
128-
~~~~
129-
130-
### Docker Usage
13159
```
132-
Build the docker image from the Dockerfile:
133-
docker build -t zotify .
134-
Create and run a container from the image:
135-
docker run --rm -v "$PWD/Zotify Music:/root/Music/Zotify Music" -v "$PWD/Zotify Podcasts:/root/Music/Zotify Podcasts" -it zotify
60+
zotify -d {links.txt} --credentials-location {path to credentials.json extracted from other version} --bulk-wait-time 30
13661
```
137-
138-
### What do I do if I see "Your session has been terminated"?
139-
140-
If you see this, don't worry! Just try logging back in. If you see the incorrect username or password error, reset your password and you should be able to log back in.
141-
142-
143-
### Will my account get banned if I use this tool?
144-
145-
Currently no user has reported their account getting banned after using Zotify.
146-
147-
It is recommended you use Zotify with a burner account.
148-
Alternatively, there is a configuration option labeled ```DOWNLOAD_REAL_TIME```, this limits the download speed to the duration of the song being downloaded thus appearing less suspicious.
149-
This option is much slower and is only recommended for premium users who wish to download songs in 320kbps without buying premium on a burner account.
150-
151-
### Disclaimer
152-
Zotify is intended to be used in compliance with DMCA, Section 1201, for educational, private and fair use. \
153-
Zotify contributors are not responsible for any misuse of the program or source code.
154-
155-
### Contributing
156-
157-
Please refer to [CONTRIBUTING](CONTRIBUTING.md)
158-
159-
### Changelog
160-
161-
Please refer to [CHANGELOG](CHANGELOG.md)
62+
### Notes
63+
I have made modifications to suit my use case. They are:
64+
- Only one artist is stored in metadata
65+
- Every song is stored as {artist}/{album}/{title}.{ext}
66+
- Every album stores a cover.jpg file which is the cover photo for that album
67+
- For playlist downloads, an m3u file is created which lists of the songs in the playlist. These files are stored in Music/Playlists. The pats in the m3u files use 'A:/Songs' as root as this is what is requirement for my mp3 player. Feel free to change this to whatever by modifyying the PLAYLIST_ROOT variable in app.py

0 commit comments

Comments
 (0)