initial commit
13
.gitignore
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
settings.ini
|
||||
TODO
|
||||
*.pyc
|
||||
venv
|
||||
.vagrant
|
||||
.pytest_cache
|
||||
__pycache__
|
||||
dist
|
||||
*.sh
|
||||
.venv
|
||||
*.ini
|
||||
.vs
|
||||
.venv
|
||||
13
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Run Deezer Downloader",
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/.venv/Scripts/deezer-downloader",
|
||||
"args": ["--config", ".\\deezer_downloader\\settings.ini"],
|
||||
"console": "integratedTerminal"
|
||||
}
|
||||
]
|
||||
}
|
||||
20
.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "Run Deezer Downloader",
|
||||
"type": "shell",
|
||||
"command": "poetry run deezer-downloader --config .\\deezer_downloader\\settings.ini",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"presentation": {
|
||||
"echo": true,
|
||||
"reveal": "always",
|
||||
"focus": true,
|
||||
"panel": "shared"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
278
DD-README.md
Normal file
@@ -0,0 +1,278 @@
|
||||
# Deezer Downloader 🎶 🎧 💃 🦄
|
||||
[](https://github.com/kmille/deezer-downloader/actions/workflows/tests.yaml)
|
||||
   
|
||||
|
||||
### Download music from Deezer and Spotify with a simple web frontend, through a local-hosted service written in Python.
|
||||
|
||||
### Features
|
||||
- download songs, albums, public playlists from Deezer.com (account is required, free plan is enough)
|
||||
- download Spotify playlists (by parsing the Spotify website and download the songs from Deezer)
|
||||
- download as zip file (including m3u8 playlist file)
|
||||
- quality: flac or 320 kbit/s mp3 with premium subscription or 128 kbit/s MP3s with free subscription
|
||||
- ID3-Tags and embedded album cover
|
||||
- download songs via yt-dlp
|
||||
- KISS (keep it simple and stupid) front end
|
||||
- MPD integration (use it on a Raspberry Pi!)
|
||||
- simple REST api
|
||||
- proxy support (https/socks5)
|
||||
|
||||
## Table of Contents:
|
||||
- [Get started](#get-started)
|
||||
- [Install Python](#1-install-python)
|
||||
- [Install deezer-downloader](#2-install-deezer-downloader)
|
||||
- [Retrieve your arl cookie](#3-retrieve-your-arl-cookie)
|
||||
- [Set the config file](#4-set-the-config-file)
|
||||
- [Run deezer-downloader](#5-run-deezer-downloader)
|
||||
- [Access the frontend](#6-access-the-frontend)
|
||||
- [Settings](#settings)
|
||||
- [Specific use cases](#specific-use-cases)
|
||||
- [Run with Docker](#run-with-docker)
|
||||
- [Run with Vagrant](#run-with-vagrant)
|
||||
- [Run as a service](#run-as-a-service)
|
||||
- [Developer setup](#developer-setup)
|
||||
- [Deployment with Ansible](#deployment-with-ansible)
|
||||
- [Screenshots](#screenshots)
|
||||
- [Tests](#tests)
|
||||
- [Changelog](#changelog)
|
||||
|
||||
## Get started
|
||||
|
||||
### 1. Install Python
|
||||
[python.org](https://www.python.org/about/)
|
||||
|
||||
### 2. Install deezer-downloader
|
||||
```bash
|
||||
pip install --user deezer-downloader
|
||||
```
|
||||
|
||||
If you want to use the Docker image, [scroll](#run-with-docker) down a bit.
|
||||
|
||||
### 3. Retrieve your `arl` cookie
|
||||
|
||||
On Firefox or Chrome-based browser:
|
||||
- Log into your Deezer account
|
||||
- Open the DevTools (`F12` or `Ctrl+Shift+C` or `Ctrl+Shift+I`)
|
||||
- Go to `Storage` tab
|
||||
- In the cookies, find `arl`: a ~200 characters alphanumeric key
|
||||
|
||||
### 4. Set the config file
|
||||
Retrieve the template:
|
||||
```bash
|
||||
deezer-downloader --show-config-template > config.ini
|
||||
```
|
||||
You need to set at least:
|
||||
- under `[deezer]`: `cookie_arl`, your arl cookie
|
||||
- under `[youtubedl]`: `command`, your yt-dlp install path\
|
||||
As stated in the config template, deezer-downloader do NOT keep yt-dlp updated, you will have to monitor this yourself.
|
||||
|
||||
Check [Settings](#settings) for further instructions.
|
||||
|
||||
### 5. Run deezer-downloader
|
||||
```bash
|
||||
deezer-downloader --config config.ini
|
||||
```
|
||||
|
||||
### 6. Access the frontend
|
||||
Unless specified differently in the config file, the default frontend address is: http://localhost:5000.
|
||||
Access it with your favourite web browser.
|
||||
|
||||
Check [Screenshots](#screenshots) if needed.
|
||||
|
||||
Enjoy! 🦄
|
||||
|
||||
## Settings
|
||||
|
||||
There is a settings file template called `settings.ini.example`. You can specify the download directory with `download_dir`. Pressing the download button only downloads the song/album/playlist. If you set `use_mpd=True` in the `settings.ini` the backend will connect to mpd (localhost:6600) and update the music database. Pressing the play button will download the music. If `use_mpd=True` is set the mpd database will be updated and the song/album/playlist will be added to the playlist. In `settings.ini` `music_dir` should be the music root location of mpd. The `download_dir` must be a subdirectory of `music_dir`.
|
||||
|
||||
As Deezer sometimes requires a captcha to login the auto login features was removed. Instead you have to manually insert a valid Deezer cookie to the `settings.ini`. The relevant cookie is the `arl` cookie.
|
||||
|
||||
```bash
|
||||
kmille@linbox:deezer-downloader poetry run deezer-downloader --help
|
||||
usage: deezer-downloader [-h] [-v] [-t] [-c CONFIG]
|
||||
|
||||
Download music from Deezer with a nice front end
|
||||
|
||||
options:
|
||||
-h, --help show this help message and exit
|
||||
-v, --version show version and exit
|
||||
-t, --show-config-template
|
||||
show config template. At least you have to insert the ARL cookie
|
||||
-c CONFIG, --config CONFIG
|
||||
config file - if not supplied, the following directories are considered looking for deezer-downloader.ini: current working directory, XDG_CONFIG_HOME environment variable, ~/.config, /etc)
|
||||
|
||||
kmille@linbox:deezer-downloader poetry run deezer-downloader --config settings.ini
|
||||
Starting Threadpool
|
||||
/home/kmille/.cache/pypoetry/virtualenvs/deezer-downloader-NFDPq16k-py3.11/lib/python3.11/site-packages/giphypop.py:241: UserWarning: You are using the giphy public api key. This should be used for testing only and may be deactivated in the future. See https://github.com/Giphy/GiphyAPI.
|
||||
warnings.warn('You are using the giphy public api key. This '
|
||||
Worker 0 is waiting for a task
|
||||
Worker 1 is waiting for a task
|
||||
Worker 2 is waiting for a task
|
||||
Worker 3 is waiting for a task
|
||||
Worker 0 is now working on task: {'track_id': 8086130, 'add_to_playlist': False}
|
||||
Downloading 'Adele - Set Fire to the Rain.mp3'
|
||||
Dowload finished: /tmp/deezer-downloader/songs/Adele - Set Fire to the Rain.mp3
|
||||
Setting state to mission accomplished to worker 0
|
||||
worker 0 is done with task: {'track_id': 8086130, 'add_to_playlist': False} (state=mission accomplished)
|
||||
```
|
||||
|
||||
## Specific use cases
|
||||
|
||||
### Run with Docker
|
||||
|
||||
There is a Docker image hosted on [hub.docker.com](https://hub.docker.com/r/kmille2/deezer-downloader). Please use an ARL cookie of your Deezer account.
|
||||
|
||||
```bash
|
||||
mkdir downloads
|
||||
sudo docker run -p 5000:5000 --volume $(pwd)/downloads/:/mnt/deezer-downloader --env DEEZER_COOKIE_ARL=your_ARL_cookie kmille2/deezer-downloader:latest
|
||||
xdg-open http://localhost:5000
|
||||
```
|
||||
|
||||
### Run with Vagrant
|
||||
|
||||
```bash
|
||||
cd deployment
|
||||
vagrant up
|
||||
vagrant ssh
|
||||
sudo vim /opt/deezer/settings.ini # insert your Deezer cookie
|
||||
cd /opt/deezer && sudo poetry run deezer-downloader --config settings.ini
|
||||
|
||||
# On the host:
|
||||
xdg-open http://localhost:5000 # view frontend in the browser
|
||||
ncmpcpp -h 127.0.0.1 # try the mpd client
|
||||
```
|
||||
|
||||
### Run as systemd service
|
||||
|
||||
We use it with nginx and [ympd](https://github.com/notandy/ympd) as mpd frontend:
|
||||
- / goes to ympd
|
||||
- /d/ goes to the downloader
|
||||
|
||||
The deployment directory contains a systemd unit file and a nginx vhost config file. There is also a [patch](https://github.com/kmille/music-ansible/blob/master/roles/ympd/files/fix_header.patch) to add a link to the ympd frontend. The `debug` tab will show you the debug output of the app.Shortcuts
|
||||
|
||||
If you want to debug or build it from source: there is a docker-compose file in the docker directory. The `docker/downloads` directory is mounted into the container and will be used as download directory. You have to check the permissions of the `docker/downloads` directory as docker mounts it with the same owner/group/permissions as on the host. The `deezer` user in the docker container has uid 1000. If you also have the uid 1000 then there should be no problem. For debugging: `sudo docker-compose build --force-rm && sudo docker-compose up`
|
||||
|
||||
### Developer setup
|
||||
Tested on Ubuntu Jammy:
|
||||
|
||||
```bash
|
||||
sudo apt-get update -q
|
||||
sudo apt-get install -qy vim tmux git ffmpeg
|
||||
|
||||
# python3-poetry is too old (does not support groups ...)
|
||||
sudo apt-get install -qy python3-pip
|
||||
sudo pip install poetry
|
||||
git clone https://github.com/kmille/deezer-downloader.git
|
||||
cd deezer-downloader
|
||||
poetry install
|
||||
poetry run deezer-downloader --show-config-template > settings.ini
|
||||
|
||||
# enable yt-dlp
|
||||
sudo pip install yt-dlp
|
||||
sed -i 's,.*command = /usr/bin/yt-dlp.*,command = /usr/local/bin/yt-dlp,' settings.ini
|
||||
|
||||
# enable mpd
|
||||
sudo apt-get install -yq mpd ncmpcpp
|
||||
sudo sed -i 's,^music_directory.*,music_directory "/tmp/deezer-downloader",' /etc/mpd.conf
|
||||
sudo systemctl restart mpd
|
||||
sed -i 's/.*use_mpd = False.*/use_mpd = True/' settings.ini
|
||||
|
||||
# 1) Adjust the Deezer cookie: vim settings.ini
|
||||
# 2) Run tests: DEEZER_DOWNLOADER_CONFIG_FILE=settings.ini poetry run pytest -v -s
|
||||
# 3) Run it: poetry run deezer-downloader --config settings.ini
|
||||
# 4) Try out: ncmpcpp -h 127.0.0.1 && xdg-open http://localhost:5000
|
||||
# 5) Downloaded files are in /tmp/deezer-downloader
|
||||
```
|
||||
|
||||
### Deployment with Ansible
|
||||
Including mpd and ympd
|
||||
https://github.com/kmille/music-ansible (not maintained anymore)
|
||||
|
||||
|
||||
## Screenshots
|
||||
|
||||
Search for tracks. You can listen to a 30 second preview in the browser or download the song.
|
||||
|
||||

|
||||
|
||||
Search for albums. You can list the songs of the album or download them (optionally as zip file).
|
||||
|
||||

|
||||
|
||||
Search for artists. You can then show the top songs of the artist or show the albums of the artist.
|
||||
|
||||

|
||||
|
||||
Download songs with youtube-dl
|
||||
|
||||

|
||||
|
||||
Download a Spotify playlist.
|
||||
|
||||

|
||||
|
||||
Download a Deezer playlist.
|
||||
|
||||

|
||||
|
||||
ncmpcpp mpd client.
|
||||
|
||||

|
||||
|
||||
## Shortcuts
|
||||
|
||||
`Ctrl`+`M`: focus search bar
|
||||
`Enter`: serach for songs
|
||||
`Alt`+`Enter`: search for albums
|
||||
`Ctrl`+`B`: go to / (this is where our ympd is)
|
||||
`Ctrl`+`Shift`+`[1-7]` switch tabs
|
||||
|
||||
## Tests
|
||||
|
||||
```bash
|
||||
cd deezer-downloader
|
||||
DEEZER_DOWNLOADER_CONFIG_FILE=settings.ini poetry run pytest -v -s
|
||||
# If you don't set DEEZER_DOWNLOADER_CONFIG_FILE the default template file will be used. Some tests will fail because there is no valid arl_cookie.
|
||||
```
|
||||
|
||||
## Changelog
|
||||
|
||||
### Version 2.0.0 (27.03.2023)
|
||||
|
||||
- use poetry as build system
|
||||
- build package and uploada to pypi
|
||||
- worker threads now "daemon threads" (they now just stop if you stop deezer-downloader)
|
||||
- update config template (remove http.debug)
|
||||
- update dependencies
|
||||
- switch to waitress (from gunicorn)
|
||||
|
||||
### Version 1.3.3 (27.12.2021)
|
||||
- replace youtube-dl by yt-dl
|
||||
- update third party dependencies
|
||||
|
||||
### Version 1.3.2 (26.11.2021)
|
||||
- fix broken deezer download functionality (#66, removes the ability to download flac quality)
|
||||
- update third party dependencies
|
||||
- update ubuntu base image for the docker container
|
||||
|
||||
### Version 1.3.1 (21.01.2021)
|
||||
- allow to set download quality (flac|mp3) via environment variable DEEZER_FLAC_QUALITY (#43)
|
||||
|
||||
### Version 1.3 (05.11.2020)
|
||||
|
||||
- feature: download your favorite Deezer songs
|
||||
- automated tests with Github Actions
|
||||
- push Docker image to [hub.docker.com](https://hub.docker.com/repository/docker/kmille2/deezer-downloader/general) with Github Actions
|
||||
|
||||
### Version 1.2 (01.11.2020)
|
||||
|
||||
- **breaking change:** now use the `arl` cookie instead of the `sid` cookie. This cookie does not expire so we don't need the background thread that keeps the session alive
|
||||
- add support for flac as download format
|
||||
|
||||
### Version 1.1 (13.05.2020)
|
||||
|
||||
- thanks to [luelista](https://github.com/luelista) for the contribution!
|
||||
- play 30 second preview in browser
|
||||
- add Vagrantfile
|
||||
- show album cover in search results
|
||||
- use a threaded queue for download tasks
|
||||
- list album songs
|
||||
33
Dockerfile
Normal file
@@ -0,0 +1,33 @@
|
||||
FROM python:3.13-alpine3.22 AS builder
|
||||
RUN pip install poetry
|
||||
COPY . /app
|
||||
WORKDIR /app
|
||||
RUN poetry build --format=wheel
|
||||
|
||||
|
||||
FROM python:3.13-alpine3.22
|
||||
|
||||
LABEL org.opencontainers.image.source=https://github.com/kmille/deezer-downloader
|
||||
LABEL org.opencontainers.image.description="Download music from Deezer with a nice front end"
|
||||
LABEL org.opencontainers.image.licenses=MIT
|
||||
|
||||
ENV PYTHONUNBUFFERED=TRUE
|
||||
|
||||
RUN apk add --no-cache ffmpeg && \
|
||||
adduser -D deezer && \
|
||||
mkdir -p /mnt/deezer-downloader && \
|
||||
chown deezer:deezer /mnt/deezer-downloader
|
||||
|
||||
COPY --from=builder /app/dist/deezer_downloader*.whl .
|
||||
RUN pip install deezer_downloader*.whl && \
|
||||
/usr/local/bin/deezer-downloader --show-config-template > /etc/deezer-downloader.ini && \
|
||||
sed -i "s,.*command = /usr/bin/yt-dlp.*,command = $(which yt-dlp)," /etc/deezer-downloader.ini && \
|
||||
sed -i 's,host = 127.0.0.1,host = 0.0.0.0,' /etc/deezer-downloader.ini && \
|
||||
sed -i 's,/tmp/deezer-downloader,/mnt/deezer-downloader,' /etc/deezer-downloader.ini && \
|
||||
rm deezer_downloader*.whl
|
||||
|
||||
ENV LOG_FILE=/tmp/deezer-downloader.log
|
||||
|
||||
USER deezer
|
||||
EXPOSE 5000
|
||||
CMD /bin/sh -c "/usr/local/bin/deezer-downloader --config /etc/deezer-downloader.ini | tee $LOG_FILE"
|
||||
253
LICENSE
@@ -1,232 +1,21 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright © 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
“This License” refers to version 3 of the GNU General Public License.
|
||||
|
||||
“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
|
||||
|
||||
“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.
|
||||
|
||||
To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.
|
||||
|
||||
A “covered work” means either the unmodified Program or a work based on the Program.
|
||||
|
||||
To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
|
||||
|
||||
To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.
|
||||
|
||||
A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
|
||||
|
||||
The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.
|
||||
|
||||
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
|
||||
|
||||
A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
|
||||
|
||||
“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
|
||||
|
||||
An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”.
|
||||
|
||||
A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
|
||||
|
||||
A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
|
||||
|
||||
Deezer-Downloader-Nextcloud
|
||||
Copyright (C) 2025 grizouille
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
|
||||
|
||||
Deezer-Downloader-Nextcloud Copyright (C) 2025 grizouille
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <https://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 kmille
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
26
README.md
@@ -5,3 +5,29 @@ Fork de deezer-downloader pour en faire une app externe Nextcloud
|
||||
## Limites:
|
||||
|
||||
* N'as pas de sessios part user
|
||||
|
||||
## Dev sous windows:
|
||||
|
||||
Pour que powershell accepte d'exécuter des scripts:
|
||||
```
|
||||
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
|
||||
```
|
||||
|
||||
venv activer avec:
|
||||
```
|
||||
.\.venv\Scripts\Activate.ps1
|
||||
```
|
||||
|
||||
Install:
|
||||
```
|
||||
pip install poetry
|
||||
git clone https://github.com/kmille/deezer-downloader.git
|
||||
cd deezer-downloader
|
||||
poetry install
|
||||
poetry run deezer-downloader --show-config-template > settings.ini
|
||||
```
|
||||
|
||||
run du srv en ligne de cmd:
|
||||
```
|
||||
poetry run deezer-downloader --config .\deezer_downloader\settings.ini
|
||||
```
|
||||
59
deezer_downloader/cli/deezer-downloader.ini.template
Normal file
@@ -0,0 +1,59 @@
|
||||
;;; template configuration for deezer-downlaoder
|
||||
;;; you need to adjust: deezer.cookie_arl
|
||||
|
||||
[mpd]
|
||||
; if you set this to True, the backend will connect to mpd (localhost:6600) and update
|
||||
; the music database after a completed download
|
||||
use_mpd = False
|
||||
host = localhost
|
||||
port = 6600
|
||||
music_dir_root = /tmp/deezer-downloader
|
||||
|
||||
[download_dirs]
|
||||
base = /tmp/deezer-downloader
|
||||
|
||||
songs = %(base)s/songs
|
||||
albums = %(base)s/albums
|
||||
zips = %(base)s/zips
|
||||
playlists = %(base)s/playlists
|
||||
youtubedl = %(base)s/youtube-dl
|
||||
|
||||
[debug]
|
||||
; debug output used for /debug
|
||||
command = journalctl -u deezer-downloader -n 100 --output cat
|
||||
|
||||
[http]
|
||||
; web backend options
|
||||
host = 127.0.0.1
|
||||
port = 5000
|
||||
|
||||
; if used behind a proxy, specify base url prefix
|
||||
; url_prefix = /deezer
|
||||
url_prefix =
|
||||
api_root = %(url_prefix)s
|
||||
static_root = %(url_prefix)s/static
|
||||
|
||||
[proxy]
|
||||
; server:
|
||||
; - https://user:pass@host:port
|
||||
; - socks5://127.0.0.1:9050
|
||||
; - socks5h://127.0.0.1:9050 (DNS goes also over proxy)
|
||||
server =
|
||||
|
||||
[threadpool]
|
||||
; number of workers in thread pool, this specifies the maximum number of parallel downloads
|
||||
workers = 4
|
||||
|
||||
[deezer]
|
||||
; valid arl cookie value
|
||||
; login manually using your web browser and take the arl cookie
|
||||
cookie_arl = [a-f0-9]{192}
|
||||
; mp3 or flac - flac needs premium subscription
|
||||
quality = mp3
|
||||
|
||||
[youtubedl]
|
||||
; you are responsible for keeping yt-dlp up-to-date (https://github.com/yt-dlp/yt-dlp)
|
||||
; command = /home/kmille/projects/deezer-downloader/app/venv/bin/yt-dlp
|
||||
command = /usr/bin/yt-dlp
|
||||
|
||||
; vim: syntax=dosini
|
||||
56
deezer_downloader/cli/runner.py
Normal file
@@ -0,0 +1,56 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
import waitress
|
||||
|
||||
|
||||
def get_version():
|
||||
from importlib.metadata import version
|
||||
v = version("deezer_downloader")
|
||||
return f"v{v}"
|
||||
|
||||
|
||||
def run_backend():
|
||||
from deezer_downloader.configuration import config
|
||||
from deezer_downloader.web.app import app
|
||||
|
||||
print(f"Listening on {config['http']['host']}:{config['http'].getint('port')} (version {get_version()})")
|
||||
if __name__ == '__main__':
|
||||
app.run(debug=True,
|
||||
host=config['http']['host'],
|
||||
port=config['http'].getint('port'))
|
||||
else:
|
||||
listen = f"{config['http']['host']}:{config['http'].getint('port')}"
|
||||
waitress.serve(app, listen=listen)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(prog='deezer-downloader',
|
||||
description="Download music from Deezer and Spotify with a simple web frontend, through a local-hosted service written in Python.",
|
||||
epilog="More info at https://github.com/kmille/deezer-downloader.")
|
||||
parser.add_argument("-v", "--version", action='store_true', help="show version and exit")
|
||||
parser.add_argument("-t", "--show-config-template", action='store_true', help="show config template - you have to provide the ARL cookie at least")
|
||||
parser.add_argument("-c", "--config", help="config file - if not supplied, the following directories are considered looking for deezer-downloader.ini: current working directory, XDG_CONFIG_HOME environment variable, ~/.config, /etc)")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
if len(sys.argv) == 1:
|
||||
parser.print_help()
|
||||
sys.exit(1)
|
||||
|
||||
if args.version:
|
||||
print(sys.argv[0], get_version())
|
||||
sys.exit(0)
|
||||
|
||||
if args.show_config_template:
|
||||
print((Path(__file__).parent / Path("deezer-downloader.ini.template")).read_text(), end="")
|
||||
sys.exit(0)
|
||||
|
||||
from deezer_downloader.configuration import load_config
|
||||
load_config(args.config)
|
||||
run_backend()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
53
deezer_downloader/configuration.py
Normal file
@@ -0,0 +1,53 @@
|
||||
import sys
|
||||
import os
|
||||
from pathlib import Path
|
||||
from configparser import ConfigParser
|
||||
|
||||
config = None
|
||||
|
||||
|
||||
def load_config(config_abs):
|
||||
global config
|
||||
|
||||
if not os.path.exists(config_abs):
|
||||
print(f"Could not find config file: {config_abs}")
|
||||
sys.exit(1)
|
||||
|
||||
config = ConfigParser()
|
||||
config.read(config_abs)
|
||||
|
||||
assert list(config.keys()) == ['DEFAULT', 'mpd', 'download_dirs', 'debug', 'http', 'proxy', 'threadpool', 'deezer', 'youtubedl'], f"Validating config file failed. Check {config_abs}"
|
||||
|
||||
if config['mpd'].getboolean('use_mpd'):
|
||||
if not config['mpd']['music_dir_root'].startswith(config['download_dirs']['base']):
|
||||
print("ERROR: base download dir must be a subdirectory of the mpd music_dir_root")
|
||||
sys.exit(1)
|
||||
|
||||
if not Path(config['youtubedl']['command']).exists():
|
||||
print(f"ERROR: yt-dlp not found at {config['youtubedl']['command']}")
|
||||
sys.exit(1)
|
||||
|
||||
proxy_server = config['proxy']['server']
|
||||
if len(proxy_server) > 0:
|
||||
if not proxy_server.startswith("https://") and \
|
||||
not proxy_server.startswith("socks5"): # there is also socks5h
|
||||
print(f"ERROR: invalid proxy server address: {config['proxy']['server']}")
|
||||
sys.exit(1)
|
||||
|
||||
if "DEEZER_COOKIE_ARL" in os.environ.keys():
|
||||
config["deezer"]["cookie_arl"] = os.environ["DEEZER_COOKIE_ARL"]
|
||||
|
||||
if len(config["deezer"]["cookie_arl"].strip()) == 0:
|
||||
print("ERROR: cookie_arl must not be empty")
|
||||
sys.exit(1)
|
||||
|
||||
if "DEEZER_QUALITY" in os.environ.keys():
|
||||
config["deezer"]["quality"] = os.environ["DEEZER_QUALITY"]
|
||||
|
||||
if "quality" in config['deezer']:
|
||||
if config['deezer']["quality"] not in ("mp3", "flac"):
|
||||
print("ERROR: quality must be mp3 or flac in config file")
|
||||
sys.exit(1)
|
||||
else:
|
||||
print("Warning: quality not set in config file. Using mp3")
|
||||
config["deezer"]["quality"] = "mp3"
|
||||
491
deezer_downloader/deezer.py
Normal file
@@ -0,0 +1,491 @@
|
||||
import sys
|
||||
import re
|
||||
import json
|
||||
from typing import Optional, Sequence
|
||||
|
||||
from deezer_downloader.configuration import config
|
||||
|
||||
from Crypto.Hash import MD5
|
||||
from Crypto.Cipher import Blowfish
|
||||
import urllib.parse
|
||||
import html.parser
|
||||
import requests
|
||||
from binascii import a2b_hex, b2a_hex
|
||||
from mutagen.flac import FLAC, Picture
|
||||
from mutagen.mp3 import MP3
|
||||
from mutagen.id3 import PictureType, TIT2, TALB, TPE1, TRCK, TDRC, TPOS, APIC, TPE2
|
||||
from mutagen import MutagenError
|
||||
|
||||
|
||||
# BEGIN TYPES
|
||||
TYPE_TRACK = "track"
|
||||
TYPE_ALBUM = "album"
|
||||
TYPE_PLAYLIST = "playlist"
|
||||
TYPE_ARTIST = "artist"
|
||||
TYPE_ALBUM_TRACK = "album_track" # used for listing songs of an album
|
||||
TYPE_ARTIST_ALBUM = "artist_album" # used for listing albums of an artist
|
||||
TYPE_ARTIST_TOP = "artist_top" # used for listing top tracks of an artist
|
||||
# END TYPES
|
||||
|
||||
session = None
|
||||
license_token = {}
|
||||
sound_format = ""
|
||||
USER_AGENT = "Mozilla/5.0 (X11; Linux i686; rv:135.0) Gecko/20100101 Firefox/135.0"
|
||||
|
||||
|
||||
def get_user_data() -> tuple[str, str]:
|
||||
try:
|
||||
user_data = session.get('https://www.deezer.com/ajax/gw-light.php?method=deezer.getUserData&input=3&api_version=1.0&api_token=')
|
||||
user_data_json = user_data.json()['results']
|
||||
options = user_data_json['USER']['OPTIONS']
|
||||
license_token = options['license_token']
|
||||
web_sound_quality = options['web_sound_quality']
|
||||
return license_token, web_sound_quality
|
||||
except (requests.exceptions.RequestException, KeyError) as e:
|
||||
print(f"ERROR: Could not get license token: {e}")
|
||||
|
||||
|
||||
# quality_config comes from config file
|
||||
# web_sound_quality is a dict coming from Deezer API and depends on ARL cookie (premium subscription)
|
||||
def set_song_quality(quality_config: str, web_sound_quality: dict):
|
||||
global sound_format
|
||||
flac_supported = web_sound_quality['lossless'] is True
|
||||
if flac_supported:
|
||||
if quality_config == "flac":
|
||||
sound_format = "FLAC"
|
||||
else:
|
||||
sound_format = "MP3_320"
|
||||
else:
|
||||
if quality_config == "flac":
|
||||
print("WARNING: flac quality is configured in config file but not supported (no premium subscription?). Falling back to mp3")
|
||||
sound_format = "MP3_128"
|
||||
|
||||
|
||||
def get_file_extension() -> str:
|
||||
return "flac" if sound_format == "FLAC" else "mp3"
|
||||
|
||||
|
||||
# quality is mp3 or flac
|
||||
def init_deezer_session(proxy_server: str, quality: str) -> None:
|
||||
global session, license_token, web_sound_quality
|
||||
header = {
|
||||
'Pragma': 'no-cache',
|
||||
'Origin': 'https://www.deezer.com',
|
||||
'Accept-Encoding': 'gzip, deflate, br',
|
||||
'Accept-Language': 'en-US,en;q=0.9',
|
||||
'User-Agent': USER_AGENT,
|
||||
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
|
||||
'Accept': '*/*',
|
||||
'Cache-Control': 'no-cache',
|
||||
'X-Requested-With': 'XMLHttpRequest',
|
||||
'Connection': 'keep-alive',
|
||||
'Referer': 'https://www.deezer.com/login',
|
||||
'DNT': '1',
|
||||
}
|
||||
session = requests.session()
|
||||
session.headers.update(header)
|
||||
session.cookies.update({'arl': config['deezer']['cookie_arl'], 'comeback': '1'})
|
||||
if len(proxy_server.strip()) > 0:
|
||||
print(f"Using proxy {proxy_server}")
|
||||
session.proxies.update({"https": proxy_server})
|
||||
license_token, web_sound_quality = get_user_data()
|
||||
set_song_quality(quality, web_sound_quality)
|
||||
|
||||
|
||||
class Deezer404Exception(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class Deezer403Exception(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class DeezerApiException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class ScriptExtractor(html.parser.HTMLParser):
|
||||
""" extract <script> tag contents from a html page """
|
||||
def __init__(self):
|
||||
html.parser.HTMLParser.__init__(self)
|
||||
self.scripts = []
|
||||
self.curtag = None
|
||||
|
||||
def handle_starttag(self, tag, attrs):
|
||||
self.curtag = tag.lower()
|
||||
|
||||
def handle_data(self, data):
|
||||
if self.curtag == "script":
|
||||
self.scripts.append(data)
|
||||
|
||||
def handle_endtag(self, tag):
|
||||
self.curtag = None
|
||||
|
||||
|
||||
def md5hex(data):
|
||||
""" return hex string of md5 of the given string """
|
||||
# type(data): bytes
|
||||
# returns: bytes
|
||||
h = MD5.new()
|
||||
h.update(data)
|
||||
return b2a_hex(h.digest())
|
||||
|
||||
|
||||
def calcbfkey(songid):
|
||||
""" Calculate the Blowfish decrypt key for a given songid """
|
||||
key = b"g4el58wc0zvf9na1"
|
||||
songid_md5 = md5hex(songid.encode())
|
||||
|
||||
xor_op = lambda i: chr(songid_md5[i] ^ songid_md5[i + 16] ^ key[i])
|
||||
decrypt_key = "".join([xor_op(i) for i in range(16)])
|
||||
return decrypt_key
|
||||
|
||||
|
||||
def blowfishDecrypt(data, key):
|
||||
iv = a2b_hex("0001020304050607")
|
||||
c = Blowfish.new(key.encode(), Blowfish.MODE_CBC, iv)
|
||||
return c.decrypt(data)
|
||||
|
||||
|
||||
def decryptfile(fh, key, fo):
|
||||
"""
|
||||
Decrypt data from file <fh>, and write to file <fo>.
|
||||
decrypt using blowfish with <key>.
|
||||
Only every third 2048 byte block is encrypted.
|
||||
"""
|
||||
blockSize = 2048
|
||||
i = 0
|
||||
|
||||
for data in fh.iter_content(blockSize):
|
||||
if not data:
|
||||
break
|
||||
|
||||
isEncrypted = ((i % 3) == 0)
|
||||
isWholeBlock = len(data) == blockSize
|
||||
|
||||
if isEncrypted and isWholeBlock:
|
||||
data = blowfishDecrypt(data, key)
|
||||
|
||||
fo.write(data)
|
||||
i += 1
|
||||
|
||||
|
||||
def downloadpicture(pic_idid):
|
||||
setting_domain_img = "https://e-cdns-images.dzcdn.net/images"
|
||||
url = setting_domain_img + "/cover/" + pic_idid + "/1200x1200.jpg"
|
||||
resp = session.get(url)
|
||||
resp.raise_for_status()
|
||||
return resp.content
|
||||
|
||||
|
||||
def get_song_url(track_token: str, quality: int = 3) -> str:
|
||||
try:
|
||||
response = requests.post(
|
||||
"https://media.deezer.com/v1/get_url",
|
||||
json={
|
||||
'license_token': license_token,
|
||||
'media': [{
|
||||
'type': "FULL",
|
||||
"formats": [
|
||||
{"cipher": "BF_CBC_STRIPE", "format": sound_format}]
|
||||
}],
|
||||
'track_tokens': [track_token,]
|
||||
},
|
||||
headers={"User-Agent": USER_AGENT},
|
||||
)
|
||||
response.raise_for_status()
|
||||
data = response.json()
|
||||
except requests.exceptions.RequestException as e:
|
||||
raise DeezerApiException(f"Could not retrieve song URL: {e}")
|
||||
|
||||
if not data.get('data') or 'errors' in data['data'][0]:
|
||||
raise DeezerApiException(f"Could not get download url from API: {data['data'][0]['errors'][0]['message']}")
|
||||
|
||||
if len(data["data"][0]["media"]) == 0:
|
||||
raise DeezerApiException(f"Could not get download url from API. There was no API error, but also no song information. API response: {data}")
|
||||
|
||||
url = data['data'][0]['media'][0]['sources'][0]['url']
|
||||
return url
|
||||
|
||||
|
||||
def download_song(song: dict, output_file: str) -> None:
|
||||
# downloads and decrypts the song from Deezer. Adds ID3 and art cover
|
||||
# song: dict with information of the song (grabbed from Deezer.com)
|
||||
# output_file: absolute file name of the output file
|
||||
assert type(song) is dict, "song must be a dict"
|
||||
assert type(output_file) is str, "output_file must be a str"
|
||||
|
||||
try:
|
||||
url = get_song_url(song["TRACK_TOKEN"])
|
||||
except Exception as e:
|
||||
print(f"Could not download song (https://www.deezer.com/us/track/{song['SNG_ID']}). Maybe it's not available anymore or at least not in your country. {e}")
|
||||
if "FALLBACK" in song:
|
||||
song = song["FALLBACK"]
|
||||
print(f"Trying fallback song https://www.deezer.com/us/track/{song['SNG_ID']}")
|
||||
try:
|
||||
url = get_song_url(song["TRACK_TOKEN"])
|
||||
except Exception:
|
||||
pass
|
||||
else:
|
||||
print("Fallback song seems to work")
|
||||
else:
|
||||
raise
|
||||
|
||||
key = calcbfkey(song["SNG_ID"])
|
||||
is_flac = get_file_extension() == "flac"
|
||||
|
||||
try:
|
||||
with session.get(url, stream=True) as response:
|
||||
response.raise_for_status()
|
||||
with open(output_file, "w+b") as fo:
|
||||
decryptfile(response, key, fo)
|
||||
write_song_metadata(output_file, song, is_flac)
|
||||
except MutagenError as e:
|
||||
print(f"Warning: Could not write metadata to file: {e}")
|
||||
except Exception as e:
|
||||
raise DeezerApiException(f"Could not write song to disk: {e}") from e
|
||||
print("Download finished: {}".format(output_file))
|
||||
|
||||
|
||||
def write_song_metadata(output_file: str, song: dict, is_flac: bool) -> None:
|
||||
|
||||
def set_metadata(audio, key, value):
|
||||
if not value:
|
||||
return
|
||||
elif isinstance(audio, MP3):
|
||||
if key == 'artist':
|
||||
audio['TPE1'] = TPE1(encoding=3, text=value)
|
||||
elif key == 'albumartist':
|
||||
audio['TPE2'] = TPE2(encoding=3, text=value)
|
||||
elif key == 'title':
|
||||
audio['TIT2'] = TIT2(encoding=3, text=value)
|
||||
elif key == 'album':
|
||||
audio['TALB'] = TALB(encoding=3, text=value)
|
||||
elif key == 'discnumber':
|
||||
audio['TPOS'] = TPOS(encoding=3, text=value)
|
||||
elif key == 'tracknumber':
|
||||
audio['TRCK'] = TRCK(encoding=3, text=value)
|
||||
elif key == 'date':
|
||||
audio['TDRC'] = TDRC(encoding=3, text=value)
|
||||
elif key == 'picture':
|
||||
audio['APIC'] = APIC(encoding=3, mime='image/jpeg', type=PictureType.COVER_FRONT, desc='Cover', data=value)
|
||||
else:
|
||||
if key == 'picture':
|
||||
pic = Picture()
|
||||
pic.mime = u'image/jpeg'
|
||||
pic.type = PictureType.COVER_FRONT
|
||||
pic.desc = 'Cover'
|
||||
pic.data = value
|
||||
audio.add_picture(pic)
|
||||
else:
|
||||
audio[key] = value
|
||||
|
||||
if is_flac:
|
||||
audio = FLAC(output_file)
|
||||
else:
|
||||
audio = MP3(output_file)
|
||||
|
||||
set_metadata(audio, "artist", song.get("ART_NAME", None))
|
||||
set_metadata(audio, "title", song.get("SNG_TITLE", None))
|
||||
set_metadata(audio, "album", song.get("ALB_TITLE", None))
|
||||
set_metadata(audio, 'tracknumber', song.get("TRACK_NUMBER", None))
|
||||
set_metadata(audio, "discnumber", song.get("DISK_NUMBER", None))
|
||||
|
||||
if "album_Data" in globals() and "PHYSICAL_RELEASE_DATE" in album_Data:
|
||||
set_metadata(audio, "date", album_Data.get("PHYSICAL_RELEASE_DATE")[:4])
|
||||
|
||||
set_metadata(audio, "picture", downloadpicture(song["ALB_PICTURE"]))
|
||||
set_metadata(audio, "albumartist", song.get('ALB_ART_NAME', song.get('ART_NAME', None)))
|
||||
audio.save()
|
||||
|
||||
|
||||
def get_song_infos_from_deezer_website(search_type, id):
|
||||
# search_type: either one of the constants: TYPE_TRACK|TYPE_ALBUM|TYPE_PLAYLIST
|
||||
# id: deezer_id of the song/album/playlist (like https://www.deezer.com/de/track/823267272)
|
||||
# return: if TYPE_TRACK => song (dict grabbed from the website with information about a song)
|
||||
# return: if TYPE_ALBUM|TYPE_PLAYLIST => list of songs
|
||||
# raises
|
||||
# Deezer404Exception if
|
||||
# 1. open playlist https://www.deezer.com/de/playlist/1180748301 and click on song Honey from Moby in a new tab:
|
||||
# 2. Deezer gives you a 404: https://www.deezer.com/de/track/68925038
|
||||
# Deezer403Exception if we are not logged in
|
||||
|
||||
url = "https://www.deezer.com/us/{}/{}".format(search_type, id)
|
||||
resp = session.get(url)
|
||||
if resp.status_code == 404:
|
||||
raise Deezer404Exception("ERROR: Got a 404 for {} from Deezer".format(url))
|
||||
if "MD5_ORIGIN" not in resp.text:
|
||||
raise Deezer403Exception("ERROR: we are not logged in on deezer.com. Please update the cookie")
|
||||
|
||||
parser = ScriptExtractor()
|
||||
parser.feed(resp.text)
|
||||
parser.close()
|
||||
|
||||
songs = []
|
||||
for script in parser.scripts:
|
||||
regex = re.search(r'{"DATA":.*', script)
|
||||
if regex:
|
||||
DZR_APP_STATE = json.loads(regex.group())
|
||||
global album_Data
|
||||
album_Data = DZR_APP_STATE.get("DATA")
|
||||
if DZR_APP_STATE['DATA']['__TYPE__'] == 'playlist' or DZR_APP_STATE['DATA']['__TYPE__'] == 'album':
|
||||
# songs if you searched for album/playlist
|
||||
for song in DZR_APP_STATE['SONGS']['data']:
|
||||
songs.append(song)
|
||||
elif DZR_APP_STATE['DATA']['__TYPE__'] == 'song':
|
||||
# just one song on that page
|
||||
songs.append(DZR_APP_STATE['DATA'])
|
||||
return songs[0] if search_type == TYPE_TRACK else songs
|
||||
|
||||
|
||||
def deezer_search(search, search_type):
|
||||
# search: string (What are you looking for?)
|
||||
# search_type: either one of the constants: TYPE_TRACK|TYPE_ALBUM|TYPE_ALBUM_TRACK (TYPE_PLAYLIST is not supported)
|
||||
# return: list of dicts (keys depend on search_type)
|
||||
|
||||
if search_type not in [TYPE_TRACK, TYPE_ALBUM, TYPE_ARTIST, TYPE_ALBUM_TRACK, TYPE_ARTIST_ALBUM, TYPE_ARTIST_TOP]:
|
||||
print("ERROR: search_type is wrong: {}".format(search_type))
|
||||
return []
|
||||
search = urllib.parse.quote_plus(search)
|
||||
if search_type == TYPE_ALBUM_TRACK:
|
||||
url = f"https://api.deezer.com//album/{search}"
|
||||
elif search_type == TYPE_ARTIST_TOP:
|
||||
url = f"https://api.deezer.com/artist/{search}/top?limit=20"
|
||||
elif search_type == TYPE_ARTIST_ALBUM:
|
||||
url = f"https://api.deezer.com/artist/{search}/albums"
|
||||
else:
|
||||
url = f"https://api.deezer.com/search/{search_type}?q={search}"
|
||||
|
||||
try:
|
||||
resp = session.get(url)
|
||||
resp.raise_for_status()
|
||||
data = resp.json()
|
||||
if search_type == TYPE_ALBUM_TRACK:
|
||||
data = data["tracks"]['data']
|
||||
else:
|
||||
data = data['data']
|
||||
except (requests.exceptions.RequestException, KeyError) as e:
|
||||
print(f"ERROR: Could not search for music: {e}")
|
||||
return []
|
||||
|
||||
return_nice = []
|
||||
for item in data:
|
||||
i = {}
|
||||
i['id'] = str(item['id'])
|
||||
if search_type in (TYPE_ALBUM, TYPE_ARTIST_ALBUM):
|
||||
i['id_type'] = TYPE_ALBUM
|
||||
i['album'] = item['title']
|
||||
i['album_id'] = item['id']
|
||||
i['img_url'] = item['cover_small']
|
||||
i['title'] = ''
|
||||
i['preview_url'] = ''
|
||||
i['artist'] = ''
|
||||
if search_type == TYPE_ALBUM:
|
||||
# strange API design? artist is not there when asking for ARTIST_ALBUMs
|
||||
i['artist'] = item['artist']['name']
|
||||
elif search_type in (TYPE_TRACK, TYPE_ARTIST_TOP, TYPE_ALBUM_TRACK):
|
||||
i['id_type'] = TYPE_TRACK
|
||||
i['title'] = item['title']
|
||||
i['img_url'] = item['album']['cover_small']
|
||||
i['album'] = item['album']['title']
|
||||
i['album_id'] = item['album']['id']
|
||||
i['artist'] = item['artist']['name']
|
||||
i['preview_url'] = item['preview']
|
||||
elif search_type == TYPE_ARTIST:
|
||||
i['id_type'] = TYPE_ARTIST
|
||||
i['title'] = ''
|
||||
i['img_url'] = item['picture_small']
|
||||
i['album'] = ''
|
||||
i['album_id'] = ''
|
||||
i['artist'] = item['name']
|
||||
i['artist_id'] = item['id']
|
||||
i['preview_url'] = ''
|
||||
return_nice.append(i)
|
||||
return return_nice
|
||||
|
||||
|
||||
def parse_deezer_playlist(playlist_id):
|
||||
# playlist_id: id of the playlist or the url of it
|
||||
# e.g. https://www.deezer.com/de/playlist/6046721604 or 6046721604
|
||||
# return (playlist_name, list of songs) (song is a dict with information about the song)
|
||||
# raises DeezerApiException if something with the Deezer API is broken
|
||||
|
||||
try:
|
||||
playlist_id = re.search(r'\d+', playlist_id).group(0)
|
||||
except AttributeError:
|
||||
raise DeezerApiException("ERROR: Regex (\\d+) for playlist_id failed. You gave me '{}'".format(playlist_id))
|
||||
|
||||
url_get_csrf_token = "https://www.deezer.com/ajax/gw-light.php?method=deezer.getUserData&input=3&api_version=1.0&api_token="
|
||||
req = session.post(url_get_csrf_token)
|
||||
csrf_token = req.json()['results']['checkForm']
|
||||
|
||||
url_get_playlist_songs = "https://www.deezer.com/ajax/gw-light.php?method=deezer.pagePlaylist&input=3&api_version=1.0&api_token={}".format(csrf_token)
|
||||
data = {'playlist_id': int(playlist_id),
|
||||
'start': 0,
|
||||
'tab': 0,
|
||||
'header': True,
|
||||
'lang': 'de',
|
||||
'nb': 500}
|
||||
req = session.post(url_get_playlist_songs, json=data)
|
||||
json = req.json()
|
||||
|
||||
if len(json['error']) > 0:
|
||||
raise DeezerApiException("ERROR: deezer api said {}".format(json['error']))
|
||||
json_data = json['results']
|
||||
|
||||
playlist_name = json_data['DATA']['TITLE']
|
||||
number_songs = json_data['DATA']['NB_SONG']
|
||||
print("Playlist '{}' has {} songs".format(playlist_name, number_songs))
|
||||
|
||||
print("Got {} songs from API".format(json_data['SONGS']['count']))
|
||||
return playlist_name, json_data['SONGS']['data']
|
||||
|
||||
|
||||
def get_deezer_favorites(user_id: str) -> Optional[Sequence[int]]:
|
||||
if not user_id.isnumeric():
|
||||
raise Exception(f"User id '{user_id}' must be numeric")
|
||||
resp = session.get(f"https://api.deezer.com/user/{user_id}/tracks?limit=10000000000")
|
||||
assert resp.status_code == 200, f"got invalid status asking for favorite song\n{resp.text}s"
|
||||
resp_json = resp.json()
|
||||
if "error" in resp_json.keys():
|
||||
raise Exception(f"Upstream api error getting favorite songs for user {user_id}:\n{resp_json['error']}")
|
||||
# check is set next
|
||||
|
||||
while "next" in resp_json.keys():
|
||||
resp = session.get(resp_json["next"])
|
||||
assert resp.status_code == 200, f"got invalid status asking for favorite song\n{resp.text}s"
|
||||
resp_json_next = resp.json()
|
||||
if "error" in resp_json_next.keys():
|
||||
raise Exception(f"Upstream api error getting favorite songs for user {user_id}:\n{resp_json_next['error']}")
|
||||
resp_json["data"] += resp_json_next["data"]
|
||||
|
||||
if "next" in resp_json_next.keys():
|
||||
resp_json["next"] = resp_json_next["next"]
|
||||
else:
|
||||
del resp_json["next"]
|
||||
|
||||
print(f"Got {resp_json['total']} favorite songs for user {user_id} from the api")
|
||||
songs = [song['id'] for song in resp_json['data']]
|
||||
return songs
|
||||
|
||||
|
||||
def test_deezer_login():
|
||||
print("Let's check if the deezer login is still working")
|
||||
try:
|
||||
song = get_song_infos_from_deezer_website(TYPE_TRACK, "917265")
|
||||
except (Deezer403Exception, Deezer404Exception) as msg:
|
||||
print(msg)
|
||||
print("Login is not working anymore.")
|
||||
return False
|
||||
|
||||
if song:
|
||||
print("Login is still working.")
|
||||
return True
|
||||
else:
|
||||
print("Login is not working anymore.")
|
||||
return False
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) > 1 and sys.argv[1] == "check-login":
|
||||
test_deezer_login()
|
||||
BIN
deezer_downloader/requirements.txt
Normal file
189
deezer_downloader/spotify.py
Normal file
@@ -0,0 +1,189 @@
|
||||
import re
|
||||
import base64
|
||||
import pyotp
|
||||
from time import sleep
|
||||
from urllib.parse import urlparse, parse_qs
|
||||
from typing import Tuple
|
||||
|
||||
import requests
|
||||
|
||||
token_url = 'https://open.spotify.com/api/token'
|
||||
server_time_url = 'https://open.spotify.com/api/server-time'
|
||||
playlist_base_url = 'https://api.spotify.com/v1/playlists/{}/tracks?limit=100&additional_types=track' # todo figure out market
|
||||
track_base_url = 'https://api.spotify.com/v1/tracks/{}'
|
||||
album_base_url = 'https://api.spotify.com/v1/albums/{}/tracks'
|
||||
headers = {
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36',
|
||||
'Accept': 'application/json',
|
||||
'Accept-Language': 'en-US,en;q=0.9',
|
||||
'Accept-Encoding': 'gzip, deflate, br',
|
||||
'sec-ch-ua-platform': '"Windows"',
|
||||
'sec-fetch-dest': 'empty',
|
||||
'sec-fetch-mode': 'cors',
|
||||
'sec-fetch-site': 'same-origin',
|
||||
'Referer': 'https://open.spotify.com/',
|
||||
'Origin': 'https://open.spotify.com'
|
||||
}
|
||||
|
||||
|
||||
class SpotifyInvalidUrlException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class SpotifyWebsiteParserException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
def get_secrets() -> Tuple[int, list[int]]:
|
||||
# please read https://github.com/librespot-org/librespot/discussions/1562#discussioncomment-14659870
|
||||
# sudo docker run --rm misiektoja/spotify-secrets-grabber --secretbytes
|
||||
return ("61", [44, 55, 47, 42, 70, 40, 34, 114, 76, 74, 50, 111, 120, 97, 75, 76, 94, 102, 43, 69, 49, 120, 118, 80, 64, 78])
|
||||
|
||||
|
||||
def generate_totp(
|
||||
timestamp_seconds: int,
|
||||
secret: bytes,
|
||||
) -> str:
|
||||
|
||||
transformed = [e ^ ((t % 33) + 9) for t, e in enumerate(secret)]
|
||||
joined = "".join(str(num) for num in transformed)
|
||||
hex_str = joined.encode().hex()
|
||||
secret32 = base64.b32encode(bytes.fromhex(hex_str)).decode().rstrip("=")
|
||||
return pyotp.TOTP(secret32, digits=6, interval=30).at(timestamp_seconds)
|
||||
|
||||
|
||||
def get_server_time() -> int:
|
||||
response = requests.get(server_time_url)
|
||||
response.raise_for_status()
|
||||
return response.json()["serverTime"]
|
||||
|
||||
|
||||
def parse_uri(uri):
|
||||
u = urlparse(uri)
|
||||
if u.netloc == "embed.spotify.com":
|
||||
if not u.query:
|
||||
raise SpotifyInvalidUrlException("ERROR: url {} is not supported".format(uri))
|
||||
|
||||
qs = parse_qs(u.query)
|
||||
return parse_uri(qs['uri'][0])
|
||||
|
||||
# backwards compatibility
|
||||
if not u.scheme and not u.netloc:
|
||||
return {"type": "playlist", "id": u.path}
|
||||
|
||||
if u.scheme == "spotify":
|
||||
parts = uri.split(":")
|
||||
else:
|
||||
if u.netloc != "open.spotify.com" and u.netloc != "play.spotify.com":
|
||||
raise SpotifyInvalidUrlException("ERROR: url {} is not supported".format(uri))
|
||||
|
||||
parts = u.path.split("/")
|
||||
|
||||
if parts[1] == "embed":
|
||||
parts = parts[1:]
|
||||
|
||||
l = len(parts)
|
||||
if l == 3 and parts[1] in ["album", "track", "playlist"]:
|
||||
return {"type": parts[1], "id": parts[2]}
|
||||
if l == 5 and parts[3] == "playlist":
|
||||
return {"type": parts[3], "id": parts[4]}
|
||||
|
||||
# todo add support for other types; artists, searches, users
|
||||
|
||||
raise SpotifyInvalidUrlException("ERROR: unable to determine Spotify URL type or type is unsupported.")
|
||||
|
||||
|
||||
def get_songs_from_spotify_website(playlist, proxy=None):
|
||||
# parses Spotify Playlist from Spotify website
|
||||
# playlist: playlist url or playlist id as string
|
||||
# proxy: https/socks5 proxy (e. g. socks5://user:pass@127.0.0.1:1080/)
|
||||
# e.g. https://open.spotify.com/playlist/0wl9Q3oedquNlBAJ4MGZtS
|
||||
# e.g. https://open.spotify.com/embed/0wl9Q3oedquNlBAJ4MGZtS
|
||||
# e.g. 0wl9Q3oedquNlBAJ4MGZtS
|
||||
# return: list of songs (song: artist - title)
|
||||
# raises SpotifyWebsiteParserException if parsing the website goes wrong
|
||||
|
||||
return_data = []
|
||||
url_info = parse_uri(playlist)
|
||||
|
||||
timestamp = get_server_time()
|
||||
version, secret_string = get_secrets()
|
||||
|
||||
totp = generate_totp(timestamp, secret_string)
|
||||
params = {
|
||||
"reason": "init",
|
||||
"productType": "web-player",
|
||||
"totp": totp,
|
||||
"totpVer": version,
|
||||
"ts": timestamp,
|
||||
}
|
||||
req = requests.get(token_url, headers=headers, params=params, proxies={"https": proxy})
|
||||
if req.status_code != 200:
|
||||
raise SpotifyWebsiteParserException(
|
||||
"ERROR: {} gave us not a 200 (version {}, totp {}). Instead: {}".format(token_url, version, totp, req.status_code))
|
||||
token = req.json()
|
||||
|
||||
if url_info['type'] == "playlist":
|
||||
url = playlist_base_url.format(url_info["id"])
|
||||
|
||||
while True:
|
||||
resp = get_json_from_api(url, token["accessToken"], proxy)
|
||||
if resp is None: # try again in case of rate limit
|
||||
resp = get_json_from_api(url, token["accessToken"], proxy)
|
||||
if resp is None:
|
||||
break
|
||||
|
||||
for track in resp['items']:
|
||||
return_data.append(parse_track(track["track"]))
|
||||
|
||||
if resp['next'] is None:
|
||||
break
|
||||
url = resp['next']
|
||||
elif url_info["type"] == "track":
|
||||
resp = get_json_from_api(track_base_url.format(url_info["id"]), token["accessToken"], proxy)
|
||||
if resp is None: # try again in case of rate limit
|
||||
resp = get_json_from_api(track_base_url.format(url_info["id"]), token["accessToken"], proxy)
|
||||
|
||||
return_data.append(parse_track(resp))
|
||||
elif url_info["type"] == "album":
|
||||
resp = get_json_from_api(album_base_url.format(url_info["id"]), token["accessToken"], proxy)
|
||||
if resp is None: # try again in case of rate limit
|
||||
resp = get_json_from_api(album_base_url.format(url_info["id"]), token["accessToken"], proxy)
|
||||
|
||||
for track in resp['items']:
|
||||
return_data.append(parse_track(track))
|
||||
|
||||
return [track for track in return_data if track]
|
||||
|
||||
|
||||
def parse_track(track):
|
||||
artist = track['artists'][0]['name']
|
||||
song = track['name']
|
||||
full = "{} {}".format(artist, song)
|
||||
# remove everything in brackets to get better search results later on Deezer
|
||||
# e.g. (Radio Version) or (Remastered)
|
||||
return re.sub(r'\([^)]*\)', '', full)
|
||||
|
||||
|
||||
def get_json_from_api(api_url, access_token, proxy):
|
||||
headers.update({'Authorization': 'Bearer {}'.format(access_token)})
|
||||
req = requests.get(api_url, headers=headers, proxies={"https": proxy}, timeout=10)
|
||||
if req.status_code == 429:
|
||||
seconds = int(req.headers.get("Retry-After", "5")) + 1
|
||||
print("INFO: rate limited! Sleeping for {} seconds".format(seconds))
|
||||
sleep(seconds)
|
||||
return None
|
||||
|
||||
if req.status_code != 200:
|
||||
raise SpotifyWebsiteParserException("ERROR: {} gave us not a 200. Instead: {}".format(api_url, req.status_code))
|
||||
return req.json()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
# playlist = "21wZXvtrERELL0bVtKtuUh"
|
||||
#playlist = "0wl9Q3oedquNlBAJ4MGZtS"
|
||||
playlist = "76bsnIYWIZOCjCpSJB876p"
|
||||
#album = "spotify:album:7zCODUHkfuRxsUjtuzNqbd"
|
||||
#song = "https://open.spotify.com/track/6piFKF6WvM6ZZLmi2Vz8Vt"
|
||||
#print(get_songs_from_spotify_website(playlist))
|
||||
print(get_songs_from_spotify_website(playlist))
|
||||
100
deezer_downloader/threadpool_queue.py
Normal file
@@ -0,0 +1,100 @@
|
||||
import threading
|
||||
import time
|
||||
from queue import Queue
|
||||
import traceback
|
||||
|
||||
local_obj = threading.local()
|
||||
|
||||
|
||||
class ThreadpoolScheduler:
|
||||
|
||||
def __init__(self):
|
||||
self.task_queue = Queue() # threadsafe queue where we put/get QueuedTask objects
|
||||
self.worker_threads = [] # list of WorkerThread objects
|
||||
|
||||
# self.commands: {'function_name': function_pointer_to_the_function}
|
||||
# {'download_deezer_song_and_queue': <function download_deezer_song_and_queue at 0x7ff81d739280>}
|
||||
self.commands = {}
|
||||
|
||||
# list of all QueuedTask objects we processed during runtime (used by /queue)
|
||||
self.all_tasks = []
|
||||
|
||||
def run_workers(self, num_workers):
|
||||
for i in range(num_workers):
|
||||
t = WorkerThread(i, self.task_queue)
|
||||
t.start()
|
||||
self.worker_threads.append(t)
|
||||
|
||||
def enqueue_task(self, description, command, **kwargs):
|
||||
q = QueuedTask(description, command, self.commands[command], **kwargs)
|
||||
self.task_queue.put(q)
|
||||
self.all_tasks.append(q)
|
||||
return q
|
||||
|
||||
def register_command(self):
|
||||
def decorator(fun):
|
||||
self.commands[fun.__name__] = fun
|
||||
return fun
|
||||
return decorator
|
||||
|
||||
def stop_workers(self):
|
||||
for i in range(len(self.worker_threads)):
|
||||
self.task_queue.put(False)
|
||||
for worker in self.worker_threads:
|
||||
worker.join()
|
||||
# print("All workers stopped")
|
||||
|
||||
|
||||
class WorkerThread(threading.Thread):
|
||||
|
||||
def __init__(self, index, task_queue):
|
||||
super().__init__(daemon=True)
|
||||
self.index = index # just an id per Worker
|
||||
self.task_queue = task_queue # shared between all WorkerThreads
|
||||
|
||||
def run(self):
|
||||
while True:
|
||||
# print(f"Worker {self.index} is waiting for a task")
|
||||
task = self.task_queue.get(block=True)
|
||||
if not task:
|
||||
# print(f"Worker {self.index} is exiting")
|
||||
return
|
||||
# print(f"Worker {self.index} is now working on task: {task.kwargs}")
|
||||
task.state = "active"
|
||||
self.ts_started = time.time()
|
||||
task.worker_index = self.index
|
||||
local_obj.current_task = task
|
||||
try:
|
||||
task.result = task.exec()
|
||||
task.state = "mission accomplished"
|
||||
except Exception as ex:
|
||||
print(traceback.format_exc())
|
||||
print(f"Task {task.fn_name} failed with parameters '{task.kwargs}'\nReason: {ex}")
|
||||
task.state = "failed"
|
||||
task.exception = ex
|
||||
self.ts_finished = time.time()
|
||||
# print(f"worker {self.index} is done with task: {task.kwargs} (state={task.state})")
|
||||
|
||||
|
||||
class QueuedTask:
|
||||
def __init__(self, description, fn_name, fn, **kwargs):
|
||||
self.description = description
|
||||
self.fn_name = fn_name
|
||||
self.fn = fn
|
||||
self.kwargs = kwargs
|
||||
self.state = "waiting"
|
||||
self.exception = None
|
||||
self.result = None
|
||||
self.progress = 0
|
||||
self.progress_maximum = 0
|
||||
self.ts_queued = time.time()
|
||||
self.ts_started = 0
|
||||
self.ts_finished = 0
|
||||
|
||||
def exec(self):
|
||||
return self.fn(**self.kwargs)
|
||||
|
||||
|
||||
def report_progress(value, maximum):
|
||||
local_obj.current_task.progress = value
|
||||
local_obj.current_task.progress_maximum = maximum
|
||||
263
deezer_downloader/web/app.py
Normal file
@@ -0,0 +1,263 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
from subprocess import Popen, PIPE
|
||||
from functools import wraps
|
||||
import requests
|
||||
import atexit
|
||||
from flask import Flask, render_template, request, jsonify
|
||||
from markupsafe import escape
|
||||
from flask_autoindex import AutoIndex
|
||||
import warnings
|
||||
import giphypop
|
||||
|
||||
from deezer_downloader.configuration import config
|
||||
from deezer_downloader.web.music_backend import sched
|
||||
from deezer_downloader.deezer import deezer_search, init_deezer_session
|
||||
|
||||
app = Flask(__name__)
|
||||
auto_index = AutoIndex(app, config["download_dirs"]["base"], add_url_rules=False)
|
||||
auto_index.add_icon_rule('music.png', ext='m3u8')
|
||||
|
||||
warnings.filterwarnings("ignore", message="You are using the giphy public api key")
|
||||
giphy = giphypop.Giphy()
|
||||
|
||||
|
||||
def init():
|
||||
sched.run_workers(config.getint('threadpool', 'workers'))
|
||||
init_deezer_session(config['proxy']['server'],
|
||||
config['deezer']['quality'])
|
||||
|
||||
@atexit.register
|
||||
def stop_workers():
|
||||
sched.stop_workers()
|
||||
|
||||
|
||||
init()
|
||||
|
||||
|
||||
# user input validation
|
||||
def validate_schema(*parameters_to_check):
|
||||
def decorator(f):
|
||||
@wraps(f)
|
||||
def wrapper(*args, **kw):
|
||||
j = request.get_json(force=True)
|
||||
print("User request: {} with {}".format(request.path, j))
|
||||
# check if all parameters are supplied by the user
|
||||
if set(j.keys()) != set(parameters_to_check):
|
||||
return jsonify({"error": 'parameters missing, required fields: {}'.format(parameters_to_check)}), 400
|
||||
if "type" in j.keys():
|
||||
if j['type'] not in ["album", "track", "artist", "album_track", "artist_album", "artist_top"]:
|
||||
return jsonify({"error": "type must be album, track, artist, album_track, artist_album or artist_top"}), 400
|
||||
if "music_id" in j.keys():
|
||||
if type(j['music_id']) is not int:
|
||||
return jsonify({"error": "music_id must be a integer"}), 400
|
||||
if "add_to_playlist" in j.keys():
|
||||
if type(j['add_to_playlist']) is not bool:
|
||||
return jsonify({"error": "add_to_playlist must be a boolean"}), 400
|
||||
if "create_zip" in j.keys():
|
||||
if type(j['create_zip']) is not bool:
|
||||
return jsonify({"error": "create_zip must be a boolean"}), 400
|
||||
if "query" in j.keys():
|
||||
if type(j['query']) is not str:
|
||||
return jsonify({"error": "query is not a string"}), 400
|
||||
if j['query'] == "":
|
||||
return jsonify({"error": "query is empty"}), 400
|
||||
if "url" in j.keys():
|
||||
if (type(j['url']) is not str) or (not j['url'].startswith("http")):
|
||||
return jsonify({"error": "url is not a url. http... only"}), 400
|
||||
if "playlist_url" in j.keys():
|
||||
if type(j['playlist_url']) is not str:
|
||||
return jsonify({"error": "playlist_url is not a string"}), 400
|
||||
if len(j['playlist_url'].strip()) == 0:
|
||||
return jsonify({"error": "playlist_url is empty"}), 400
|
||||
if "playlist_name" in j.keys():
|
||||
if type(j['playlist_name']) is not str:
|
||||
return jsonify({"error": "playlist_name is not a string"}), 400
|
||||
if len(j['playlist_name'].strip()) == 0:
|
||||
return jsonify({"error": "playlist_name is empty"}), 400
|
||||
if "user_id" in j.keys():
|
||||
if type(j['user_id']) is not str or not j['user_id'].isnumeric():
|
||||
return jsonify({"error": "user_id must be a numeric string"}), 400
|
||||
return f(*args, **kw)
|
||||
return wrapper
|
||||
return decorator
|
||||
|
||||
|
||||
@app.route("/")
|
||||
def index():
|
||||
return render_template("index.html",
|
||||
api_root=config["http"]["api_root"],
|
||||
static_root=config["http"]["static_root"],
|
||||
use_mpd=str(config['mpd'].getboolean('use_mpd')).lower())
|
||||
|
||||
|
||||
@app.route("/debug")
|
||||
def show_debug():
|
||||
if "LOG_FILE" in os.environ:
|
||||
# check env LOG_FILE in Dockerfile
|
||||
# overwriting config value when using Docker
|
||||
cmd = f"tail -n 100 {os.environ['LOG_FILE']}"
|
||||
else:
|
||||
cmd = config["debug"]["command"]
|
||||
p = Popen(cmd, shell=True, stdout=PIPE)
|
||||
p.wait()
|
||||
stdout, __ = p.communicate()
|
||||
return jsonify({'debug_msg': stdout.decode()})
|
||||
|
||||
|
||||
@app.route("/downloads/")
|
||||
@app.route("/downloads/<path:path>")
|
||||
def autoindex(path="."):
|
||||
# directory index - flask version (let the user download mp3/zip in the browser)
|
||||
try:
|
||||
gif = giphy.random_gif(tag="cat")
|
||||
media_url = gif.media_url
|
||||
except requests.exceptions.HTTPError:
|
||||
# the api is rate-limited. Fallback:
|
||||
media_url = "https://cataas.com/cat"
|
||||
|
||||
template_context = {'gif_url': media_url}
|
||||
return auto_index.render_autoindex(path, template_context=template_context)
|
||||
|
||||
|
||||
@app.route('/queue', methods=['GET'])
|
||||
def show_queue():
|
||||
"""
|
||||
shows queued tasks
|
||||
return:
|
||||
json: [ { tasks } ]
|
||||
"""
|
||||
results = [
|
||||
{'id': id(task),
|
||||
'description': escape(task.description),
|
||||
#'command': task.fn_name,
|
||||
'args': escape(task.kwargs),
|
||||
'state': escape(task.state),
|
||||
'result': escape(task.result),
|
||||
'exception': escape(str(task.exception)),
|
||||
'progress': [task.progress, task.progress_maximum]
|
||||
} for task in sched.all_tasks
|
||||
]
|
||||
return jsonify(results)
|
||||
|
||||
|
||||
@app.route('/search', methods=['POST'])
|
||||
@validate_schema("type", "query")
|
||||
def search():
|
||||
"""
|
||||
searches for available music in the Deezer library
|
||||
para:
|
||||
type: track|album|album_track
|
||||
query: search query
|
||||
return:
|
||||
json: [ { artist, id, (title|album) } ]
|
||||
"""
|
||||
user_input = request.get_json(force=True)
|
||||
results = deezer_search(user_input['query'], user_input['type'])
|
||||
return jsonify(results)
|
||||
|
||||
|
||||
@app.route('/download', methods=['POST'])
|
||||
@validate_schema("type", "music_id", "add_to_playlist", "create_zip")
|
||||
def deezer_download_song_or_album():
|
||||
"""
|
||||
downloads a song or an album from Deezer to the dir specified in settings.py
|
||||
para:
|
||||
type: album|track
|
||||
music_id: id of the album or track (int)
|
||||
add_to_playlist: True|False (add to mpd playlist)
|
||||
create_zip: True|False (create a zip for the album)
|
||||
"""
|
||||
user_input = request.get_json(force=True)
|
||||
desc = "Downloading {}".format(user_input['type'])
|
||||
if user_input['type'] == "track":
|
||||
task = sched.enqueue_task(desc, "download_deezer_song_and_queue",
|
||||
track_id=user_input['music_id'],
|
||||
add_to_playlist=user_input['add_to_playlist'])
|
||||
else:
|
||||
task = sched.enqueue_task(desc, "download_deezer_album_and_queue_and_zip",
|
||||
album_id=user_input['music_id'],
|
||||
add_to_playlist=user_input['add_to_playlist'],
|
||||
create_zip=user_input['create_zip'])
|
||||
return jsonify({"task_id": id(task), })
|
||||
|
||||
|
||||
@app.route('/youtubedl', methods=['POST'])
|
||||
@validate_schema("url", "add_to_playlist")
|
||||
def youtubedl_download():
|
||||
"""
|
||||
takes an url and tries to download it via youtuble-dl
|
||||
para:
|
||||
url: link to youtube (or something youtube-dl supports)
|
||||
add_to_playlist: True|False (add to mpd playlist)
|
||||
"""
|
||||
user_input = request.get_json(force=True)
|
||||
desc = "Downloading via youtube-dl"
|
||||
task = sched.enqueue_task(desc, "download_youtubedl_and_queue",
|
||||
video_url=user_input['url'],
|
||||
add_to_playlist=user_input['add_to_playlist'])
|
||||
return jsonify({"task_id": id(task), })
|
||||
|
||||
|
||||
@app.route('/playlist/deezer', methods=['POST'])
|
||||
@validate_schema("playlist_url", "add_to_playlist", "create_zip")
|
||||
def deezer_playlist_download():
|
||||
"""
|
||||
downloads songs of a public Deezer playlist.
|
||||
A directory with the name of the playlist will be created.
|
||||
para:
|
||||
playlist_url: link to a public Deezer playlist (the id of the playlist works too)
|
||||
add_to_playlist: True|False (add to mpd playlist)
|
||||
create_zip: True|False (create a zip for the playlist)
|
||||
"""
|
||||
user_input = request.get_json(force=True)
|
||||
desc = "Downloading Deezer playlist"
|
||||
task = sched.enqueue_task(desc, "download_deezer_playlist_and_queue_and_zip",
|
||||
playlist_id=user_input['playlist_url'],
|
||||
add_to_playlist=user_input['add_to_playlist'],
|
||||
create_zip=user_input['create_zip'])
|
||||
return jsonify({"task_id": id(task), })
|
||||
|
||||
|
||||
@app.route('/playlist/spotify', methods=['POST'])
|
||||
@validate_schema("playlist_name", "playlist_url", "add_to_playlist", "create_zip")
|
||||
def spotify_playlist_download():
|
||||
"""
|
||||
1. /GET and parse the Spotify playlist (html)
|
||||
2. search every single song on Deezer. Use the first hit
|
||||
3. download the song from Deezer
|
||||
para:
|
||||
playlist_name: name of the playlist (used for the subfolder)
|
||||
playlist_url: link to Spotify playlist or just the id of it
|
||||
add_to_playlist: True|False (add to mpd playlist)
|
||||
create_zip: True|False (create a zip for the playlist)
|
||||
"""
|
||||
user_input = request.get_json(force=True)
|
||||
desc = "Downloading Spotify playlist"
|
||||
task = sched.enqueue_task(desc, "download_spotify_playlist_and_queue_and_zip",
|
||||
playlist_name=user_input['playlist_name'],
|
||||
playlist_id=user_input['playlist_url'],
|
||||
add_to_playlist=user_input['add_to_playlist'],
|
||||
create_zip=user_input['create_zip'])
|
||||
return jsonify({"task_id": id(task), })
|
||||
|
||||
|
||||
@app.route('/favorites/deezer', methods=['POST'])
|
||||
@validate_schema("user_id", "add_to_playlist", "create_zip")
|
||||
def deezer_favorites_download():
|
||||
"""
|
||||
downloads favorite songs of a Deezer user (looks like this in the brwoser:
|
||||
https://www.deezer.com/us/profile/%%user_id%%/loved)
|
||||
a subdirecotry with the name of the user_id will be created.
|
||||
para:
|
||||
user_id: deezer user_id
|
||||
add_to_playlist: True|False (add to mpd playlist)
|
||||
create_zip: True|False (create a zip for the playlist)
|
||||
"""
|
||||
user_input = request.get_json(force=True)
|
||||
desc = "Downloading Deezer favorites"
|
||||
task = sched.enqueue_task(desc, "download_deezer_favorites",
|
||||
user_id=user_input['user_id'],
|
||||
add_to_playlist=user_input['add_to_playlist'],
|
||||
create_zip=user_input['create_zip'])
|
||||
return jsonify({"task_id": id(task), })
|
||||
256
deezer_downloader/web/music_backend.py
Normal file
@@ -0,0 +1,256 @@
|
||||
import time
|
||||
import os.path
|
||||
from os.path import basename
|
||||
import mpd
|
||||
import platform
|
||||
from zipfile import ZipFile, ZIP_DEFLATED
|
||||
|
||||
from deezer_downloader.configuration import config
|
||||
from deezer_downloader.youtubedl import youtubedl_download
|
||||
from deezer_downloader.spotify import get_songs_from_spotify_website
|
||||
from deezer_downloader.deezer import TYPE_TRACK, TYPE_ALBUM, TYPE_PLAYLIST, get_song_infos_from_deezer_website, download_song, parse_deezer_playlist, deezer_search, get_deezer_favorites
|
||||
from deezer_downloader.deezer import Deezer403Exception, Deezer404Exception, DeezerApiException
|
||||
from deezer_downloader.deezer import get_file_extension
|
||||
|
||||
from deezer_downloader.threadpool_queue import ThreadpoolScheduler, report_progress
|
||||
sched = ThreadpoolScheduler()
|
||||
|
||||
|
||||
def check_download_dirs_exist():
|
||||
for directory in [config["download_dirs"]["songs"], config["download_dirs"]["zips"], config["download_dirs"]["albums"],
|
||||
config["download_dirs"]["playlists"], config["download_dirs"]["youtubedl"]]:
|
||||
os.makedirs(directory, exist_ok=True)
|
||||
|
||||
|
||||
check_download_dirs_exist()
|
||||
|
||||
|
||||
def make_song_paths_relative_to_mpd_root(songs, prefix=""):
|
||||
# ensure last slash
|
||||
config["mpd"]["music_dir_root"] = os.path.join(config["mpd"]["music_dir_root"], '')
|
||||
songs_paths_relative_to_mpd_root = []
|
||||
for song in songs:
|
||||
songs_paths_relative_to_mpd_root.append(prefix + song[len(config["mpd"]["music_dir_root"]):])
|
||||
return songs_paths_relative_to_mpd_root
|
||||
|
||||
|
||||
def update_mpd_db(songs, add_to_playlist):
|
||||
# songs: list of music files or just a string (file path)
|
||||
if not config["mpd"].getboolean("use_mpd"):
|
||||
return
|
||||
print("Updating mpd database")
|
||||
timeout_counter = 0
|
||||
mpd_client = mpd.MPDClient(use_unicode=True)
|
||||
try:
|
||||
mpd_client.connect(config["mpd"]["host"], config["mpd"].getint("port"))
|
||||
except ConnectionRefusedError as e:
|
||||
print("ERROR connecting to MPD ({}:{}): {}".format(config["mpd"]["host"], config["mpd"]["port"], e))
|
||||
return
|
||||
mpd_client.update()
|
||||
if add_to_playlist:
|
||||
songs = [songs] if type(songs) is not list else songs
|
||||
songs = make_song_paths_relative_to_mpd_root(songs)
|
||||
while len(mpd_client.search("file", songs[0])) == 0:
|
||||
# c.update() does not block so wait for it
|
||||
if timeout_counter == 10:
|
||||
print("Tried it {} times. Give up now.".format(timeout_counter))
|
||||
return
|
||||
print("'{}' not found in the music db. Let's wait for it".format(songs[0]))
|
||||
timeout_counter += 1
|
||||
time.sleep(2)
|
||||
for song in songs:
|
||||
try:
|
||||
mpd_client.add(song)
|
||||
print("Added to mpd playlist: '{}'".format(song))
|
||||
except mpd.base.CommandError as mpd_error:
|
||||
print("ERROR adding '{}' to playlist: {}".format(song, mpd_error))
|
||||
|
||||
|
||||
def clean_filename(path):
|
||||
path = path.replace("\t", " ")
|
||||
if any(platform.win32_ver()):
|
||||
path.replace("\"", "'")
|
||||
array_of_special_characters = ['<', '>', ':', '"', '/', '\\', '|', '?', '*']
|
||||
else:
|
||||
array_of_special_characters = ['/', ':', '"', '?']
|
||||
|
||||
return ''.join([c for c in path if c not in array_of_special_characters])
|
||||
|
||||
|
||||
def download_song_and_get_absolute_filename(search_type, song, playlist_name=None):
|
||||
|
||||
file_extension = get_file_extension()
|
||||
if search_type == TYPE_ALBUM:
|
||||
song_filename = "{:02d} - {} {}.{}".format(int(song['TRACK_NUMBER']),
|
||||
song['ART_NAME'],
|
||||
song['SNG_TITLE'],
|
||||
file_extension)
|
||||
else:
|
||||
song_filename = "{} - {}.{}".format(song['ART_NAME'],
|
||||
song['SNG_TITLE'],
|
||||
file_extension)
|
||||
song_filename = clean_filename(song_filename)
|
||||
|
||||
if search_type == TYPE_TRACK:
|
||||
absolute_filename = os.path.join(config["download_dirs"]["songs"], song_filename)
|
||||
elif search_type == TYPE_ALBUM:
|
||||
album_name = "{} - {}".format(song['ART_NAME'], song['ALB_TITLE'])
|
||||
album_name = clean_filename(album_name)
|
||||
album_dir = os.path.join(config["download_dirs"]["albums"], album_name)
|
||||
if not os.path.exists(album_dir):
|
||||
os.mkdir(album_dir)
|
||||
absolute_filename = os.path.join(album_dir, song_filename)
|
||||
elif search_type == TYPE_PLAYLIST:
|
||||
assert type(playlist_name) is str
|
||||
playlist_name = clean_filename(playlist_name)
|
||||
playlist_dir = os.path.join(config["download_dirs"]["playlists"], playlist_name)
|
||||
if not os.path.exists(playlist_dir):
|
||||
os.mkdir(playlist_dir)
|
||||
absolute_filename = os.path.join(playlist_dir, song_filename)
|
||||
|
||||
if os.path.exists(absolute_filename):
|
||||
print("Skipping song '{}'. Already exists.".format(absolute_filename))
|
||||
else:
|
||||
print("Downloading '{}'".format(song_filename))
|
||||
download_song(song, absolute_filename)
|
||||
return absolute_filename
|
||||
|
||||
|
||||
def create_zip_file(songs_absolute_location):
|
||||
# take first song in list and take the parent dir (name of album/playlist")
|
||||
parent_dir = basename(os.path.dirname(songs_absolute_location[0]))
|
||||
location_zip_file = os.path.join(config["download_dirs"]["zips"], "{}.zip".format(parent_dir))
|
||||
print("Creating zip file '{}'".format(location_zip_file))
|
||||
with ZipFile(location_zip_file, 'w', compression=ZIP_DEFLATED) as zip:
|
||||
for song_location in songs_absolute_location:
|
||||
try:
|
||||
print("Adding song {}".format(song_location))
|
||||
zip.write(song_location, arcname=os.path.join(parent_dir, basename(song_location)))
|
||||
except FileNotFoundError:
|
||||
print("Could not find file '{}'".format(song_location))
|
||||
print("Done with the zip")
|
||||
return location_zip_file
|
||||
|
||||
|
||||
def create_m3u8_file(songs_absolute_location):
|
||||
playlist_directory, __ = os.path.split(songs_absolute_location[0])
|
||||
# 00 as prefix => will be shown as first in dir listing
|
||||
m3u8_filename = "00 {}.m3u8".format(os.path.basename(playlist_directory))
|
||||
print("Creating m3u8 file: '{}'".format(m3u8_filename))
|
||||
m3u8_file_abs = os.path.join(playlist_directory, m3u8_filename)
|
||||
with open(m3u8_file_abs, "w", encoding="utf-8") as f:
|
||||
for song in songs_absolute_location:
|
||||
if os.path.exists(song):
|
||||
f.write(basename(song) + "\n")
|
||||
# add m3u8_file so that will be zipped to
|
||||
songs_absolute_location.append(m3u8_file_abs)
|
||||
return songs_absolute_location
|
||||
|
||||
|
||||
@sched.register_command()
|
||||
def download_deezer_song_and_queue(track_id, add_to_playlist):
|
||||
song = get_song_infos_from_deezer_website(TYPE_TRACK, track_id)
|
||||
try:
|
||||
absolute_filename = download_song_and_get_absolute_filename(TYPE_TRACK, song)
|
||||
update_mpd_db(absolute_filename, add_to_playlist)
|
||||
return make_song_paths_relative_to_mpd_root([absolute_filename])
|
||||
except DeezerApiException:
|
||||
# warning is printed in download_song_and_get_absolute_filename
|
||||
pass
|
||||
|
||||
|
||||
@sched.register_command()
|
||||
def download_deezer_album_and_queue_and_zip(album_id, add_to_playlist, create_zip):
|
||||
songs = get_song_infos_from_deezer_website(TYPE_ALBUM, album_id)
|
||||
songs_absolute_location = []
|
||||
for i, song in enumerate(songs):
|
||||
report_progress(i, len(songs))
|
||||
assert type(song) is dict
|
||||
try:
|
||||
absolute_filename = download_song_and_get_absolute_filename(TYPE_ALBUM, song)
|
||||
songs_absolute_location.append(absolute_filename)
|
||||
except Exception as e:
|
||||
print(f"Warning: {e}. Continuing with album...")
|
||||
update_mpd_db(songs_absolute_location, add_to_playlist)
|
||||
if create_zip:
|
||||
return [create_zip_file(songs_absolute_location)]
|
||||
return make_song_paths_relative_to_mpd_root(songs_absolute_location)
|
||||
|
||||
|
||||
@sched.register_command()
|
||||
def download_deezer_playlist_and_queue_and_zip(playlist_id, add_to_playlist, create_zip):
|
||||
playlist_name, songs = parse_deezer_playlist(playlist_id)
|
||||
songs_absolute_location = []
|
||||
for i, song in enumerate(songs):
|
||||
report_progress(i, len(songs))
|
||||
try:
|
||||
absolute_filename = download_song_and_get_absolute_filename(TYPE_PLAYLIST, song, playlist_name)
|
||||
songs_absolute_location.append(absolute_filename)
|
||||
except Exception as e:
|
||||
print(f"Warning: {e}. Continuing with playlist...")
|
||||
update_mpd_db(songs_absolute_location, add_to_playlist)
|
||||
songs_with_m3u8_file = create_m3u8_file(songs_absolute_location)
|
||||
if create_zip:
|
||||
return [create_zip_file(songs_with_m3u8_file)]
|
||||
return make_song_paths_relative_to_mpd_root(songs_absolute_location)
|
||||
|
||||
|
||||
@sched.register_command()
|
||||
def download_spotify_playlist_and_queue_and_zip(playlist_name, playlist_id, add_to_playlist, create_zip):
|
||||
songs = get_songs_from_spotify_website(playlist_id,
|
||||
config["proxy"]["server"])
|
||||
songs_absolute_location = []
|
||||
print(f"We got {len(songs)} songs from the Spotify playlist")
|
||||
for i, song_of_playlist in enumerate(songs):
|
||||
report_progress(i, len(songs))
|
||||
# song_of_playlist: string (artist - song)
|
||||
try:
|
||||
track_id = deezer_search(song_of_playlist, TYPE_TRACK)[0]['id'] #[0] can throw IndexError
|
||||
song = get_song_infos_from_deezer_website(TYPE_TRACK, track_id)
|
||||
absolute_filename = download_song_and_get_absolute_filename(TYPE_PLAYLIST, song, playlist_name)
|
||||
songs_absolute_location.append(absolute_filename)
|
||||
except Exception as e:
|
||||
print(f"Warning: Could not download Spotify song ({song_of_playlist}) on Deezer: {e}")
|
||||
update_mpd_db(songs_absolute_location, add_to_playlist)
|
||||
songs_with_m3u8_file = create_m3u8_file(songs_absolute_location)
|
||||
if create_zip:
|
||||
return [create_zip_file(songs_with_m3u8_file)]
|
||||
return make_song_paths_relative_to_mpd_root(songs_absolute_location)
|
||||
|
||||
|
||||
@sched.register_command()
|
||||
def download_youtubedl_and_queue(video_url, add_to_playlist):
|
||||
filename_absolute = youtubedl_download(video_url,
|
||||
config["download_dirs"]["youtubedl"],
|
||||
config["proxy"]["server"])
|
||||
update_mpd_db(filename_absolute, add_to_playlist)
|
||||
return make_song_paths_relative_to_mpd_root([filename_absolute])
|
||||
|
||||
|
||||
@sched.register_command()
|
||||
def download_deezer_favorites(user_id: str, add_to_playlist: bool, create_zip: bool):
|
||||
songs_absolute_location = []
|
||||
output_directory = f"favorites_{user_id}"
|
||||
favorite_songs = get_deezer_favorites(user_id)
|
||||
for i, fav_song in enumerate(favorite_songs):
|
||||
report_progress(i, len(favorite_songs))
|
||||
try:
|
||||
song = get_song_infos_from_deezer_website(TYPE_TRACK, fav_song)
|
||||
try:
|
||||
absolute_filename = download_song_and_get_absolute_filename(TYPE_PLAYLIST, song, output_directory)
|
||||
songs_absolute_location.append(absolute_filename)
|
||||
except Exception as e:
|
||||
print(f"Warning: {e}. Continuing with favorties...")
|
||||
except (IndexError, Deezer403Exception, Deezer404Exception) as msg:
|
||||
print(msg)
|
||||
print(f"Could not find song ({fav_song}) on Deezer?")
|
||||
update_mpd_db(songs_absolute_location, add_to_playlist)
|
||||
songs_with_m3u8_file = create_m3u8_file(songs_absolute_location)
|
||||
if create_zip:
|
||||
return [create_zip_file(songs_with_m3u8_file)]
|
||||
return make_song_paths_relative_to_mpd_root(songs_absolute_location)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
pass
|
||||
#download_spotify_playlist_and_queue_and_zip("test", '21wZXvtrERELL0bVtKtuUh', False, False)
|
||||
BIN
deezer_downloader/web/static/css/bootstrap-4.1.3-dist.zip
Normal file
7
deezer_downloader/web/static/css/bootstrap.bundle.min.js
vendored
Normal file
7
deezer_downloader/web/static/css/bootstrap.min.css
vendored
Normal file
47
deezer_downloader/web/static/css/custom.css
Normal file
@@ -0,0 +1,47 @@
|
||||
.search-container {
|
||||
display: flex;
|
||||
height: 38px;
|
||||
border: 1px solid #ced4da;
|
||||
border-radius: 7px;
|
||||
padding: 0 8px;
|
||||
}
|
||||
|
||||
input.search {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
font-size: 14px;
|
||||
border: none;
|
||||
outline: none;
|
||||
background-color: transparent;
|
||||
color: #495057;
|
||||
}
|
||||
|
||||
button.search {
|
||||
height: 100%;
|
||||
color: #495057;
|
||||
font-size: 14px;
|
||||
border: none;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.tabs-category {
|
||||
display: flex;
|
||||
/* border-bottom: 1px solid #ced4da; */
|
||||
}
|
||||
|
||||
.btn-category {
|
||||
margin-top: 10px;
|
||||
padding: 8px 16px;
|
||||
border: none;
|
||||
border-bottom: 3px solid transparent;
|
||||
background-color: transparent;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
color: #6a6a6a;
|
||||
outline: none !important;
|
||||
}
|
||||
|
||||
.btn-category.active {
|
||||
border-bottom: 3px solid #242424;
|
||||
color: #242424;
|
||||
}
|
||||
4
deezer_downloader/web/static/css/font-awesome.min.css
vendored
Normal file
1
deezer_downloader/web/static/css/jquery.jgrowl.min.css
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.jGrowl{z-index:9999;color:#fff;font-size:12px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;position:fixed}.jGrowl.top-left{left:0;top:0}.jGrowl.top-right{right:0;top:0}.jGrowl.bottom-left{left:0;bottom:0}.jGrowl.bottom-right{right:0;bottom:0}.jGrowl.center{top:0;width:50%;left:25%}.jGrowl.center .jGrowl-closer,.jGrowl.center .jGrowl-notification{margin-left:auto;margin-right:auto}.jGrowl-notification{background-color:#000;opacity:.9;-ms-filter:alpha(90);filter:alpha(90);zoom:1;width:250px;padding:10px;margin:10px;text-align:left;display:none;border-radius:5px;min-height:40px}.jGrowl-notification .ui-state-highlight,.jGrowl-notification .ui-widget-content .ui-state-highlight,.jGrowl-notification .ui-widget-header .ui-state-highlight{border:1px solid #000;background:#000;color:#fff}.jGrowl-notification .jGrowl-header{font-weight:700;font-size:.85em}.jGrowl-notification .jGrowl-close{background-color:transparent;color:inherit;border:none;z-index:99;float:right;font-weight:700;font-size:1em;cursor:pointer}.jGrowl-closer{background-color:#000;opacity:.9;-ms-filter:alpha(90);filter:alpha(90);zoom:1;width:250px;padding:10px;margin:10px;display:none;border-radius:5px;padding-top:4px;padding-bottom:4px;cursor:pointer;font-size:.9em;font-weight:700;text-align:center}.jGrowl-closer .ui-state-highlight,.jGrowl-closer .ui-widget-content .ui-state-highlight,.jGrowl-closer .ui-widget-header .ui-state-highlight{border:1px solid #000;background:#000;color:#fff}@media print{.jGrowl{display:none}}
|
||||
BIN
deezer_downloader/web/static/favicon.ico
Normal file
|
After Width: | Height: | Size: 327 B |
BIN
deezer_downloader/web/static/fonts/fontawesome-webfont.woff2
Normal file
7
deezer_downloader/web/static/js/bootstrap.min.js
vendored
Normal file
358
deezer_downloader/web/static/js/custom.js
Normal file
@@ -0,0 +1,358 @@
|
||||
|
||||
function deezer_download(music_id, type, add_to_playlist, create_zip) {
|
||||
$.post(deezer_downloader_api_root + '/download',
|
||||
JSON.stringify({ type: type, music_id: parseInt(music_id), add_to_playlist: add_to_playlist, create_zip: create_zip}),
|
||||
function(data) {
|
||||
if(create_zip == true) {
|
||||
text = "You like being offline? You will get a zip file!";
|
||||
}
|
||||
else if(type == "album") {
|
||||
if(add_to_playlist == true) {
|
||||
text = "Good choice! The album will be downloaded and queued to the playlist";
|
||||
} else {
|
||||
text = "Good choice! The album will be downloaded.";
|
||||
}
|
||||
} else {
|
||||
if(add_to_playlist == true) {
|
||||
text = "Good choice! The song will be downloaded and queued to the playlist";
|
||||
} else {
|
||||
text = "Good choice! The song will be downloaded.";
|
||||
}
|
||||
}
|
||||
$.jGrowl(text, { life: 4000 });
|
||||
console.log(data);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function play_preview(src) {
|
||||
$("#audio_tag").attr("src", src)[0].play();
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
if(!show_mpd_features) {
|
||||
$("#yt_download_play").hide()
|
||||
$("#spotify_download_play").hide()
|
||||
$("#deezer_playlist_download_play").hide()
|
||||
$("#deezer_favorites_download_play").hide()
|
||||
};
|
||||
|
||||
|
||||
function youtubedl_download(add_to_playlist) {
|
||||
$.post(deezer_downloader_api_root + '/youtubedl',
|
||||
JSON.stringify({ url: $('#youtubedl-query').val(), add_to_playlist: add_to_playlist }),
|
||||
function(data) {
|
||||
console.log(data);
|
||||
$.jGrowl("As you wish", { life: 4000 });
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function spotify_playlist_download(add_to_playlist, create_zip) {
|
||||
$.post(deezer_downloader_api_root + '/playlist/spotify',
|
||||
JSON.stringify({ playlist_name: $('#spotify-playlist-name').val(),
|
||||
playlist_url: $('#spotify-playlist-url').val(),
|
||||
add_to_playlist: add_to_playlist,
|
||||
create_zip: create_zip}),
|
||||
function(data) {
|
||||
console.log(data);
|
||||
$.jGrowl("As you wish", { life: 4000 });
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
function deezer_playlist_download(add_to_playlist, create_zip) {
|
||||
$.post(deezer_downloader_api_root + '/playlist/deezer',
|
||||
JSON.stringify({ playlist_url: $('#deezer-playlist-url').val(),
|
||||
add_to_playlist: add_to_playlist,
|
||||
create_zip: create_zip}),
|
||||
function(data) {
|
||||
console.log(data);
|
||||
$.jGrowl("As you wish", { life: 4000 });
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function deezer_favorites_download(add_to_playlist, create_zip) {
|
||||
$.post(deezer_downloader_api_root + '/favorites/deezer',
|
||||
JSON.stringify({ user_id: $('#deezer-favorites-userid').val(),
|
||||
add_to_playlist: add_to_playlist,
|
||||
create_zip: create_zip}),
|
||||
function(data) {
|
||||
console.log(data);
|
||||
$.jGrowl("As you wish", { life: 4000 });
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function search(type) {
|
||||
const query = $('#songs-albums-query').val();
|
||||
if (!query.length) return ;
|
||||
deezer_load_list(type, query);
|
||||
}
|
||||
|
||||
function deezer_load_list(type, query) {
|
||||
$.post(deezer_downloader_api_root + '/search',
|
||||
JSON.stringify({ type: type, query: query.toString() }),
|
||||
function(data) {
|
||||
$("#results > tbody").html("");
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
drawTableEntry(data[i], type);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function drawTableEntry(rowData, mtype) {
|
||||
var row = $("<tr>");
|
||||
$("#results").append(row);
|
||||
var button_col = $("<td style='text-align: end'>");
|
||||
|
||||
if (mtype === "track" || mtype === "album_track" || mtype === "artist_top") {
|
||||
$("#col-title").show();
|
||||
$("#col-album").show();
|
||||
$("#col-artist").show();
|
||||
if (mtype !== "album_track") {
|
||||
$("#col-cover").show();
|
||||
row.append($("<td><img src='"+rowData.img_url+"' style='cursor: pointer; border-radius: 3px'></td>")
|
||||
.click(() => play_preview(rowData.preview_url)));
|
||||
} else {
|
||||
$("#col-cover").hide();
|
||||
}
|
||||
row.append($("<td>" + rowData.artist + "</td>"));
|
||||
row.append($("<td>" + rowData.title + "</td>"));
|
||||
row.append($("<td>" + rowData.album + "</td>"));
|
||||
if (rowData.preview_url) {
|
||||
button_col.append($('<button class="btn btn-default"> <i class="fa fa-headphones fa-lg" title="listen preview in browser" ></i> </button>')
|
||||
.click(() => play_preview(rowData.preview_url)));
|
||||
}
|
||||
} else if (mtype === "album" || mtype === "artist_album") {
|
||||
$("#col-cover").show();
|
||||
$("#col-title").hide();
|
||||
$("#col-album").show();
|
||||
$("#col-artist").show();
|
||||
row.append($("<td><img src='"+rowData.img_url+"' style='cursor: pointer; border-radius: 3px'></td>")
|
||||
.click(() => deezer_load_list("album_track", rowData.album_id)));
|
||||
row.append($("<td>" + rowData.artist + "</td>"));
|
||||
row.append($("<td>" + rowData.album + "</td>"));
|
||||
button_col.append($('<button class="btn btn-default"> <i class="fa fa-list fa-lg" title="list album songs" ></i> </button>')
|
||||
.click(() => deezer_load_list("album_track", rowData.album_id)));
|
||||
} else if (mtype === "artist") {
|
||||
$("#col-cover").show();
|
||||
$("#col-artist").show();
|
||||
$("#col-album").hide();
|
||||
$("#col-title").hide();
|
||||
row.append($("<td><img src='"+rowData.img_url+"' style='cursor: pointer; border-radius: 29px'></td>")
|
||||
.click(() => deezer_load_list("artist_album", rowData.artist_id)));
|
||||
row.append($("<td>" + rowData.artist + "</td>"));
|
||||
button_col.append($('<button class="btn btn-default"> <i class="fa fa-arrow-up fa-lg" title="list artist top songs" ></i> </button>')
|
||||
.click(() => deezer_load_list("artist_top", rowData.artist_id)));
|
||||
button_col.append($('<button class="btn btn-default"> <i class="fa fa-list fa-lg" title="list artist albums" ></i> </button>')
|
||||
.click(() => deezer_load_list("artist_album", rowData.artist_id)));
|
||||
}
|
||||
|
||||
|
||||
if (mtype !== "artist") {
|
||||
if (show_mpd_features) {
|
||||
button_col.append($('<button class="btn btn-default"> <i class="fa fa-play-circle fa-lg" title="download and queue to mpd" ></i> </button>')
|
||||
.click(() => deezer_download(rowData.id, rowData.id_type, true, false)));
|
||||
}
|
||||
button_col.append($('<button class="btn btn-default" > <i class="fa fa-download fa-lg" title="download" ></i> </button>')
|
||||
.click(() => deezer_download(rowData.id, rowData.id_type, false, false)));
|
||||
}
|
||||
|
||||
if(rowData.id_type == "album") {
|
||||
button_col.append($('<button class="btn btn-default"> <i class="fa fa-file-archive-o fa-lg" title="download as zip file" ></i> </button>')
|
||||
.click(() => deezer_download(rowData.id, rowData.id_type, false, true)));
|
||||
}
|
||||
row.append(button_col);
|
||||
}
|
||||
|
||||
function show_debug_log() {
|
||||
$.get(deezer_downloader_api_root + '/debug', function(data) {
|
||||
var debug_log_textarea = $("#ta-debug-log");
|
||||
debug_log_textarea.val(data.debug_msg);
|
||||
if(debug_log_textarea.length) {
|
||||
debug_log_textarea.scrollTop(debug_log_textarea[0].scrollHeight - debug_log_textarea.height());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function show_task_queue() {
|
||||
$.get(deezer_downloader_api_root + '/queue', function(data) {
|
||||
var queue_table = $("#task-list tbody");
|
||||
queue_table.html("");
|
||||
|
||||
for (var i = data.length - 1; i >= 0; i--) {
|
||||
var html="<tr><td>"+data[i].description+"</td><td>"+JSON.stringify(data[i].args)+"</td>"+
|
||||
"<td>"+data[i].state+"</td></tr>";
|
||||
$(html).appendTo(queue_table);
|
||||
switch (data[i].state) {
|
||||
case "active":
|
||||
$("<tr><td colspan=4><progress value="+data[i].progress[0]+" max="+data[i].progress[1]+" style='width:100%'/></td></tr>").appendTo(queue_table);
|
||||
case "failed":
|
||||
$("<tr><td colspan=4 style='color:red'>"+data[i].exception+"</td></tr>").appendTo(queue_table);
|
||||
}
|
||||
}
|
||||
if ($("#nav-task-queue").hasClass("active")) {
|
||||
setTimeout(show_task_queue, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
let search_type = "track";
|
||||
$("#search_deezer").click(function() {
|
||||
search(search_type);
|
||||
});
|
||||
|
||||
$("#deezer-search-track").click(function() {
|
||||
if (search_type == "track") return;
|
||||
search_type = "track";
|
||||
$("#deezer-search-track").addClass("active");
|
||||
$("#deezer-search-album").removeClass("active");
|
||||
$("#deezer-search-artist").removeClass("active");
|
||||
search(search_type);
|
||||
});
|
||||
|
||||
$("#deezer-search-album").click(function() {
|
||||
if (search_type == "album") return;
|
||||
search_type = "album";
|
||||
$("#deezer-search-album").addClass("active");
|
||||
$("#deezer-search-track").removeClass("active");
|
||||
$("#deezer-search-artist").removeClass("active");
|
||||
search(search_type);
|
||||
});
|
||||
|
||||
$("#deezer-search-artist").click(function() {
|
||||
if (search_type == "artist") return;
|
||||
search_type = "artist";
|
||||
$("#deezer-search-artist").addClass("active");
|
||||
$("#deezer-search-track").removeClass("active");
|
||||
$("#deezer-search-album").removeClass("active");
|
||||
search(search_type);
|
||||
});
|
||||
|
||||
|
||||
$("#yt_download").click(function() {
|
||||
youtubedl_download(false);
|
||||
});
|
||||
|
||||
$("#yt_download_play").click(function() {
|
||||
youtubedl_download(true);
|
||||
});
|
||||
|
||||
$("#nav-debug-log").click(function() {
|
||||
show_debug_log();
|
||||
});
|
||||
|
||||
$("#nav-task-queue").click(function() {
|
||||
show_task_queue();
|
||||
});
|
||||
|
||||
// BEGIN SPOTIFY
|
||||
$("#spotify_download_play").click(function() {
|
||||
spotify_playlist_download(true, false);
|
||||
});
|
||||
|
||||
$("#spotify_download").click(function() {
|
||||
spotify_playlist_download(false, false);
|
||||
});
|
||||
|
||||
$("#spotify_zip").click(function() {
|
||||
spotify_playlist_download(false, true);
|
||||
});
|
||||
// END SPOTIFY
|
||||
|
||||
|
||||
// BEGIN DEEZER PLAYLIST
|
||||
$("#deezer_playlist_download_play").click(function() {
|
||||
deezer_playlist_download(true, false);
|
||||
});
|
||||
|
||||
$("#deezer_playlist_download").click(function() {
|
||||
deezer_playlist_download(false, false);
|
||||
});
|
||||
|
||||
$("#deezer_playlist_zip").click(function() {
|
||||
deezer_playlist_download(false, true);
|
||||
});
|
||||
// END DEEZER PLAYLIST
|
||||
|
||||
// BEGIN DEEZER FAVORITE SONGS
|
||||
$("#deezer_favorites_download_play").click(function() {
|
||||
deezer_favorites_download(true, false);
|
||||
});
|
||||
|
||||
$("#deezer_favorites_download").click(function() {
|
||||
deezer_favorites_download(false, false);
|
||||
});
|
||||
|
||||
$("#deezer_favorites_zip").click(function() {
|
||||
deezer_favorites_download(false, true);
|
||||
});
|
||||
// END DEEZER FAVORITE SONGS
|
||||
|
||||
|
||||
function show_tab(id_nav, id_content) {
|
||||
// nav
|
||||
$(".nav-link").removeClass("active")
|
||||
//$("#btn-show-debug").addClass("active")
|
||||
$("#" + id_nav).addClass("active")
|
||||
|
||||
// content
|
||||
$(".container .tab-pane").removeClass("active show")
|
||||
//$("#youtubedl").addClass("active show")
|
||||
$("#" + id_content).addClass("active show")
|
||||
}
|
||||
|
||||
|
||||
var bbody = document.getElementById('body');
|
||||
bbody.onkeydown = function (event) {
|
||||
if (event.key !== undefined) {
|
||||
if (event.key === 'Enter' ) {
|
||||
search(search_type);
|
||||
} else if (event.key === 'm' && event.ctrlKey) {
|
||||
$("#songs-albums-query")[0].value = "";
|
||||
$("#songs-albums-query")[0].focus();
|
||||
}
|
||||
if (event.ctrlKey && event.shiftKey) {
|
||||
console.log("pressed ctrl + shift + ..");
|
||||
if(event.key === '!') {
|
||||
id_nav = "nav-songs-albums";
|
||||
id_content = "songs_albums";
|
||||
}
|
||||
if(event.key === '"') {
|
||||
id_nav = "nav-youtubedl";
|
||||
id_content = "youtubedl";
|
||||
}
|
||||
if(event.key === '§') {
|
||||
id_nav = "nav-spotify-playlists";
|
||||
id_content = "spotify-playlists";
|
||||
}
|
||||
if(event.key === '$') {
|
||||
id_nav = "nav-deezer-playlists";
|
||||
id_content = "deezer-playlists";
|
||||
}
|
||||
if(event.key === '%') {
|
||||
id_nav = "nav-songs-albums";
|
||||
id_content = "songs_albums";
|
||||
window.open('/downloads/', '_blank');
|
||||
}
|
||||
if(event.key === "&") {
|
||||
id_nav = "nav-debug-log";
|
||||
id_content = "debug";
|
||||
show_debug_log();
|
||||
}
|
||||
if(event.key === '/') {
|
||||
id_nav = "nav-task-queue";
|
||||
id_content = "queue";
|
||||
}
|
||||
if(typeof id_nav !== 'undefined') {
|
||||
show_tab(id_nav, id_content);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
});
|
||||
2
deezer_downloader/web/static/js/jquery.jgrowl.min.js
vendored
Normal file
2
deezer_downloader/web/static/js/jquery.min.js
vendored
Normal file
5
deezer_downloader/web/static/js/popper.min.js
vendored
Normal file
11
deezer_downloader/web/templates/autoindex.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{% extends '__autoindex__/autoindex.html' %}
|
||||
|
||||
|
||||
{% block footer %}
|
||||
<br>
|
||||
<div style="text-align: center" class="img-container">
|
||||
<img height=400px; src="{{ gif_url }}" />
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
241
deezer_downloader/web/templates/index.html
Normal file
@@ -0,0 +1,241 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Good Music - Good Feeling</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="{{ static_root }}/css/bootstrap.min.css">
|
||||
<script>
|
||||
window.deezer_downloader_api_root = '{{ api_root }}';
|
||||
</script>
|
||||
<script src="{{ static_root }}/js/jquery.min.js"></script>
|
||||
<script src="{{ static_root }}/js/popper.min.js"></script>
|
||||
<script src="{{ static_root }}/js/bootstrap.min.js"></script>
|
||||
<script>
|
||||
var show_mpd_features = {{ use_mpd }};
|
||||
</script>
|
||||
<script src="{{ static_root }}/js/custom.js"></script>
|
||||
<script src="{{ static_root }}/js/jquery.jgrowl.min.js"></script>
|
||||
<link rel="stylesheet" href="{{ static_root }}/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="{{ static_root }}/css/jquery.jgrowl.min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="{{ static_root }}/css/custom.css" />
|
||||
|
||||
<style>
|
||||
.footer {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 80%;
|
||||
left: 10%;
|
||||
height: 40px;
|
||||
background-color: #f5f5f5;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body id="body" >
|
||||
|
||||
<div class="container">
|
||||
|
||||
<br>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<ul id="navigation" class="nav nav-tabs" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" id="nav-songs-albums" data-toggle="tab" href="#songs_albums">Songs/Albums (1)</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="nav-youtubedl" data-toggle="tab" href="#youtubedl">Youtube-dl (2)</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="nav-spotify-playlists" data-toggle="tab" href="#spotify-playlists">Spotify Playlists (3)</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="nav-deezer" data-toggle="tab" href="#deezer">Deezer (4)</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="nav-file-downloads" href="downloads/" target="_blank" >Files (5)</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="nav-debug-log" data-toggle="tab" href="#debug">Debug (6)</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="nav-task-queue" data-toggle="tab" href="#queue">Queue (7)</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div> <!-- end row -->
|
||||
|
||||
<!-- Tab panes -->
|
||||
<div class="tab-content">
|
||||
|
||||
<div id="songs_albums" class="container tab-pane active">
|
||||
<br>
|
||||
<audio src="" controls style="float:right" id="audio_tag"></audio>
|
||||
<h3>Download songs and albums</h3>
|
||||
|
||||
<div class="input-group">
|
||||
<div class="search-container col-md-6 col-lg-5 col-xs-12">
|
||||
<input type="text" class="search" id="songs-albums-query" placeholder="Search for ..." >
|
||||
<button type="button" class="search" onclick="$('#songs-albums-query').val('')" class="search">
|
||||
<i class="fa fa-times"></i>
|
||||
</button>
|
||||
<button type="button" class="search" id="search_deezer">
|
||||
<i class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tabs-category">
|
||||
<button id="deezer-search-track" class="btn-category active" href="#">Tracks</button>
|
||||
<button id="deezer-search-album" class="btn-category" href="#">Albums</button>
|
||||
<button id="deezer-search-artist" class="btn-category" href="#">Artists</button>
|
||||
</div>
|
||||
|
||||
<table id="results" class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th id="col-cover" style="width: 56px"></th>
|
||||
<th id="col-artist">Artist</th>
|
||||
<th id="col-title">Title</th>
|
||||
<th id="col-album">Album</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div> <!-- end div tab songs/albums -->
|
||||
|
||||
|
||||
<div id="youtubedl" class="container tab-pane fade">
|
||||
<br>
|
||||
<h3>Download stuff via youtube-dl</h3>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="youtubedl-query" placeholder="Download audio from YouTube, Invidious, Vimeo, Soundcloud, YouPorn, ... " />
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-info" id="yt_download_play">Download & Play</button>
|
||||
<button type="button" class="btn btn-info" id="yt_download">Download</button>
|
||||
<button type="button" class="btn btn-info" onclick="$('#youtubedl-query').val('')" >Clear</button>
|
||||
</span>
|
||||
</div> <!-- end div tab youtube-dl -->
|
||||
|
||||
|
||||
<div id="spotify-playlists" class="container tab-pane fade">
|
||||
<br>
|
||||
<h3>Download Spotify playlist</h3>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="spotify-playlist-name" placeholder="name of spotify playlist" />
|
||||
|
||||
<input type="text" class="form-control" id="spotify-playlist-url" placeholder="url or id of the playlist" />
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<div class="input-group">
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-info" id="spotify_download_play">Download & Play</button>
|
||||
<button type="button" class="btn btn-info" id="spotify_download">Download</button>
|
||||
<button type="button" class="btn btn-info" id="spotify_zip">Give me a zip</button>
|
||||
<button type="button" class="btn btn-info" onclick="$('input[id^=\'spotify\']').val('')" >Clear</button>
|
||||
</span>
|
||||
</div>
|
||||
</div> <!-- end div tab spotify playlists -->
|
||||
|
||||
|
||||
|
||||
<div id="deezer" class="container tab-pane fade">
|
||||
<br>
|
||||
<h3>Download Deezer playlist</h3>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="deezer-playlist-url" placeholder="url or id of the playlist" />
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<div class="input-group">
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-info" id="deezer_playlist_download_play">Download & Play</button>
|
||||
<button type="button" class="btn btn-info" id="deezer_playlist_download">Download</button>
|
||||
<button type="button" class="btn btn-info" id="deezer_playlist_zip">Give me a zip</button>
|
||||
<button type="button" class="btn btn-info" onclick="$('#deezer-playlist-url').val('')" >Clear</button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<h3>Download Deezer favorite songs</h3>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="deezer-favorites-userid" placeholder="user id of Deezer user"songs />
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<div class="input-group">
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-info" id="deezer_favorites_download_play">Download & Play</button>
|
||||
<button type="button" class="btn btn-info" id="deezer_favorites_download">Download</button>
|
||||
<button type="button" class="btn btn-info" id="deezer_favorites_zip">Give me a zip</button>
|
||||
<button type="button" class="btn btn-info" onclick="$('#deezer-favorites-userid').val('')" >Clear</button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div> <!-- end div tab deezer playlists -->
|
||||
|
||||
|
||||
<div id="debug" class="container tab-pane fade">
|
||||
<br>
|
||||
<h3>Debug</h3>
|
||||
<div class="form-group">
|
||||
<textarea readonly class="form-control" id="ta-debug-log"></textarea>
|
||||
</div> <!-- end div textares -->
|
||||
</div> <!-- end div tab debug -->
|
||||
|
||||
<div id="queue" class="container tab-pane fade">
|
||||
<br>
|
||||
<h3>Queue</h3>
|
||||
|
||||
<table id="task-list" class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Description</th>
|
||||
<th>Args</th>
|
||||
<th>State</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div> <!-- end div tab queue -->
|
||||
|
||||
<footer class="footer">
|
||||
<div class="container">
|
||||
<i class="fa fa-angellist" ></i> |
|
||||
<span class="text-muted">
|
||||
ctrl+m: focus search bar |
|
||||
Enter: search songs |
|
||||
Ctrl+Shift+[1-7]: navigation |
|
||||
</span>
|
||||
<a id="werbung" href="https://www.effektiv-spenden.org/spenden-tipps/warum-und-wie-ich-spende-gastbeitrag-christoph-hartmann/"><i class="fa fas fa-heart" title="ja, klick drauf." ></i> </a>
|
||||
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
<style>
|
||||
html, body, .container, .tab-content, .tab-pane .form-group {
|
||||
height: 95%;
|
||||
}
|
||||
textarea.form-control {
|
||||
height: 95%;
|
||||
}
|
||||
|
||||
#werbung:link, #werbung:visited, #werbung:hover, #werbung:active { color: red }
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
</div> <!-- end div container -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
60
deezer_downloader/youtubedl.py
Normal file
@@ -0,0 +1,60 @@
|
||||
import re
|
||||
from shlex import quote
|
||||
from subprocess import Popen, PIPE
|
||||
|
||||
from deezer_downloader.configuration import config
|
||||
|
||||
|
||||
class YoutubeDLFailedException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class DownloadedFileNotFoundException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
def execute(cmd):
|
||||
print('Executing "{}"'.format(cmd))
|
||||
p = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE)
|
||||
p.wait()
|
||||
stdout, stderr = p.communicate()
|
||||
print(stdout.decode())
|
||||
if p.returncode != 0:
|
||||
print(stderr.decode())
|
||||
raise YoutubeDLFailedException("ERROR: youtube-dl exited with non-zero: \n{}\nYou may have to update it!".format(stderr.decode()))
|
||||
return get_absolute_filename(stdout.decode(), stderr.decode())
|
||||
|
||||
|
||||
def get_absolute_filename(stdout, stderr):
|
||||
regex_foo = re.search(r'Destination:\s(.*mp3)', stdout)
|
||||
if not regex_foo:
|
||||
raise DownloadedFileNotFoundException("ERROR: Can not extract output file via regex. \nstderr: {}\nstdout: {}".format(stderr, stdout))
|
||||
return regex_foo.group(1)
|
||||
|
||||
|
||||
def youtubedl_download(url, destination_dir, proxy=None):
|
||||
# url, e.g. https://www.youtube.com/watch?v=ZbZSe6N_BXs
|
||||
# destination_dir: /tmp/
|
||||
# proxy: https/socks5 proxy (e. g. socks5://user:pass@127.0.0.1:1080/)
|
||||
# returns: absolute filename of the downloaded file
|
||||
# raises
|
||||
# YoutubeDLFailedException if youtube-dl exits with non-zero
|
||||
# DownloadedFileNotFoundException if we cannot get the converted output file from youtube-dl with a regex
|
||||
|
||||
proxy_command = f" --proxy {proxy}" if proxy else ""
|
||||
youtube_dl_cmd = config["youtubedl"]["command"] + \
|
||||
proxy_command + \
|
||||
" -x --audio-format mp3 " + \
|
||||
"--audio-quality 0 " + \
|
||||
f"-o '{destination_dir}/%(title)s.%(ext)s' " + \
|
||||
"--embed-metadata " + \
|
||||
"--no-embed-chapters " + \
|
||||
quote(url)
|
||||
|
||||
filename_absolute = execute(youtube_dl_cmd)
|
||||
return filename_absolute
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
video_url = "https://www.invidio.us/watch?v=ZbZSe6N_BXs"
|
||||
youtubedl_download(video_url, "/tmp/music/deezer/youtube-dl")
|
||||
45
deployment/Vagrantfile
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.box = "ubuntu/jammy64"
|
||||
config.vm.box_check_update = false
|
||||
|
||||
config.vm.network "forwarded_port", guest: 5000, host: 5000, host_ip: "127.0.0.1"
|
||||
config.vm.network "forwarded_port", guest: 6600, host: 6600, host_ip: "127.0.0.1"
|
||||
|
||||
config.vm.provider "virtualbox" do |vb|
|
||||
vb.gui = false
|
||||
vb.memory = "512"
|
||||
end
|
||||
|
||||
config.vm.provision "shell", inline: <<-SHELL
|
||||
apt-get update -q
|
||||
apt-get install -qy vim tmux git ffmpeg
|
||||
|
||||
# python3-poetry is too old (does not support groups ...)
|
||||
apt-get install -qy python3-pip
|
||||
pip install poetry
|
||||
git clone https://github.com/kmille/deezer-downloader.git /opt/deezer
|
||||
cd /opt/deezer
|
||||
poetry install
|
||||
poetry run deezer-downloader --show-config-template > /opt/deezer/settings.ini
|
||||
|
||||
# enable yt-dlp
|
||||
pip install yt-dlp
|
||||
sed -i 's,.*command = /usr/bin/yt-dlp.*,command = /usr/local/bin/yt-dlp,' /opt/deezer/settings.ini
|
||||
|
||||
# enable mpd
|
||||
apt-get install -yq mpd ncmpcpp
|
||||
sed -i 's/^bind_to_address.*"localhost"/bind_to_address "0.0.0.0"/' /etc/mpd.conf
|
||||
sed -i 's,^music_directory.*,music_directory "/tmp/deezer-downloader",' /etc/mpd.conf
|
||||
systemctl restart mpd
|
||||
sed -i 's/.*use_mpd = False.*/use_mpd = True/' /opt/deezer/settings.ini
|
||||
sed -i 's/.*host = 127.0.0.1.*/host = 0.0.0.0/' /opt/deezer/settings.ini
|
||||
|
||||
echo "1) Adjust the Deezer cookie: sudo vim /opt/deezer/settings.ini" >> /etc/motd
|
||||
echo "2) Run it: cd /opt/deezer && sudo poetry run deezer-downloader --config settings.ini" >> /etc/motd
|
||||
echo "3) Try out: ncmpcpp -h 127.0.0.1 (you won't hear anything because you are in a vm. But you can use it on a Rasberry Pi)" >> /etc/motd
|
||||
echo "4) Downloaded files are in /tmp/deezer-downloader" >> /etc/motd
|
||||
SHELL
|
||||
end
|
||||
13
deployment/deezer.service
Normal file
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description = Deezer downloader
|
||||
After = network.target
|
||||
|
||||
[Service]
|
||||
Environment=PYTHONUNBUFFERED=TRUE
|
||||
User = deezer
|
||||
Group = deezer
|
||||
ExecStart=/home/deezer/.local/bin/deezer-downloader -c /home/deezer/.deezer-downloader.ini
|
||||
PrivateTmp = false
|
||||
|
||||
[Install]
|
||||
WantedBy = multi-user.target
|
||||
1
deployment/docker/Dockerfile
Normal file
@@ -0,0 +1 @@
|
||||
../../Dockerfile
|
||||
1
deployment/docker/README.md
Normal file
@@ -0,0 +1 @@
|
||||
The Dockerfile uses `COPY . /app`. So the Dockerfile needs to be placed in the root directory of the project.
|
||||
14
deployment/docker/docker-compose.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
services:
|
||||
deezer-downloader:
|
||||
build: ../../
|
||||
environment:
|
||||
- DEEZER_COOKIE_ARL=changeme
|
||||
volumes:
|
||||
- ./downloads:/mnt/deezer-downloader
|
||||
ports:
|
||||
- "5000:5000"
|
||||
security_opt:
|
||||
- no-new-privileges
|
||||
cap_drop:
|
||||
- ALL
|
||||
0
deployment/docker/downloads/.gitkeep
Normal file
27
deployment/music-nginx.conf
Normal file
@@ -0,0 +1,27 @@
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
server_name _;
|
||||
|
||||
# forward for ympd
|
||||
location / {
|
||||
proxy_pass http://localhost:8080/;
|
||||
}
|
||||
|
||||
# forward to deezer-downloader
|
||||
location /d/ {
|
||||
rewrite /d/(.*) /$1 break;
|
||||
proxy_pass http://localhost:8081/;
|
||||
}
|
||||
|
||||
# used by flask_autoindex
|
||||
location /__autoindex__/ {
|
||||
proxy_pass http://localhost:8081/__autoindex__/;
|
||||
}
|
||||
|
||||
# used by flask_autoindex
|
||||
location /__icons__/ {
|
||||
proxy_pass http://localhost:8081/__icons__/;
|
||||
}
|
||||
}
|
||||
|
||||
BIN
docs/screenshots/2020-05-13-211622_screenshot.png
Normal file
|
After Width: | Height: | Size: 867 KiB |
BIN
docs/screenshots/2020-05-13-211629_screenshot.png
Normal file
|
After Width: | Height: | Size: 850 KiB |
BIN
docs/screenshots/2020-05-13-211633_screenshot.png
Normal file
|
After Width: | Height: | Size: 806 KiB |
BIN
docs/screenshots/2020-05-13-212025_screenshot.png
Normal file
|
After Width: | Height: | Size: 1.8 MiB |
BIN
docs/screenshots/2025-06-04-114639_screenshot.png
Normal file
|
After Width: | Height: | Size: 134 KiB |
BIN
docs/screenshots/2025-06-04-114645_screenshot.png
Normal file
|
After Width: | Height: | Size: 107 KiB |
BIN
docs/screenshots/2025-06-04-114650_screenshot.png
Normal file
|
After Width: | Height: | Size: 65 KiB |
912
poetry.lock
generated
Normal file
@@ -0,0 +1,912 @@
|
||||
# This file is automatically @generated by Poetry 2.2.1 and should not be changed by hand.
|
||||
|
||||
[[package]]
|
||||
name = "blinker"
|
||||
version = "1.9.0"
|
||||
description = "Fast, simple object-to-object and broadcast signaling"
|
||||
optional = false
|
||||
python-versions = ">=3.9"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "blinker-1.9.0-py3-none-any.whl", hash = "sha256:ba0efaa9080b619ff2f3459d1d500c57bddea4a6b424b60a91141db6fd2f08bc"},
|
||||
{file = "blinker-1.9.0.tar.gz", hash = "sha256:b4ce2265a7abece45e7cc896e98dbebe6cead56bcf805a3d23136d145f5445bf"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "certifi"
|
||||
version = "2025.10.5"
|
||||
description = "Python package for providing Mozilla's CA Bundle."
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "certifi-2025.10.5-py3-none-any.whl", hash = "sha256:0f212c2744a9bb6de0c56639a6f68afe01ecd92d91f14ae897c4fe7bbeeef0de"},
|
||||
{file = "certifi-2025.10.5.tar.gz", hash = "sha256:47c09d31ccf2acf0be3f701ea53595ee7e0b8fa08801c6624be771df09ae7b43"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "charset-normalizer"
|
||||
version = "3.4.4"
|
||||
description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet."
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "charset_normalizer-3.4.4-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:e824f1492727fa856dd6eda4f7cee25f8518a12f3c4a56a74e8095695089cf6d"},
|
||||
{file = "charset_normalizer-3.4.4-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4bd5d4137d500351a30687c2d3971758aac9a19208fc110ccb9d7188fbe709e8"},
|
||||
{file = "charset_normalizer-3.4.4-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:027f6de494925c0ab2a55eab46ae5129951638a49a34d87f4c3eda90f696b4ad"},
|
||||
{file = "charset_normalizer-3.4.4-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f820802628d2694cb7e56db99213f930856014862f3fd943d290ea8438d07ca8"},
|
||||
{file = "charset_normalizer-3.4.4-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:798d75d81754988d2565bff1b97ba5a44411867c0cf32b77a7e8f8d84796b10d"},
|
||||
{file = "charset_normalizer-3.4.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9d1bb833febdff5c8927f922386db610b49db6e0d4f4ee29601d71e7c2694313"},
|
||||
{file = "charset_normalizer-3.4.4-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:9cd98cdc06614a2f768d2b7286d66805f94c48cde050acdbbb7db2600ab3197e"},
|
||||
{file = "charset_normalizer-3.4.4-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:077fbb858e903c73f6c9db43374fd213b0b6a778106bc7032446a8e8b5b38b93"},
|
||||
{file = "charset_normalizer-3.4.4-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:244bfb999c71b35de57821b8ea746b24e863398194a4014e4c76adc2bbdfeff0"},
|
||||
{file = "charset_normalizer-3.4.4-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:64b55f9dce520635f018f907ff1b0df1fdc31f2795a922fb49dd14fbcdf48c84"},
|
||||
{file = "charset_normalizer-3.4.4-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:faa3a41b2b66b6e50f84ae4a68c64fcd0c44355741c6374813a800cd6695db9e"},
|
||||
{file = "charset_normalizer-3.4.4-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:6515f3182dbe4ea06ced2d9e8666d97b46ef4c75e326b79bb624110f122551db"},
|
||||
{file = "charset_normalizer-3.4.4-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:cc00f04ed596e9dc0da42ed17ac5e596c6ccba999ba6bd92b0e0aef2f170f2d6"},
|
||||
{file = "charset_normalizer-3.4.4-cp310-cp310-win32.whl", hash = "sha256:f34be2938726fc13801220747472850852fe6b1ea75869a048d6f896838c896f"},
|
||||
{file = "charset_normalizer-3.4.4-cp310-cp310-win_amd64.whl", hash = "sha256:a61900df84c667873b292c3de315a786dd8dac506704dea57bc957bd31e22c7d"},
|
||||
{file = "charset_normalizer-3.4.4-cp310-cp310-win_arm64.whl", hash = "sha256:cead0978fc57397645f12578bfd2d5ea9138ea0fac82b2f63f7f7c6877986a69"},
|
||||
{file = "charset_normalizer-3.4.4-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:6e1fcf0720908f200cd21aa4e6750a48ff6ce4afe7ff5a79a90d5ed8a08296f8"},
|
||||
{file = "charset_normalizer-3.4.4-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5f819d5fe9234f9f82d75bdfa9aef3a3d72c4d24a6e57aeaebba32a704553aa0"},
|
||||
{file = "charset_normalizer-3.4.4-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:a59cb51917aa591b1c4e6a43c132f0cdc3c76dbad6155df4e28ee626cc77a0a3"},
|
||||
{file = "charset_normalizer-3.4.4-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:8ef3c867360f88ac904fd3f5e1f902f13307af9052646963ee08ff4f131adafc"},
|
||||
{file = "charset_normalizer-3.4.4-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:d9e45d7faa48ee908174d8fe84854479ef838fc6a705c9315372eacbc2f02897"},
|
||||
{file = "charset_normalizer-3.4.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:840c25fb618a231545cbab0564a799f101b63b9901f2569faecd6b222ac72381"},
|
||||
{file = "charset_normalizer-3.4.4-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:ca5862d5b3928c4940729dacc329aa9102900382fea192fc5e52eb69d6093815"},
|
||||
{file = "charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:d9c7f57c3d666a53421049053eaacdd14bbd0a528e2186fcb2e672effd053bb0"},
|
||||
{file = "charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:277e970e750505ed74c832b4bf75dac7476262ee2a013f5574dd49075879e161"},
|
||||
{file = "charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:31fd66405eaf47bb62e8cd575dc621c56c668f27d46a61d975a249930dd5e2a4"},
|
||||
{file = "charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:0d3d8f15c07f86e9ff82319b3d9ef6f4bf907608f53fe9d92b28ea9ae3d1fd89"},
|
||||
{file = "charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:9f7fcd74d410a36883701fafa2482a6af2ff5ba96b9a620e9e0721e28ead5569"},
|
||||
{file = "charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:ebf3e58c7ec8a8bed6d66a75d7fb37b55e5015b03ceae72a8e7c74495551e224"},
|
||||
{file = "charset_normalizer-3.4.4-cp311-cp311-win32.whl", hash = "sha256:eecbc200c7fd5ddb9a7f16c7decb07b566c29fa2161a16cf67b8d068bd21690a"},
|
||||
{file = "charset_normalizer-3.4.4-cp311-cp311-win_amd64.whl", hash = "sha256:5ae497466c7901d54b639cf42d5b8c1b6a4fead55215500d2f486d34db48d016"},
|
||||
{file = "charset_normalizer-3.4.4-cp311-cp311-win_arm64.whl", hash = "sha256:65e2befcd84bc6f37095f5961e68a6f077bf44946771354a28ad434c2cce0ae1"},
|
||||
{file = "charset_normalizer-3.4.4-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:0a98e6759f854bd25a58a73fa88833fba3b7c491169f86ce1180c948ab3fd394"},
|
||||
{file = "charset_normalizer-3.4.4-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b5b290ccc2a263e8d185130284f8501e3e36c5e02750fc6b6bdeb2e9e96f1e25"},
|
||||
{file = "charset_normalizer-3.4.4-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:74bb723680f9f7a6234dcf67aea57e708ec1fbdf5699fb91dfd6f511b0a320ef"},
|
||||
{file = "charset_normalizer-3.4.4-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f1e34719c6ed0b92f418c7c780480b26b5d9c50349e9a9af7d76bf757530350d"},
|
||||
{file = "charset_normalizer-3.4.4-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:2437418e20515acec67d86e12bf70056a33abdacb5cb1655042f6538d6b085a8"},
|
||||
{file = "charset_normalizer-3.4.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:11d694519d7f29d6cd09f6ac70028dba10f92f6cdd059096db198c283794ac86"},
|
||||
{file = "charset_normalizer-3.4.4-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:ac1c4a689edcc530fc9d9aa11f5774b9e2f33f9a0c6a57864e90908f5208d30a"},
|
||||
{file = "charset_normalizer-3.4.4-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:21d142cc6c0ec30d2efee5068ca36c128a30b0f2c53c1c07bd78cb6bc1d3be5f"},
|
||||
{file = "charset_normalizer-3.4.4-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:5dbe56a36425d26d6cfb40ce79c314a2e4dd6211d51d6d2191c00bed34f354cc"},
|
||||
{file = "charset_normalizer-3.4.4-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:5bfbb1b9acf3334612667b61bd3002196fe2a1eb4dd74d247e0f2a4d50ec9bbf"},
|
||||
{file = "charset_normalizer-3.4.4-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:d055ec1e26e441f6187acf818b73564e6e6282709e9bcb5b63f5b23068356a15"},
|
||||
{file = "charset_normalizer-3.4.4-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:af2d8c67d8e573d6de5bc30cdb27e9b95e49115cd9baad5ddbd1a6207aaa82a9"},
|
||||
{file = "charset_normalizer-3.4.4-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:780236ac706e66881f3b7f2f32dfe90507a09e67d1d454c762cf642e6e1586e0"},
|
||||
{file = "charset_normalizer-3.4.4-cp312-cp312-win32.whl", hash = "sha256:5833d2c39d8896e4e19b689ffc198f08ea58116bee26dea51e362ecc7cd3ed26"},
|
||||
{file = "charset_normalizer-3.4.4-cp312-cp312-win_amd64.whl", hash = "sha256:a79cfe37875f822425b89a82333404539ae63dbdddf97f84dcbc3d339aae9525"},
|
||||
{file = "charset_normalizer-3.4.4-cp312-cp312-win_arm64.whl", hash = "sha256:376bec83a63b8021bb5c8ea75e21c4ccb86e7e45ca4eb81146091b56599b80c3"},
|
||||
{file = "charset_normalizer-3.4.4-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:e1f185f86a6f3403aa2420e815904c67b2f9ebc443f045edd0de921108345794"},
|
||||
{file = "charset_normalizer-3.4.4-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6b39f987ae8ccdf0d2642338faf2abb1862340facc796048b604ef14919e55ed"},
|
||||
{file = "charset_normalizer-3.4.4-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:3162d5d8ce1bb98dd51af660f2121c55d0fa541b46dff7bb9b9f86ea1d87de72"},
|
||||
{file = "charset_normalizer-3.4.4-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:81d5eb2a312700f4ecaa977a8235b634ce853200e828fbadf3a9c50bab278328"},
|
||||
{file = "charset_normalizer-3.4.4-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5bd2293095d766545ec1a8f612559f6b40abc0eb18bb2f5d1171872d34036ede"},
|
||||
{file = "charset_normalizer-3.4.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a8a8b89589086a25749f471e6a900d3f662d1d3b6e2e59dcecf787b1cc3a1894"},
|
||||
{file = "charset_normalizer-3.4.4-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:bc7637e2f80d8530ee4a78e878bce464f70087ce73cf7c1caf142416923b98f1"},
|
||||
{file = "charset_normalizer-3.4.4-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:f8bf04158c6b607d747e93949aa60618b61312fe647a6369f88ce2ff16043490"},
|
||||
{file = "charset_normalizer-3.4.4-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:554af85e960429cf30784dd47447d5125aaa3b99a6f0683589dbd27e2f45da44"},
|
||||
{file = "charset_normalizer-3.4.4-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:74018750915ee7ad843a774364e13a3db91682f26142baddf775342c3f5b1133"},
|
||||
{file = "charset_normalizer-3.4.4-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:c0463276121fdee9c49b98908b3a89c39be45d86d1dbaa22957e38f6321d4ce3"},
|
||||
{file = "charset_normalizer-3.4.4-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:362d61fd13843997c1c446760ef36f240cf81d3ebf74ac62652aebaf7838561e"},
|
||||
{file = "charset_normalizer-3.4.4-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:9a26f18905b8dd5d685d6d07b0cdf98a79f3c7a918906af7cc143ea2e164c8bc"},
|
||||
{file = "charset_normalizer-3.4.4-cp313-cp313-win32.whl", hash = "sha256:9b35f4c90079ff2e2edc5b26c0c77925e5d2d255c42c74fdb70fb49b172726ac"},
|
||||
{file = "charset_normalizer-3.4.4-cp313-cp313-win_amd64.whl", hash = "sha256:b435cba5f4f750aa6c0a0d92c541fb79f69a387c91e61f1795227e4ed9cece14"},
|
||||
{file = "charset_normalizer-3.4.4-cp313-cp313-win_arm64.whl", hash = "sha256:542d2cee80be6f80247095cc36c418f7bddd14f4a6de45af91dfad36d817bba2"},
|
||||
{file = "charset_normalizer-3.4.4-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:da3326d9e65ef63a817ecbcc0df6e94463713b754fe293eaa03da99befb9a5bd"},
|
||||
{file = "charset_normalizer-3.4.4-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8af65f14dc14a79b924524b1e7fffe304517b2bff5a58bf64f30b98bbc5079eb"},
|
||||
{file = "charset_normalizer-3.4.4-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:74664978bb272435107de04e36db5a9735e78232b85b77d45cfb38f758efd33e"},
|
||||
{file = "charset_normalizer-3.4.4-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:752944c7ffbfdd10c074dc58ec2d5a8a4cd9493b314d367c14d24c17684ddd14"},
|
||||
{file = "charset_normalizer-3.4.4-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:d1f13550535ad8cff21b8d757a3257963e951d96e20ec82ab44bc64aeb62a191"},
|
||||
{file = "charset_normalizer-3.4.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ecaae4149d99b1c9e7b88bb03e3221956f68fd6d50be2ef061b2381b61d20838"},
|
||||
{file = "charset_normalizer-3.4.4-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:cb6254dc36b47a990e59e1068afacdcd02958bdcce30bb50cc1700a8b9d624a6"},
|
||||
{file = "charset_normalizer-3.4.4-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:c8ae8a0f02f57a6e61203a31428fa1d677cbe50c93622b4149d5c0f319c1d19e"},
|
||||
{file = "charset_normalizer-3.4.4-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:47cc91b2f4dd2833fddaedd2893006b0106129d4b94fdb6af1f4ce5a9965577c"},
|
||||
{file = "charset_normalizer-3.4.4-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:82004af6c302b5d3ab2cfc4cc5f29db16123b1a8417f2e25f9066f91d4411090"},
|
||||
{file = "charset_normalizer-3.4.4-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:2b7d8f6c26245217bd2ad053761201e9f9680f8ce52f0fcd8d0755aeae5b2152"},
|
||||
{file = "charset_normalizer-3.4.4-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:799a7a5e4fb2d5898c60b640fd4981d6a25f1c11790935a44ce38c54e985f828"},
|
||||
{file = "charset_normalizer-3.4.4-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:99ae2cffebb06e6c22bdc25801d7b30f503cc87dbd283479e7b606f70aff57ec"},
|
||||
{file = "charset_normalizer-3.4.4-cp314-cp314-win32.whl", hash = "sha256:f9d332f8c2a2fcbffe1378594431458ddbef721c1769d78e2cbc06280d8155f9"},
|
||||
{file = "charset_normalizer-3.4.4-cp314-cp314-win_amd64.whl", hash = "sha256:8a6562c3700cce886c5be75ade4a5db4214fda19fede41d9792d100288d8f94c"},
|
||||
{file = "charset_normalizer-3.4.4-cp314-cp314-win_arm64.whl", hash = "sha256:de00632ca48df9daf77a2c65a484531649261ec9f25489917f09e455cb09ddb2"},
|
||||
{file = "charset_normalizer-3.4.4-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:ce8a0633f41a967713a59c4139d29110c07e826d131a316b50ce11b1d79b4f84"},
|
||||
{file = "charset_normalizer-3.4.4-cp38-cp38-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:eaabd426fe94daf8fd157c32e571c85cb12e66692f15516a83a03264b08d06c3"},
|
||||
{file = "charset_normalizer-3.4.4-cp38-cp38-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c4ef880e27901b6cc782f1b95f82da9313c0eb95c3af699103088fa0ac3ce9ac"},
|
||||
{file = "charset_normalizer-3.4.4-cp38-cp38-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:2aaba3b0819274cc41757a1da876f810a3e4d7b6eb25699253a4effef9e8e4af"},
|
||||
{file = "charset_normalizer-3.4.4-cp38-cp38-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:778d2e08eda00f4256d7f672ca9fef386071c9202f5e4607920b86d7803387f2"},
|
||||
{file = "charset_normalizer-3.4.4-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f155a433c2ec037d4e8df17d18922c3a0d9b3232a396690f17175d2946f0218d"},
|
||||
{file = "charset_normalizer-3.4.4-cp38-cp38-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:a8bf8d0f749c5757af2142fe7903a9df1d2e8aa3841559b2bad34b08d0e2bcf3"},
|
||||
{file = "charset_normalizer-3.4.4-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:194f08cbb32dc406d6e1aea671a68be0823673db2832b38405deba2fb0d88f63"},
|
||||
{file = "charset_normalizer-3.4.4-cp38-cp38-musllinux_1_2_armv7l.whl", hash = "sha256:6aee717dcfead04c6eb1ce3bd29ac1e22663cdea57f943c87d1eab9a025438d7"},
|
||||
{file = "charset_normalizer-3.4.4-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:cd4b7ca9984e5e7985c12bc60a6f173f3c958eae74f3ef6624bb6b26e2abbae4"},
|
||||
{file = "charset_normalizer-3.4.4-cp38-cp38-musllinux_1_2_riscv64.whl", hash = "sha256:b7cf1017d601aa35e6bb650b6ad28652c9cd78ee6caff19f3c28d03e1c80acbf"},
|
||||
{file = "charset_normalizer-3.4.4-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:e912091979546adf63357d7e2ccff9b44f026c075aeaf25a52d0e95ad2281074"},
|
||||
{file = "charset_normalizer-3.4.4-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:5cb4d72eea50c8868f5288b7f7f33ed276118325c1dfd3957089f6b519e1382a"},
|
||||
{file = "charset_normalizer-3.4.4-cp38-cp38-win32.whl", hash = "sha256:837c2ce8c5a65a2035be9b3569c684358dfbf109fd3b6969630a87535495ceaa"},
|
||||
{file = "charset_normalizer-3.4.4-cp38-cp38-win_amd64.whl", hash = "sha256:44c2a8734b333e0578090c4cd6b16f275e07aa6614ca8715e6c038e865e70576"},
|
||||
{file = "charset_normalizer-3.4.4-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:a9768c477b9d7bd54bc0c86dbaebdec6f03306675526c9927c0e8a04e8f94af9"},
|
||||
{file = "charset_normalizer-3.4.4-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1bee1e43c28aa63cb16e5c14e582580546b08e535299b8b6158a7c9c768a1f3d"},
|
||||
{file = "charset_normalizer-3.4.4-cp39-cp39-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:fd44c878ea55ba351104cb93cc85e74916eb8fa440ca7903e57575e97394f608"},
|
||||
{file = "charset_normalizer-3.4.4-cp39-cp39-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:0f04b14ffe5fdc8c4933862d8306109a2c51e0704acfa35d51598eb45a1e89fc"},
|
||||
{file = "charset_normalizer-3.4.4-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:cd09d08005f958f370f539f186d10aec3377d55b9eeb0d796025d4886119d76e"},
|
||||
{file = "charset_normalizer-3.4.4-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4fe7859a4e3e8457458e2ff592f15ccb02f3da787fcd31e0183879c3ad4692a1"},
|
||||
{file = "charset_normalizer-3.4.4-cp39-cp39-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:fa09f53c465e532f4d3db095e0c55b615f010ad81803d383195b6b5ca6cbf5f3"},
|
||||
{file = "charset_normalizer-3.4.4-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:7fa17817dc5625de8a027cb8b26d9fefa3ea28c8253929b8d6649e705d2835b6"},
|
||||
{file = "charset_normalizer-3.4.4-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:5947809c8a2417be3267efc979c47d76a079758166f7d43ef5ae8e9f92751f88"},
|
||||
{file = "charset_normalizer-3.4.4-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:4902828217069c3c5c71094537a8e623f5d097858ac6ca8252f7b4d10b7560f1"},
|
||||
{file = "charset_normalizer-3.4.4-cp39-cp39-musllinux_1_2_riscv64.whl", hash = "sha256:7c308f7e26e4363d79df40ca5b2be1c6ba9f02bdbccfed5abddb7859a6ce72cf"},
|
||||
{file = "charset_normalizer-3.4.4-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:2c9d3c380143a1fedbff95a312aa798578371eb29da42106a29019368a475318"},
|
||||
{file = "charset_normalizer-3.4.4-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:cb01158d8b88ee68f15949894ccc6712278243d95f344770fa7593fa2d94410c"},
|
||||
{file = "charset_normalizer-3.4.4-cp39-cp39-win32.whl", hash = "sha256:2677acec1a2f8ef614c6888b5b4ae4060cc184174a938ed4e8ef690e15d3e505"},
|
||||
{file = "charset_normalizer-3.4.4-cp39-cp39-win_amd64.whl", hash = "sha256:f8e160feb2aed042cd657a72acc0b481212ed28b1b9a95c0cee1621b524e1966"},
|
||||
{file = "charset_normalizer-3.4.4-cp39-cp39-win_arm64.whl", hash = "sha256:b5d84d37db046c5ca74ee7bb47dd6cbc13f80665fdde3e8040bdd3fb015ecb50"},
|
||||
{file = "charset_normalizer-3.4.4-py3-none-any.whl", hash = "sha256:7a32c560861a02ff789ad905a2fe94e3f840803362c84fecf1851cb4cf3dc37f"},
|
||||
{file = "charset_normalizer-3.4.4.tar.gz", hash = "sha256:94537985111c35f28720e43603b8e7b43a6ecfb2ce1d3058bbe955b73404e21a"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "click"
|
||||
version = "8.1.8"
|
||||
description = "Composable command line interface toolkit"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "click-8.1.8-py3-none-any.whl", hash = "sha256:63c132bbbed01578a06712a2d1f497bb62d9c1c0d329b7903a866228027263b2"},
|
||||
{file = "click-8.1.8.tar.gz", hash = "sha256:ed53c9d8990d83c2a27deae68e4ee337473f6330c040a31d4225c9574d16096a"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
colorama = {version = "*", markers = "platform_system == \"Windows\""}
|
||||
|
||||
[[package]]
|
||||
name = "colorama"
|
||||
version = "0.4.6"
|
||||
description = "Cross-platform colored terminal text."
|
||||
optional = false
|
||||
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7"
|
||||
groups = ["main", "dev"]
|
||||
files = [
|
||||
{file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"},
|
||||
{file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"},
|
||||
]
|
||||
markers = {main = "platform_system == \"Windows\"", dev = "sys_platform == \"win32\""}
|
||||
|
||||
[[package]]
|
||||
name = "debugpy"
|
||||
version = "1.8.17"
|
||||
description = "An implementation of the Debug Adapter Protocol for Python"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "debugpy-1.8.17-cp310-cp310-macosx_15_0_x86_64.whl", hash = "sha256:c41d2ce8bbaddcc0009cc73f65318eedfa3dbc88a8298081deb05389f1ab5542"},
|
||||
{file = "debugpy-1.8.17-cp310-cp310-manylinux_2_34_x86_64.whl", hash = "sha256:1440fd514e1b815edd5861ca394786f90eb24960eb26d6f7200994333b1d79e3"},
|
||||
{file = "debugpy-1.8.17-cp310-cp310-win32.whl", hash = "sha256:3a32c0af575749083d7492dc79f6ab69f21b2d2ad4cd977a958a07d5865316e4"},
|
||||
{file = "debugpy-1.8.17-cp310-cp310-win_amd64.whl", hash = "sha256:a3aad0537cf4d9c1996434be68c6c9a6d233ac6f76c2a482c7803295b4e4f99a"},
|
||||
{file = "debugpy-1.8.17-cp311-cp311-macosx_15_0_universal2.whl", hash = "sha256:d3fce3f0e3de262a3b67e69916d001f3e767661c6e1ee42553009d445d1cd840"},
|
||||
{file = "debugpy-1.8.17-cp311-cp311-manylinux_2_34_x86_64.whl", hash = "sha256:c6bdf134457ae0cac6fb68205776be635d31174eeac9541e1d0c062165c6461f"},
|
||||
{file = "debugpy-1.8.17-cp311-cp311-win32.whl", hash = "sha256:e79a195f9e059edfe5d8bf6f3749b2599452d3e9380484cd261f6b7cd2c7c4da"},
|
||||
{file = "debugpy-1.8.17-cp311-cp311-win_amd64.whl", hash = "sha256:b532282ad4eca958b1b2d7dbcb2b7218e02cb934165859b918e3b6ba7772d3f4"},
|
||||
{file = "debugpy-1.8.17-cp312-cp312-macosx_15_0_universal2.whl", hash = "sha256:f14467edef672195c6f6b8e27ce5005313cb5d03c9239059bc7182b60c176e2d"},
|
||||
{file = "debugpy-1.8.17-cp312-cp312-manylinux_2_34_x86_64.whl", hash = "sha256:24693179ef9dfa20dca8605905a42b392be56d410c333af82f1c5dff807a64cc"},
|
||||
{file = "debugpy-1.8.17-cp312-cp312-win32.whl", hash = "sha256:6a4e9dacf2cbb60d2514ff7b04b4534b0139facbf2abdffe0639ddb6088e59cf"},
|
||||
{file = "debugpy-1.8.17-cp312-cp312-win_amd64.whl", hash = "sha256:e8f8f61c518952fb15f74a302e068b48d9c4691768ade433e4adeea961993464"},
|
||||
{file = "debugpy-1.8.17-cp313-cp313-macosx_15_0_universal2.whl", hash = "sha256:857c1dd5d70042502aef1c6d1c2801211f3ea7e56f75e9c335f434afb403e464"},
|
||||
{file = "debugpy-1.8.17-cp313-cp313-manylinux_2_34_x86_64.whl", hash = "sha256:3bea3b0b12f3946e098cce9b43c3c46e317b567f79570c3f43f0b96d00788088"},
|
||||
{file = "debugpy-1.8.17-cp313-cp313-win32.whl", hash = "sha256:e34ee844c2f17b18556b5bbe59e1e2ff4e86a00282d2a46edab73fd7f18f4a83"},
|
||||
{file = "debugpy-1.8.17-cp313-cp313-win_amd64.whl", hash = "sha256:6c5cd6f009ad4fca8e33e5238210dc1e5f42db07d4b6ab21ac7ffa904a196420"},
|
||||
{file = "debugpy-1.8.17-cp314-cp314-macosx_15_0_universal2.whl", hash = "sha256:045290c010bcd2d82bc97aa2daf6837443cd52f6328592698809b4549babcee1"},
|
||||
{file = "debugpy-1.8.17-cp314-cp314-manylinux_2_34_x86_64.whl", hash = "sha256:b69b6bd9dba6a03632534cdf67c760625760a215ae289f7489a452af1031fe1f"},
|
||||
{file = "debugpy-1.8.17-cp314-cp314-win32.whl", hash = "sha256:5c59b74aa5630f3a5194467100c3b3d1c77898f9ab27e3f7dc5d40fc2f122670"},
|
||||
{file = "debugpy-1.8.17-cp314-cp314-win_amd64.whl", hash = "sha256:893cba7bb0f55161de4365584b025f7064e1f88913551bcd23be3260b231429c"},
|
||||
{file = "debugpy-1.8.17-cp38-cp38-macosx_15_0_x86_64.whl", hash = "sha256:8deb4e31cd575c9f9370042876e078ca118117c1b5e1f22c32befcfbb6955f0c"},
|
||||
{file = "debugpy-1.8.17-cp38-cp38-manylinux_2_34_x86_64.whl", hash = "sha256:b75868b675949a96ab51abc114c7163f40ff0d8f7d6d5fd63f8932fd38e9c6d7"},
|
||||
{file = "debugpy-1.8.17-cp38-cp38-win32.whl", hash = "sha256:17e456da14848d618662354e1dccfd5e5fb75deec3d1d48dc0aa0baacda55860"},
|
||||
{file = "debugpy-1.8.17-cp38-cp38-win_amd64.whl", hash = "sha256:e851beb536a427b5df8aa7d0c7835b29a13812f41e46292ff80b2ef77327355a"},
|
||||
{file = "debugpy-1.8.17-cp39-cp39-macosx_15_0_x86_64.whl", hash = "sha256:f2ac8055a0c4a09b30b931100996ba49ef334c6947e7ae365cdd870416d7513e"},
|
||||
{file = "debugpy-1.8.17-cp39-cp39-manylinux_2_34_x86_64.whl", hash = "sha256:eaa85bce251feca8e4c87ce3b954aba84b8c645b90f0e6a515c00394a9f5c0e7"},
|
||||
{file = "debugpy-1.8.17-cp39-cp39-win32.whl", hash = "sha256:b13eea5587e44f27f6c48588b5ad56dcb74a4f3a5f89250443c94587f3eb2ea1"},
|
||||
{file = "debugpy-1.8.17-cp39-cp39-win_amd64.whl", hash = "sha256:bb1bbf92317e1f35afcf3ef0450219efb3afe00be79d8664b250ac0933b9015f"},
|
||||
{file = "debugpy-1.8.17-py2.py3-none-any.whl", hash = "sha256:60c7dca6571efe660ccb7a9508d73ca14b8796c4ed484c2002abba714226cfef"},
|
||||
{file = "debugpy-1.8.17.tar.gz", hash = "sha256:fd723b47a8c08892b1a16b2c6239a8b96637c62a59b94bb5dab4bac592a58a8e"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "exceptiongroup"
|
||||
version = "1.3.0"
|
||||
description = "Backport of PEP 654 (exception groups)"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
groups = ["dev"]
|
||||
markers = "python_version < \"3.11\""
|
||||
files = [
|
||||
{file = "exceptiongroup-1.3.0-py3-none-any.whl", hash = "sha256:4d111e6e0c13d0644cad6ddaa7ed0261a0b36971f6d23e7ec9b4b9097da78a10"},
|
||||
{file = "exceptiongroup-1.3.0.tar.gz", hash = "sha256:b241f5885f560bc56a59ee63ca4c6a8bfa46ae4ad651af316d4e81817bb9fd88"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
typing-extensions = {version = ">=4.6.0", markers = "python_version < \"3.13\""}
|
||||
|
||||
[package.extras]
|
||||
test = ["pytest (>=6)"]
|
||||
|
||||
[[package]]
|
||||
name = "flake8"
|
||||
version = "7.3.0"
|
||||
description = "the modular source code checker: pep8 pyflakes and co"
|
||||
optional = false
|
||||
python-versions = ">=3.9"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "flake8-7.3.0-py2.py3-none-any.whl", hash = "sha256:b9696257b9ce8beb888cdbe31cf885c90d31928fe202be0889a7cdafad32f01e"},
|
||||
{file = "flake8-7.3.0.tar.gz", hash = "sha256:fe044858146b9fc69b551a4b490d69cf960fcb78ad1edcb84e7fbb1b4a8e3872"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
mccabe = ">=0.7.0,<0.8.0"
|
||||
pycodestyle = ">=2.14.0,<2.15.0"
|
||||
pyflakes = ">=3.4.0,<3.5.0"
|
||||
|
||||
[[package]]
|
||||
name = "flask"
|
||||
version = "3.1.2"
|
||||
description = "A simple framework for building complex web applications."
|
||||
optional = false
|
||||
python-versions = ">=3.9"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "flask-3.1.2-py3-none-any.whl", hash = "sha256:ca1d8112ec8a6158cc29ea4858963350011b5c846a414cdb7a954aa9e967d03c"},
|
||||
{file = "flask-3.1.2.tar.gz", hash = "sha256:bf656c15c80190ed628ad08cdfd3aaa35beb087855e2f494910aa3774cc4fd87"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
blinker = ">=1.9.0"
|
||||
click = ">=8.1.3"
|
||||
importlib-metadata = {version = ">=3.6.0", markers = "python_version < \"3.10\""}
|
||||
itsdangerous = ">=2.2.0"
|
||||
jinja2 = ">=3.1.2"
|
||||
markupsafe = ">=2.1.1"
|
||||
werkzeug = ">=3.1.0"
|
||||
|
||||
[package.extras]
|
||||
async = ["asgiref (>=3.2)"]
|
||||
dotenv = ["python-dotenv"]
|
||||
|
||||
[[package]]
|
||||
name = "flask-autoindex"
|
||||
version = "0.6.6"
|
||||
description = "The mod_autoindex for Flask"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "Flask-AutoIndex-0.6.6.tar.gz", hash = "sha256:ea319f7ccadf68ddf98d940002066278c779323644f9944b300066d50e2effc7"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
Flask = ">=1.1"
|
||||
Flask-Silk = ">=0.2"
|
||||
future = ">=0.13.0"
|
||||
|
||||
[[package]]
|
||||
name = "flask-silk"
|
||||
version = "0.2"
|
||||
description = "Adds silk icons to your Flask application or blueprint, or extension."
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "Flask-Silk-0.2.tar.gz", hash = "sha256:80a21faf09fe257443a4fbbf8cd3f6c793c567c87ff784751a1c38d2e18b5fbe"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
Flask = ">=0.8"
|
||||
|
||||
[[package]]
|
||||
name = "future"
|
||||
version = "1.0.0"
|
||||
description = "Clean single-source support for Python 3 and 2"
|
||||
optional = false
|
||||
python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "future-1.0.0-py3-none-any.whl", hash = "sha256:929292d34f5872e70396626ef385ec22355a1fae8ad29e1a734c3e43f9fbc216"},
|
||||
{file = "future-1.0.0.tar.gz", hash = "sha256:bd2968309307861edae1458a4f8a4f3598c03be43b97521076aebf5d94c07b05"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "giphypop"
|
||||
version = "0.3"
|
||||
description = "Python wrapper for Giphy API"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "giphypop-0.3.tar.gz", hash = "sha256:8dbdffa520be21dff4f7415913c024bca100458fbb19aea878942cff4ab903f1"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
requests = "*"
|
||||
|
||||
[[package]]
|
||||
name = "idna"
|
||||
version = "3.11"
|
||||
description = "Internationalized Domain Names in Applications (IDNA)"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"},
|
||||
{file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"]
|
||||
|
||||
[[package]]
|
||||
name = "importlib-metadata"
|
||||
version = "8.7.0"
|
||||
description = "Read metadata from Python packages"
|
||||
optional = false
|
||||
python-versions = ">=3.9"
|
||||
groups = ["main"]
|
||||
markers = "python_version < \"3.10\""
|
||||
files = [
|
||||
{file = "importlib_metadata-8.7.0-py3-none-any.whl", hash = "sha256:e5dd1551894c77868a30651cef00984d50e1002d06942a7101d34870c5f02afd"},
|
||||
{file = "importlib_metadata-8.7.0.tar.gz", hash = "sha256:d13b81ad223b890aa16c5471f2ac3056cf76c5f10f82d6f9292f0b415f389000"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
zipp = ">=3.20"
|
||||
|
||||
[package.extras]
|
||||
check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1) ; sys_platform != \"cygwin\""]
|
||||
cover = ["pytest-cov"]
|
||||
doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"]
|
||||
enabler = ["pytest-enabler (>=2.2)"]
|
||||
perf = ["ipython"]
|
||||
test = ["flufl.flake8", "importlib_resources (>=1.3) ; python_version < \"3.9\"", "jaraco.test (>=5.4)", "packaging", "pyfakefs", "pytest (>=6,!=8.1.*)", "pytest-perf (>=0.9.2)"]
|
||||
type = ["pytest-mypy"]
|
||||
|
||||
[[package]]
|
||||
name = "iniconfig"
|
||||
version = "2.1.0"
|
||||
description = "brain-dead simple config-ini parsing"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "iniconfig-2.1.0-py3-none-any.whl", hash = "sha256:9deba5723312380e77435581c6bf4935c94cbfab9b1ed33ef8d238ea168eb760"},
|
||||
{file = "iniconfig-2.1.0.tar.gz", hash = "sha256:3abbd2e30b36733fee78f9c7f7308f2d0050e88f0087fd25c2645f63c773e1c7"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "itsdangerous"
|
||||
version = "2.2.0"
|
||||
description = "Safely pass data to untrusted environments and back."
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "itsdangerous-2.2.0-py3-none-any.whl", hash = "sha256:c6242fc49e35958c8b15141343aa660db5fc54d4f13a1db01a3f5891b98700ef"},
|
||||
{file = "itsdangerous-2.2.0.tar.gz", hash = "sha256:e0050c0b7da1eea53ffaf149c0cfbb5c6e2e2b69c4bef22c81fa6eb73e5f6173"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jinja2"
|
||||
version = "3.1.6"
|
||||
description = "A very fast and expressive template engine."
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67"},
|
||||
{file = "jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
MarkupSafe = ">=2.0"
|
||||
|
||||
[package.extras]
|
||||
i18n = ["Babel (>=2.7)"]
|
||||
|
||||
[[package]]
|
||||
name = "markupsafe"
|
||||
version = "3.0.3"
|
||||
description = "Safely add untrusted strings to HTML/XML markup."
|
||||
optional = false
|
||||
python-versions = ">=3.9"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "markupsafe-3.0.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:2f981d352f04553a7171b8e44369f2af4055f888dfb147d55e42d29e29e74559"},
|
||||
{file = "markupsafe-3.0.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e1c1493fb6e50ab01d20a22826e57520f1284df32f2d8601fdd90b6304601419"},
|
||||
{file = "markupsafe-3.0.3-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1ba88449deb3de88bd40044603fafffb7bc2b055d626a330323a9ed736661695"},
|
||||
{file = "markupsafe-3.0.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f42d0984e947b8adf7dd6dde396e720934d12c506ce84eea8476409563607591"},
|
||||
{file = "markupsafe-3.0.3-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:c0c0b3ade1c0b13b936d7970b1d37a57acde9199dc2aecc4c336773e1d86049c"},
|
||||
{file = "markupsafe-3.0.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:0303439a41979d9e74d18ff5e2dd8c43ed6c6001fd40e5bf2e43f7bd9bbc523f"},
|
||||
{file = "markupsafe-3.0.3-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:d2ee202e79d8ed691ceebae8e0486bd9a2cd4794cec4824e1c99b6f5009502f6"},
|
||||
{file = "markupsafe-3.0.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:177b5253b2834fe3678cb4a5f0059808258584c559193998be2601324fdeafb1"},
|
||||
{file = "markupsafe-3.0.3-cp310-cp310-win32.whl", hash = "sha256:2a15a08b17dd94c53a1da0438822d70ebcd13f8c3a95abe3a9ef9f11a94830aa"},
|
||||
{file = "markupsafe-3.0.3-cp310-cp310-win_amd64.whl", hash = "sha256:c4ffb7ebf07cfe8931028e3e4c85f0357459a3f9f9490886198848f4fa002ec8"},
|
||||
{file = "markupsafe-3.0.3-cp310-cp310-win_arm64.whl", hash = "sha256:e2103a929dfa2fcaf9bb4e7c091983a49c9ac3b19c9061b6d5427dd7d14d81a1"},
|
||||
{file = "markupsafe-3.0.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:1cc7ea17a6824959616c525620e387f6dd30fec8cb44f649e31712db02123dad"},
|
||||
{file = "markupsafe-3.0.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4bd4cd07944443f5a265608cc6aab442e4f74dff8088b0dfc8238647b8f6ae9a"},
|
||||
{file = "markupsafe-3.0.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6b5420a1d9450023228968e7e6a9ce57f65d148ab56d2313fcd589eee96a7a50"},
|
||||
{file = "markupsafe-3.0.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0bf2a864d67e76e5c9a34dc26ec616a66b9888e25e7b9460e1c76d3293bd9dbf"},
|
||||
{file = "markupsafe-3.0.3-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:bc51efed119bc9cfdf792cdeaa4d67e8f6fcccab66ed4bfdd6bde3e59bfcbb2f"},
|
||||
{file = "markupsafe-3.0.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:068f375c472b3e7acbe2d5318dea141359e6900156b5b2ba06a30b169086b91a"},
|
||||
{file = "markupsafe-3.0.3-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:7be7b61bb172e1ed687f1754f8e7484f1c8019780f6f6b0786e76bb01c2ae115"},
|
||||
{file = "markupsafe-3.0.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f9e130248f4462aaa8e2552d547f36ddadbeaa573879158d721bbd33dfe4743a"},
|
||||
{file = "markupsafe-3.0.3-cp311-cp311-win32.whl", hash = "sha256:0db14f5dafddbb6d9208827849fad01f1a2609380add406671a26386cdf15a19"},
|
||||
{file = "markupsafe-3.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:de8a88e63464af587c950061a5e6a67d3632e36df62b986892331d4620a35c01"},
|
||||
{file = "markupsafe-3.0.3-cp311-cp311-win_arm64.whl", hash = "sha256:3b562dd9e9ea93f13d53989d23a7e775fdfd1066c33494ff43f5418bc8c58a5c"},
|
||||
{file = "markupsafe-3.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d53197da72cc091b024dd97249dfc7794d6a56530370992a5e1a08983ad9230e"},
|
||||
{file = "markupsafe-3.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1872df69a4de6aead3491198eaf13810b565bdbeec3ae2dc8780f14458ec73ce"},
|
||||
{file = "markupsafe-3.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3a7e8ae81ae39e62a41ec302f972ba6ae23a5c5396c8e60113e9066ef893da0d"},
|
||||
{file = "markupsafe-3.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d6dd0be5b5b189d31db7cda48b91d7e0a9795f31430b7f271219ab30f1d3ac9d"},
|
||||
{file = "markupsafe-3.0.3-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:94c6f0bb423f739146aec64595853541634bde58b2135f27f61c1ffd1cd4d16a"},
|
||||
{file = "markupsafe-3.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:be8813b57049a7dc738189df53d69395eba14fb99345e0a5994914a3864c8a4b"},
|
||||
{file = "markupsafe-3.0.3-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:83891d0e9fb81a825d9a6d61e3f07550ca70a076484292a70fde82c4b807286f"},
|
||||
{file = "markupsafe-3.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:77f0643abe7495da77fb436f50f8dab76dbc6e5fd25d39589a0f1fe6548bfa2b"},
|
||||
{file = "markupsafe-3.0.3-cp312-cp312-win32.whl", hash = "sha256:d88b440e37a16e651bda4c7c2b930eb586fd15ca7406cb39e211fcff3bf3017d"},
|
||||
{file = "markupsafe-3.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:26a5784ded40c9e318cfc2bdb30fe164bdb8665ded9cd64d500a34fb42067b1c"},
|
||||
{file = "markupsafe-3.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:35add3b638a5d900e807944a078b51922212fb3dedb01633a8defc4b01a3c85f"},
|
||||
{file = "markupsafe-3.0.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e1cf1972137e83c5d4c136c43ced9ac51d0e124706ee1c8aa8532c1287fa8795"},
|
||||
{file = "markupsafe-3.0.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:116bb52f642a37c115f517494ea5feb03889e04df47eeff5b130b1808ce7c219"},
|
||||
{file = "markupsafe-3.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:133a43e73a802c5562be9bbcd03d090aa5a1fe899db609c29e8c8d815c5f6de6"},
|
||||
{file = "markupsafe-3.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ccfcd093f13f0f0b7fdd0f198b90053bf7b2f02a3927a30e63f3ccc9df56b676"},
|
||||
{file = "markupsafe-3.0.3-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:509fa21c6deb7a7a273d629cf5ec029bc209d1a51178615ddf718f5918992ab9"},
|
||||
{file = "markupsafe-3.0.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a4afe79fb3de0b7097d81da19090f4df4f8d3a2b3adaa8764138aac2e44f3af1"},
|
||||
{file = "markupsafe-3.0.3-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:795e7751525cae078558e679d646ae45574b47ed6e7771863fcc079a6171a0fc"},
|
||||
{file = "markupsafe-3.0.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:8485f406a96febb5140bfeca44a73e3ce5116b2501ac54fe953e488fb1d03b12"},
|
||||
{file = "markupsafe-3.0.3-cp313-cp313-win32.whl", hash = "sha256:bdd37121970bfd8be76c5fb069c7751683bdf373db1ed6c010162b2a130248ed"},
|
||||
{file = "markupsafe-3.0.3-cp313-cp313-win_amd64.whl", hash = "sha256:9a1abfdc021a164803f4d485104931fb8f8c1efd55bc6b748d2f5774e78b62c5"},
|
||||
{file = "markupsafe-3.0.3-cp313-cp313-win_arm64.whl", hash = "sha256:7e68f88e5b8799aa49c85cd116c932a1ac15caaa3f5db09087854d218359e485"},
|
||||
{file = "markupsafe-3.0.3-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:218551f6df4868a8d527e3062d0fb968682fe92054e89978594c28e642c43a73"},
|
||||
{file = "markupsafe-3.0.3-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:3524b778fe5cfb3452a09d31e7b5adefeea8c5be1d43c4f810ba09f2ceb29d37"},
|
||||
{file = "markupsafe-3.0.3-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4e885a3d1efa2eadc93c894a21770e4bc67899e3543680313b09f139e149ab19"},
|
||||
{file = "markupsafe-3.0.3-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8709b08f4a89aa7586de0aadc8da56180242ee0ada3999749b183aa23df95025"},
|
||||
{file = "markupsafe-3.0.3-cp313-cp313t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:b8512a91625c9b3da6f127803b166b629725e68af71f8184ae7e7d54686a56d6"},
|
||||
{file = "markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:9b79b7a16f7fedff2495d684f2b59b0457c3b493778c9eed31111be64d58279f"},
|
||||
{file = "markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_riscv64.whl", hash = "sha256:12c63dfb4a98206f045aa9563db46507995f7ef6d83b2f68eda65c307c6829eb"},
|
||||
{file = "markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:8f71bc33915be5186016f675cd83a1e08523649b0e33efdb898db577ef5bb009"},
|
||||
{file = "markupsafe-3.0.3-cp313-cp313t-win32.whl", hash = "sha256:69c0b73548bc525c8cb9a251cddf1931d1db4d2258e9599c28c07ef3580ef354"},
|
||||
{file = "markupsafe-3.0.3-cp313-cp313t-win_amd64.whl", hash = "sha256:1b4b79e8ebf6b55351f0d91fe80f893b4743f104bff22e90697db1590e47a218"},
|
||||
{file = "markupsafe-3.0.3-cp313-cp313t-win_arm64.whl", hash = "sha256:ad2cf8aa28b8c020ab2fc8287b0f823d0a7d8630784c31e9ee5edea20f406287"},
|
||||
{file = "markupsafe-3.0.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:eaa9599de571d72e2daf60164784109f19978b327a3910d3e9de8c97b5b70cfe"},
|
||||
{file = "markupsafe-3.0.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:c47a551199eb8eb2121d4f0f15ae0f923d31350ab9280078d1e5f12b249e0026"},
|
||||
{file = "markupsafe-3.0.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f34c41761022dd093b4b6896d4810782ffbabe30f2d443ff5f083e0cbbb8c737"},
|
||||
{file = "markupsafe-3.0.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:457a69a9577064c05a97c41f4e65148652db078a3a509039e64d3467b9e7ef97"},
|
||||
{file = "markupsafe-3.0.3-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:e8afc3f2ccfa24215f8cb28dcf43f0113ac3c37c2f0f0806d8c70e4228c5cf4d"},
|
||||
{file = "markupsafe-3.0.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:ec15a59cf5af7be74194f7ab02d0f59a62bdcf1a537677ce67a2537c9b87fcda"},
|
||||
{file = "markupsafe-3.0.3-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:0eb9ff8191e8498cca014656ae6b8d61f39da5f95b488805da4bb029cccbfbaf"},
|
||||
{file = "markupsafe-3.0.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:2713baf880df847f2bece4230d4d094280f4e67b1e813eec43b4c0e144a34ffe"},
|
||||
{file = "markupsafe-3.0.3-cp314-cp314-win32.whl", hash = "sha256:729586769a26dbceff69f7a7dbbf59ab6572b99d94576a5592625d5b411576b9"},
|
||||
{file = "markupsafe-3.0.3-cp314-cp314-win_amd64.whl", hash = "sha256:bdc919ead48f234740ad807933cdf545180bfbe9342c2bb451556db2ed958581"},
|
||||
{file = "markupsafe-3.0.3-cp314-cp314-win_arm64.whl", hash = "sha256:5a7d5dc5140555cf21a6fefbdbf8723f06fcd2f63ef108f2854de715e4422cb4"},
|
||||
{file = "markupsafe-3.0.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:1353ef0c1b138e1907ae78e2f6c63ff67501122006b0f9abad68fda5f4ffc6ab"},
|
||||
{file = "markupsafe-3.0.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:1085e7fbddd3be5f89cc898938f42c0b3c711fdcb37d75221de2666af647c175"},
|
||||
{file = "markupsafe-3.0.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1b52b4fb9df4eb9ae465f8d0c228a00624de2334f216f178a995ccdcf82c4634"},
|
||||
{file = "markupsafe-3.0.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:fed51ac40f757d41b7c48425901843666a6677e3e8eb0abcff09e4ba6e664f50"},
|
||||
{file = "markupsafe-3.0.3-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:f190daf01f13c72eac4efd5c430a8de82489d9cff23c364c3ea822545032993e"},
|
||||
{file = "markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:e56b7d45a839a697b5eb268c82a71bd8c7f6c94d6fd50c3d577fa39a9f1409f5"},
|
||||
{file = "markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:f3e98bb3798ead92273dc0e5fd0f31ade220f59a266ffd8a4f6065e0a3ce0523"},
|
||||
{file = "markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:5678211cb9333a6468fb8d8be0305520aa073f50d17f089b5b4b477ea6e67fdc"},
|
||||
{file = "markupsafe-3.0.3-cp314-cp314t-win32.whl", hash = "sha256:915c04ba3851909ce68ccc2b8e2cd691618c4dc4c4232fb7982bca3f41fd8c3d"},
|
||||
{file = "markupsafe-3.0.3-cp314-cp314t-win_amd64.whl", hash = "sha256:4faffd047e07c38848ce017e8725090413cd80cbc23d86e55c587bf979e579c9"},
|
||||
{file = "markupsafe-3.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:32001d6a8fc98c8cb5c947787c5d08b0a50663d139f1305bac5885d98d9b40fa"},
|
||||
{file = "markupsafe-3.0.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:15d939a21d546304880945ca1ecb8a039db6b4dc49b2c5a400387cdae6a62e26"},
|
||||
{file = "markupsafe-3.0.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f71a396b3bf33ecaa1626c255855702aca4d3d9fea5e051b41ac59a9c1c41edc"},
|
||||
{file = "markupsafe-3.0.3-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0f4b68347f8c5eab4a13419215bdfd7f8c9b19f2b25520968adfad23eb0ce60c"},
|
||||
{file = "markupsafe-3.0.3-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e8fc20152abba6b83724d7ff268c249fa196d8259ff481f3b1476383f8f24e42"},
|
||||
{file = "markupsafe-3.0.3-cp39-cp39-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:949b8d66bc381ee8b007cd945914c721d9aba8e27f71959d750a46f7c282b20b"},
|
||||
{file = "markupsafe-3.0.3-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:3537e01efc9d4dccdf77221fb1cb3b8e1a38d5428920e0657ce299b20324d758"},
|
||||
{file = "markupsafe-3.0.3-cp39-cp39-musllinux_1_2_riscv64.whl", hash = "sha256:591ae9f2a647529ca990bc681daebdd52c8791ff06c2bfa05b65163e28102ef2"},
|
||||
{file = "markupsafe-3.0.3-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:a320721ab5a1aba0a233739394eb907f8c8da5c98c9181d1161e77a0c8e36f2d"},
|
||||
{file = "markupsafe-3.0.3-cp39-cp39-win32.whl", hash = "sha256:df2449253ef108a379b8b5d6b43f4b1a8e81a061d6537becd5582fba5f9196d7"},
|
||||
{file = "markupsafe-3.0.3-cp39-cp39-win_amd64.whl", hash = "sha256:7c3fb7d25180895632e5d3148dbdc29ea38ccb7fd210aa27acbd1201a1902c6e"},
|
||||
{file = "markupsafe-3.0.3-cp39-cp39-win_arm64.whl", hash = "sha256:38664109c14ffc9e7437e86b4dceb442b0096dfe3541d7864d9cbe1da4cf36c8"},
|
||||
{file = "markupsafe-3.0.3.tar.gz", hash = "sha256:722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mccabe"
|
||||
version = "0.7.0"
|
||||
description = "McCabe checker, plugin for flake8"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"},
|
||||
{file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mutagen"
|
||||
version = "1.47.0"
|
||||
description = "read and write audio tags for many formats"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "mutagen-1.47.0-py3-none-any.whl", hash = "sha256:edd96f50c5907a9539d8e5bba7245f62c9f520aef333d13392a79a4f70aca719"},
|
||||
{file = "mutagen-1.47.0.tar.gz", hash = "sha256:719fadef0a978c31b4cf3c956261b3c58b6948b32023078a2117b1de09f0fc99"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "packaging"
|
||||
version = "25.0"
|
||||
description = "Core utilities for Python packages"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484"},
|
||||
{file = "packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pluggy"
|
||||
version = "1.6.0"
|
||||
description = "plugin and hook calling mechanisms for python"
|
||||
optional = false
|
||||
python-versions = ">=3.9"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746"},
|
||||
{file = "pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
dev = ["pre-commit", "tox"]
|
||||
testing = ["coverage", "pytest", "pytest-benchmark"]
|
||||
|
||||
[[package]]
|
||||
name = "pycodestyle"
|
||||
version = "2.14.0"
|
||||
description = "Python style guide checker"
|
||||
optional = false
|
||||
python-versions = ">=3.9"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "pycodestyle-2.14.0-py2.py3-none-any.whl", hash = "sha256:dd6bf7cb4ee77f8e016f9c8e74a35ddd9f67e1d5fd4184d86c3b98e07099f42d"},
|
||||
{file = "pycodestyle-2.14.0.tar.gz", hash = "sha256:c4b5b517d278089ff9d0abdec919cd97262a3367449ea1c8b49b91529167b783"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pycryptodome"
|
||||
version = "3.23.0"
|
||||
description = "Cryptographic library for Python"
|
||||
optional = false
|
||||
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "pycryptodome-3.23.0-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:a176b79c49af27d7f6c12e4b178b0824626f40a7b9fed08f712291b6d54bf566"},
|
||||
{file = "pycryptodome-3.23.0-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:573a0b3017e06f2cffd27d92ef22e46aa3be87a2d317a5abf7cc0e84e321bd75"},
|
||||
{file = "pycryptodome-3.23.0-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:63dad881b99ca653302b2c7191998dd677226222a3f2ea79999aa51ce695f720"},
|
||||
{file = "pycryptodome-3.23.0-cp27-cp27m-win32.whl", hash = "sha256:b34e8e11d97889df57166eda1e1ddd7676da5fcd4d71a0062a760e75060514b4"},
|
||||
{file = "pycryptodome-3.23.0-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:7ac1080a8da569bde76c0a104589c4f414b8ba296c0b3738cf39a466a9fb1818"},
|
||||
{file = "pycryptodome-3.23.0-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:6fe8258e2039eceb74dfec66b3672552b6b7d2c235b2dfecc05d16b8921649a8"},
|
||||
{file = "pycryptodome-3.23.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:0011f7f00cdb74879142011f95133274741778abba114ceca229adbf8e62c3e4"},
|
||||
{file = "pycryptodome-3.23.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:90460fc9e088ce095f9ee8356722d4f10f86e5be06e2354230a9880b9c549aae"},
|
||||
{file = "pycryptodome-3.23.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4764e64b269fc83b00f682c47443c2e6e85b18273712b98aa43bcb77f8570477"},
|
||||
{file = "pycryptodome-3.23.0-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eb8f24adb74984aa0e5d07a2368ad95276cf38051fe2dc6605cbcf482e04f2a7"},
|
||||
{file = "pycryptodome-3.23.0-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d97618c9c6684a97ef7637ba43bdf6663a2e2e77efe0f863cce97a76af396446"},
|
||||
{file = "pycryptodome-3.23.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:9a53a4fe5cb075075d515797d6ce2f56772ea7e6a1e5e4b96cf78a14bac3d265"},
|
||||
{file = "pycryptodome-3.23.0-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:763d1d74f56f031788e5d307029caef067febf890cd1f8bf61183ae142f1a77b"},
|
||||
{file = "pycryptodome-3.23.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:954af0e2bd7cea83ce72243b14e4fb518b18f0c1649b576d114973e2073b273d"},
|
||||
{file = "pycryptodome-3.23.0-cp313-cp313t-win32.whl", hash = "sha256:257bb3572c63ad8ba40b89f6fc9d63a2a628e9f9708d31ee26560925ebe0210a"},
|
||||
{file = "pycryptodome-3.23.0-cp313-cp313t-win_amd64.whl", hash = "sha256:6501790c5b62a29fcb227bd6b62012181d886a767ce9ed03b303d1f22eb5c625"},
|
||||
{file = "pycryptodome-3.23.0-cp313-cp313t-win_arm64.whl", hash = "sha256:9a77627a330ab23ca43b48b130e202582e91cc69619947840ea4d2d1be21eb39"},
|
||||
{file = "pycryptodome-3.23.0-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:187058ab80b3281b1de11c2e6842a357a1f71b42cb1e15bce373f3d238135c27"},
|
||||
{file = "pycryptodome-3.23.0-cp37-abi3-macosx_10_9_x86_64.whl", hash = "sha256:cfb5cd445280c5b0a4e6187a7ce8de5a07b5f3f897f235caa11f1f435f182843"},
|
||||
{file = "pycryptodome-3.23.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:67bd81fcbe34f43ad9422ee8fd4843c8e7198dd88dd3d40e6de42ee65fbe1490"},
|
||||
{file = "pycryptodome-3.23.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c8987bd3307a39bc03df5c8e0e3d8be0c4c3518b7f044b0f4c15d1aa78f52575"},
|
||||
{file = "pycryptodome-3.23.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:aa0698f65e5b570426fc31b8162ed4603b0c2841cbb9088e2b01641e3065915b"},
|
||||
{file = "pycryptodome-3.23.0-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:53ecbafc2b55353edcebd64bf5da94a2a2cdf5090a6915bcca6eca6cc452585a"},
|
||||
{file = "pycryptodome-3.23.0-cp37-abi3-musllinux_1_2_i686.whl", hash = "sha256:156df9667ad9f2ad26255926524e1c136d6664b741547deb0a86a9acf5ea631f"},
|
||||
{file = "pycryptodome-3.23.0-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:dea827b4d55ee390dc89b2afe5927d4308a8b538ae91d9c6f7a5090f397af1aa"},
|
||||
{file = "pycryptodome-3.23.0-cp37-abi3-win32.whl", hash = "sha256:507dbead45474b62b2bbe318eb1c4c8ee641077532067fec9c1aa82c31f84886"},
|
||||
{file = "pycryptodome-3.23.0-cp37-abi3-win_amd64.whl", hash = "sha256:c75b52aacc6c0c260f204cbdd834f76edc9fb0d8e0da9fbf8352ef58202564e2"},
|
||||
{file = "pycryptodome-3.23.0-cp37-abi3-win_arm64.whl", hash = "sha256:11eeeb6917903876f134b56ba11abe95c0b0fd5e3330def218083c7d98bbcb3c"},
|
||||
{file = "pycryptodome-3.23.0-pp27-pypy_73-manylinux2010_x86_64.whl", hash = "sha256:350ebc1eba1da729b35ab7627a833a1a355ee4e852d8ba0447fafe7b14504d56"},
|
||||
{file = "pycryptodome-3.23.0-pp27-pypy_73-win32.whl", hash = "sha256:93837e379a3e5fd2bb00302a47aee9fdf7940d83595be3915752c74033d17ca7"},
|
||||
{file = "pycryptodome-3.23.0-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:ddb95b49df036ddd264a0ad246d1be5b672000f12d6961ea2c267083a5e19379"},
|
||||
{file = "pycryptodome-3.23.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d8e95564beb8782abfd9e431c974e14563a794a4944c29d6d3b7b5ea042110b4"},
|
||||
{file = "pycryptodome-3.23.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:14e15c081e912c4b0d75632acd8382dfce45b258667aa3c67caf7a4d4c13f630"},
|
||||
{file = "pycryptodome-3.23.0-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a7fc76bf273353dc7e5207d172b83f569540fc9a28d63171061c42e361d22353"},
|
||||
{file = "pycryptodome-3.23.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:45c69ad715ca1a94f778215a11e66b7ff989d792a4d63b68dc586a1da1392ff5"},
|
||||
{file = "pycryptodome-3.23.0-pp39-pypy39_pp73-macosx_10_15_x86_64.whl", hash = "sha256:865d83c906b0fc6a59b510deceee656b6bc1c4fa0d82176e2b77e97a420a996a"},
|
||||
{file = "pycryptodome-3.23.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:89d4d56153efc4d81defe8b65fd0821ef8b2d5ddf8ed19df31ba2f00872b8002"},
|
||||
{file = "pycryptodome-3.23.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e3f2d0aaf8080bda0587d58fc9fe4766e012441e2eed4269a77de6aea981c8be"},
|
||||
{file = "pycryptodome-3.23.0-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:64093fc334c1eccfd3933c134c4457c34eaca235eeae49d69449dc4728079339"},
|
||||
{file = "pycryptodome-3.23.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:ce64e84a962b63a47a592690bdc16a7eaf709d2c2697ababf24a0def566899a6"},
|
||||
{file = "pycryptodome-3.23.0.tar.gz", hash = "sha256:447700a657182d60338bab09fdb27518f8856aecd80ae4c6bdddb67ff5da44ef"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pyflakes"
|
||||
version = "3.4.0"
|
||||
description = "passive checker of Python programs"
|
||||
optional = false
|
||||
python-versions = ">=3.9"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "pyflakes-3.4.0-py2.py3-none-any.whl", hash = "sha256:f742a7dbd0d9cb9ea41e9a24a918996e8170c799fa528688d40dd582c8265f4f"},
|
||||
{file = "pyflakes-3.4.0.tar.gz", hash = "sha256:b24f96fafb7d2ab0ec5075b7350b3d2d2218eab42003821c06344973d3ea2f58"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pygments"
|
||||
version = "2.19.2"
|
||||
description = "Pygments is a syntax highlighting package written in Python."
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "pygments-2.19.2-py3-none-any.whl", hash = "sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b"},
|
||||
{file = "pygments-2.19.2.tar.gz", hash = "sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
windows-terminal = ["colorama (>=0.4.6)"]
|
||||
|
||||
[[package]]
|
||||
name = "pyotp"
|
||||
version = "2.9.0"
|
||||
description = "Python One Time Password Library"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "pyotp-2.9.0-py3-none-any.whl", hash = "sha256:81c2e5865b8ac55e825b0358e496e1d9387c811e85bb40e71a3b29b288963612"},
|
||||
{file = "pyotp-2.9.0.tar.gz", hash = "sha256:346b6642e0dbdde3b4ff5a930b664ca82abfa116356ed48cc42c7d6590d36f63"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
test = ["coverage", "mypy", "ruff", "wheel"]
|
||||
|
||||
[[package]]
|
||||
name = "pysocks"
|
||||
version = "1.7.1"
|
||||
description = "A Python SOCKS client module. See https://github.com/Anorov/PySocks for more information."
|
||||
optional = false
|
||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "PySocks-1.7.1-py27-none-any.whl", hash = "sha256:08e69f092cc6dbe92a0fdd16eeb9b9ffbc13cadfe5ca4c7bd92ffb078b293299"},
|
||||
{file = "PySocks-1.7.1-py3-none-any.whl", hash = "sha256:2725bd0a9925919b9b51739eea5f9e2bae91e83288108a9ad338b2e3a4435ee5"},
|
||||
{file = "PySocks-1.7.1.tar.gz", hash = "sha256:3f8804571ebe159c380ac6de37643bb4685970655d3bba243530d6558b799aa0"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pytest"
|
||||
version = "8.4.2"
|
||||
description = "pytest: simple powerful testing with Python"
|
||||
optional = false
|
||||
python-versions = ">=3.9"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "pytest-8.4.2-py3-none-any.whl", hash = "sha256:872f880de3fc3a5bdc88a11b39c9710c3497a547cfa9320bc3c5e62fbf272e79"},
|
||||
{file = "pytest-8.4.2.tar.gz", hash = "sha256:86c0d0b93306b961d58d62a4db4879f27fe25513d4b969df351abdddb3c30e01"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
colorama = {version = ">=0.4", markers = "sys_platform == \"win32\""}
|
||||
exceptiongroup = {version = ">=1", markers = "python_version < \"3.11\""}
|
||||
iniconfig = ">=1"
|
||||
packaging = ">=20"
|
||||
pluggy = ">=1.5,<2"
|
||||
pygments = ">=2.7.2"
|
||||
tomli = {version = ">=1", markers = "python_version < \"3.11\""}
|
||||
|
||||
[package.extras]
|
||||
dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "requests", "setuptools", "xmlschema"]
|
||||
|
||||
[[package]]
|
||||
name = "python-mpd2"
|
||||
version = "3.1.1"
|
||||
description = "A Python MPD client library"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "python-mpd2-3.1.1.tar.gz", hash = "sha256:4baec3584cc43ed9948d5559079fafc2679b06b2ade273e909b3582654b2b3f5"},
|
||||
{file = "python_mpd2-3.1.1-py2.py3-none-any.whl", hash = "sha256:86bf1100a0b135959d74a9a7a58cf0515bf30bb54eb25ae6fb8e175e50300fc3"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
twisted = ["Twisted"]
|
||||
|
||||
[[package]]
|
||||
name = "requests"
|
||||
version = "2.32.5"
|
||||
description = "Python HTTP for Humans."
|
||||
optional = false
|
||||
python-versions = ">=3.9"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "requests-2.32.5-py3-none-any.whl", hash = "sha256:2462f94637a34fd532264295e186976db0f5d453d1cdd31473c85a6a161affb6"},
|
||||
{file = "requests-2.32.5.tar.gz", hash = "sha256:dbba0bac56e100853db0ea71b82b4dfd5fe2bf6d3754a8893c3af500cec7d7cf"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
certifi = ">=2017.4.17"
|
||||
charset_normalizer = ">=2,<4"
|
||||
idna = ">=2.5,<4"
|
||||
PySocks = {version = ">=1.5.6,<1.5.7 || >1.5.7", optional = true, markers = "extra == \"socks\""}
|
||||
urllib3 = ">=1.21.1,<3"
|
||||
|
||||
[package.extras]
|
||||
socks = ["PySocks (>=1.5.6,!=1.5.7)"]
|
||||
use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"]
|
||||
|
||||
[[package]]
|
||||
name = "tomli"
|
||||
version = "2.3.0"
|
||||
description = "A lil' TOML parser"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
groups = ["dev"]
|
||||
markers = "python_version < \"3.11\""
|
||||
files = [
|
||||
{file = "tomli-2.3.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:88bd15eb972f3664f5ed4b57c1634a97153b4bac4479dcb6a495f41921eb7f45"},
|
||||
{file = "tomli-2.3.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:883b1c0d6398a6a9d29b508c331fa56adbcdff647f6ace4dfca0f50e90dfd0ba"},
|
||||
{file = "tomli-2.3.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d1381caf13ab9f300e30dd8feadb3de072aeb86f1d34a8569453ff32a7dea4bf"},
|
||||
{file = "tomli-2.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a0e285d2649b78c0d9027570d4da3425bdb49830a6156121360b3f8511ea3441"},
|
||||
{file = "tomli-2.3.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:0a154a9ae14bfcf5d8917a59b51ffd5a3ac1fd149b71b47a3a104ca4edcfa845"},
|
||||
{file = "tomli-2.3.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:74bf8464ff93e413514fefd2be591c3b0b23231a77f901db1eb30d6f712fc42c"},
|
||||
{file = "tomli-2.3.0-cp311-cp311-win32.whl", hash = "sha256:00b5f5d95bbfc7d12f91ad8c593a1659b6387b43f054104cda404be6bda62456"},
|
||||
{file = "tomli-2.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:4dc4ce8483a5d429ab602f111a93a6ab1ed425eae3122032db7e9acf449451be"},
|
||||
{file = "tomli-2.3.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d7d86942e56ded512a594786a5ba0a5e521d02529b3826e7761a05138341a2ac"},
|
||||
{file = "tomli-2.3.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:73ee0b47d4dad1c5e996e3cd33b8a76a50167ae5f96a2607cbe8cc773506ab22"},
|
||||
{file = "tomli-2.3.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:792262b94d5d0a466afb5bc63c7daa9d75520110971ee269152083270998316f"},
|
||||
{file = "tomli-2.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4f195fe57ecceac95a66a75ac24d9d5fbc98ef0962e09b2eddec5d39375aae52"},
|
||||
{file = "tomli-2.3.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e31d432427dcbf4d86958c184b9bfd1e96b5b71f8eb17e6d02531f434fd335b8"},
|
||||
{file = "tomli-2.3.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7b0882799624980785240ab732537fcfc372601015c00f7fc367c55308c186f6"},
|
||||
{file = "tomli-2.3.0-cp312-cp312-win32.whl", hash = "sha256:ff72b71b5d10d22ecb084d345fc26f42b5143c5533db5e2eaba7d2d335358876"},
|
||||
{file = "tomli-2.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:1cb4ed918939151a03f33d4242ccd0aa5f11b3547d0cf30f7c74a408a5b99878"},
|
||||
{file = "tomli-2.3.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5192f562738228945d7b13d4930baffda67b69425a7f0da96d360b0a3888136b"},
|
||||
{file = "tomli-2.3.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:be71c93a63d738597996be9528f4abe628d1adf5e6eb11607bc8fe1a510b5dae"},
|
||||
{file = "tomli-2.3.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c4665508bcbac83a31ff8ab08f424b665200c0e1e645d2bd9ab3d3e557b6185b"},
|
||||
{file = "tomli-2.3.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4021923f97266babc6ccab9f5068642a0095faa0a51a246a6a02fccbb3514eaf"},
|
||||
{file = "tomli-2.3.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a4ea38c40145a357d513bffad0ed869f13c1773716cf71ccaa83b0fa0cc4e42f"},
|
||||
{file = "tomli-2.3.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ad805ea85eda330dbad64c7ea7a4556259665bdf9d2672f5dccc740eb9d3ca05"},
|
||||
{file = "tomli-2.3.0-cp313-cp313-win32.whl", hash = "sha256:97d5eec30149fd3294270e889b4234023f2c69747e555a27bd708828353ab606"},
|
||||
{file = "tomli-2.3.0-cp313-cp313-win_amd64.whl", hash = "sha256:0c95ca56fbe89e065c6ead5b593ee64b84a26fca063b5d71a1122bf26e533999"},
|
||||
{file = "tomli-2.3.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:cebc6fe843e0733ee827a282aca4999b596241195f43b4cc371d64fc6639da9e"},
|
||||
{file = "tomli-2.3.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:4c2ef0244c75aba9355561272009d934953817c49f47d768070c3c94355c2aa3"},
|
||||
{file = "tomli-2.3.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c22a8bf253bacc0cf11f35ad9808b6cb75ada2631c2d97c971122583b129afbc"},
|
||||
{file = "tomli-2.3.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0eea8cc5c5e9f89c9b90c4896a8deefc74f518db5927d0e0e8d4a80953d774d0"},
|
||||
{file = "tomli-2.3.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:b74a0e59ec5d15127acdabd75ea17726ac4c5178ae51b85bfe39c4f8a278e879"},
|
||||
{file = "tomli-2.3.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:b5870b50c9db823c595983571d1296a6ff3e1b88f734a4c8f6fc6188397de005"},
|
||||
{file = "tomli-2.3.0-cp314-cp314-win32.whl", hash = "sha256:feb0dacc61170ed7ab602d3d972a58f14ee3ee60494292d384649a3dc38ef463"},
|
||||
{file = "tomli-2.3.0-cp314-cp314-win_amd64.whl", hash = "sha256:b273fcbd7fc64dc3600c098e39136522650c49bca95df2d11cf3b626422392c8"},
|
||||
{file = "tomli-2.3.0-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:940d56ee0410fa17ee1f12b817b37a4d4e4dc4d27340863cc67236c74f582e77"},
|
||||
{file = "tomli-2.3.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:f85209946d1fe94416debbb88d00eb92ce9cd5266775424ff81bc959e001acaf"},
|
||||
{file = "tomli-2.3.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a56212bdcce682e56b0aaf79e869ba5d15a6163f88d5451cbde388d48b13f530"},
|
||||
{file = "tomli-2.3.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c5f3ffd1e098dfc032d4d3af5c0ac64f6d286d98bc148698356847b80fa4de1b"},
|
||||
{file = "tomli-2.3.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:5e01decd096b1530d97d5d85cb4dff4af2d8347bd35686654a004f8dea20fc67"},
|
||||
{file = "tomli-2.3.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:8a35dd0e643bb2610f156cca8db95d213a90015c11fee76c946aa62b7ae7e02f"},
|
||||
{file = "tomli-2.3.0-cp314-cp314t-win32.whl", hash = "sha256:a1f7f282fe248311650081faafa5f4732bdbfef5d45fe3f2e702fbc6f2d496e0"},
|
||||
{file = "tomli-2.3.0-cp314-cp314t-win_amd64.whl", hash = "sha256:70a251f8d4ba2d9ac2542eecf008b3c8a9fc5c3f9f02c56a9d7952612be2fdba"},
|
||||
{file = "tomli-2.3.0-py3-none-any.whl", hash = "sha256:e95b1af3c5b07d9e643909b5abbec77cd9f1217e6d0bca72b0234736b9fb1f1b"},
|
||||
{file = "tomli-2.3.0.tar.gz", hash = "sha256:64be704a875d2a59753d80ee8a533c3fe183e3f06807ff7dc2232938ccb01549"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "typing-extensions"
|
||||
version = "4.15.0"
|
||||
description = "Backported and Experimental Type Hints for Python 3.9+"
|
||||
optional = false
|
||||
python-versions = ">=3.9"
|
||||
groups = ["dev"]
|
||||
markers = "python_version < \"3.11\""
|
||||
files = [
|
||||
{file = "typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548"},
|
||||
{file = "typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "urllib3"
|
||||
version = "2.5.0"
|
||||
description = "HTTP library with thread-safe connection pooling, file post, and more."
|
||||
optional = false
|
||||
python-versions = ">=3.9"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "urllib3-2.5.0-py3-none-any.whl", hash = "sha256:e6b01673c0fa6a13e374b50871808eb3bf7046c4b125b216f6bf1cc604cff0dc"},
|
||||
{file = "urllib3-2.5.0.tar.gz", hash = "sha256:3fc47733c7e419d4bc3f6b3dc2b4f890bb743906a30d56ba4a5bfa4bbff92760"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
brotli = ["brotli (>=1.0.9) ; platform_python_implementation == \"CPython\"", "brotlicffi (>=0.8.0) ; platform_python_implementation != \"CPython\""]
|
||||
h2 = ["h2 (>=4,<5)"]
|
||||
socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"]
|
||||
zstd = ["zstandard (>=0.18.0)"]
|
||||
|
||||
[[package]]
|
||||
name = "waitress"
|
||||
version = "3.0.2"
|
||||
description = "Waitress WSGI server"
|
||||
optional = false
|
||||
python-versions = ">=3.9.0"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "waitress-3.0.2-py3-none-any.whl", hash = "sha256:c56d67fd6e87c2ee598b76abdd4e96cfad1f24cacdea5078d382b1f9d7b5ed2e"},
|
||||
{file = "waitress-3.0.2.tar.gz", hash = "sha256:682aaaf2af0c44ada4abfb70ded36393f0e307f4ab9456a215ce0020baefc31f"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
docs = ["Sphinx (>=1.8.1)", "docutils", "pylons-sphinx-themes (>=1.0.9)"]
|
||||
testing = ["coverage (>=7.6.0)", "pytest", "pytest-cov"]
|
||||
|
||||
[[package]]
|
||||
name = "werkzeug"
|
||||
version = "3.1.3"
|
||||
description = "The comprehensive WSGI web application library."
|
||||
optional = false
|
||||
python-versions = ">=3.9"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "werkzeug-3.1.3-py3-none-any.whl", hash = "sha256:54b78bf3716d19a65be4fceccc0d1d7b89e608834989dfae50ea87564639213e"},
|
||||
{file = "werkzeug-3.1.3.tar.gz", hash = "sha256:60723ce945c19328679790e3282cc758aa4a6040e4bb330f53d30fa546d44746"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
MarkupSafe = ">=2.1.1"
|
||||
|
||||
[package.extras]
|
||||
watchdog = ["watchdog (>=2.3)"]
|
||||
|
||||
[[package]]
|
||||
name = "yt-dlp"
|
||||
version = "2025.10.14"
|
||||
description = "A feature-rich command-line audio/video downloader"
|
||||
optional = false
|
||||
python-versions = ">=3.9"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "yt_dlp-2025.10.14-py3-none-any.whl", hash = "sha256:0b9da17eda1bbf48e2315130043d7993fd4ca1c5a35571f8231da1a910c9c115"},
|
||||
{file = "yt_dlp-2025.10.14.tar.gz", hash = "sha256:b18436aa9bb6f04354fd78d31ad9eeaae8c81b6a859f07072b25c18cd6c25844"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
build = ["build", "hatchling (>=1.27.0)", "pip", "setuptools (>=71.0.2,<81)", "wheel"]
|
||||
curl-cffi = ["curl-cffi (>=0.5.10,<0.6.dev0 || >=0.10.dev0,<0.14) ; implementation_name == \"cpython\""]
|
||||
default = ["brotli ; implementation_name == \"cpython\"", "brotlicffi ; implementation_name != \"cpython\"", "certifi", "mutagen", "pycryptodomex", "requests (>=2.32.2,<3)", "urllib3 (>=2.0.2,<3)", "websockets (>=13.0)"]
|
||||
dev = ["autopep8 (>=2.0,<3.0)", "pre-commit", "pytest (>=8.1,<9.0)", "pytest-rerunfailures (>=14.0,<15.0)", "ruff (>=0.13.0,<0.14.0)"]
|
||||
pyinstaller = ["pyinstaller (>=6.13.0)"]
|
||||
secretstorage = ["cffi", "secretstorage"]
|
||||
static-analysis = ["autopep8 (>=2.0,<3.0)", "ruff (>=0.13.0,<0.14.0)"]
|
||||
test = ["pytest (>=8.1,<9.0)", "pytest-rerunfailures (>=14.0,<15.0)"]
|
||||
|
||||
[[package]]
|
||||
name = "zipp"
|
||||
version = "3.23.0"
|
||||
description = "Backport of pathlib-compatible object wrapper for zip files"
|
||||
optional = false
|
||||
python-versions = ">=3.9"
|
||||
groups = ["main"]
|
||||
markers = "python_version < \"3.10\""
|
||||
files = [
|
||||
{file = "zipp-3.23.0-py3-none-any.whl", hash = "sha256:071652d6115ed432f5ce1d34c336c0adfd6a884660d1e9712a256d3d3bd4b14e"},
|
||||
{file = "zipp-3.23.0.tar.gz", hash = "sha256:a07157588a12518c9d4034df3fbbee09c814741a33ff63c05fa29d26a2404166"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1) ; sys_platform != \"cygwin\""]
|
||||
cover = ["pytest-cov"]
|
||||
doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"]
|
||||
enabler = ["pytest-enabler (>=2.2)"]
|
||||
test = ["big-O", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more_itertools", "pytest (>=6,!=8.1.*)", "pytest-ignore-flaky"]
|
||||
type = ["pytest-mypy"]
|
||||
|
||||
[metadata]
|
||||
lock-version = "2.1"
|
||||
python-versions = "^3.9.1"
|
||||
content-hash = "d38f0e6aa208b6302653888cb0ca19387144702f1a0d9503a3bed9ce0ae3593c"
|
||||
40
pyproject.toml
Normal file
@@ -0,0 +1,40 @@
|
||||
[tool.poetry]
|
||||
name = "deezer-downloader"
|
||||
version = "2.11.0"
|
||||
description = "download music from Deezer with a nice front end"
|
||||
authors = ["kmille <github@androidloves.me>"]
|
||||
readme = "README.md"
|
||||
packages = [{include = "deezer_downloader"}]
|
||||
repository = "https://github.com/kmille/deezer-downloader"
|
||||
homepage = "https://github.com/kmille/deezer-downloader"
|
||||
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.9.1"
|
||||
requests = {extras = ["socks"], version = "^2.28.2"}
|
||||
flask = "^3.0.3"
|
||||
python-mpd2 = "^3.0.5"
|
||||
yt-dlp = "*"
|
||||
pycryptodome = "^3.16.0"
|
||||
jinja2 = "^3.1.2"
|
||||
flask-autoindex = "^0.6.6"
|
||||
giphypop = "^0.3"
|
||||
waitress = "^3.0.0"
|
||||
mutagen = "^1.47.0"
|
||||
pyotp = "^2.9.0"
|
||||
|
||||
|
||||
[tool.poetry.group.dev.dependencies]
|
||||
pytest = "^8.3.2"
|
||||
flake8 = "^7.1.1"
|
||||
debugpy = "^1.8.17"
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry-core"]
|
||||
build-backend = "poetry.core.masonry.api"
|
||||
|
||||
[tool.poetry.scripts]
|
||||
deezer-downloader = 'deezer_downloader.cli.runner:main'
|
||||
|
||||
[tool.setuptools.package-data]
|
||||
deezer_downloader = ["cli/settings.ini.template"]
|
||||
0
tests/__init__.py
Normal file
367
tests/test_deezer_downloader.py
Normal file
@@ -0,0 +1,367 @@
|
||||
import os
|
||||
import unittest
|
||||
import pytest
|
||||
from pathlib import Path
|
||||
from mutagen.mp3 import MP3
|
||||
from mutagen.flac import FLAC
|
||||
from mutagen import MutagenError
|
||||
|
||||
from deezer_downloader.configuration import load_config
|
||||
|
||||
if "DEEZER_DOWNLOADER_CONFIG_FILE" in os.environ:
|
||||
config_file = Path(os.environ["DEEZER_DOWNLOADER_CONFIG_FILE"])
|
||||
else:
|
||||
config_file = (Path(__file__).parents[1] / Path("deezer_downloader") / Path("cli") / Path("deezer-downloader.ini.template")).resolve()
|
||||
|
||||
load_config(config_file)
|
||||
from deezer_downloader.configuration import config
|
||||
|
||||
from deezer_downloader.deezer import init_deezer_session, TYPE_TRACK, TYPE_ALBUM
|
||||
from deezer_downloader.deezer import deezer_search, get_song_infos_from_deezer_website, parse_deezer_playlist, download_song, get_deezer_favorites
|
||||
from deezer_downloader.deezer import Deezer404Exception, DeezerApiException
|
||||
from deezer_downloader.spotify import get_songs_from_spotify_website, SpotifyWebsiteParserException, parse_uri, SpotifyInvalidUrlException
|
||||
from deezer_downloader.youtubedl import youtubedl_download, YoutubeDLFailedException, DownloadedFileNotFoundException
|
||||
|
||||
known_song_keys = ["SNG_ID", "DURATION", "MD5_ORIGIN", "SNG_TITLE", "TRACK_NUMBER",
|
||||
"ALB_PICTURE", "MEDIA_VERSION", "ART_NAME", "ALB_TITLE"]
|
||||
|
||||
init_deezer_session(config['proxy']['server'],
|
||||
config["deezer"]["quality"])
|
||||
|
||||
|
||||
class TestDeezerMethods(unittest.TestCase):
|
||||
|
||||
# BEGIN: TEST deezer_search
|
||||
def test_deezer_search_song_valid(self):
|
||||
songs = deezer_search("Großstadtgeflüster diadem", TYPE_TRACK)
|
||||
self.assertIsInstance(songs, list)
|
||||
s = songs[0]
|
||||
self.assertSetEqual(set(s.keys()), {'preview_url', 'artist', 'id', 'id_type', 'album_id', 'title', 'img_url', 'album'})
|
||||
self.assertTrue(s['id'], '730393272')
|
||||
self.assertTrue(s['title'], 'Diadem')
|
||||
self.assertTrue(s['artist'], 'Grossstadtgeflüster')
|
||||
self.assertTrue(s['album'], 'Tips & Tricks')
|
||||
self.assertTrue(s['preview_url'], 'https://cdns-preview-6.dzcdn.net/stream/c-6abdd540dd7e7f02d2c4d21537709c23-3.mp3')
|
||||
self.assertTrue(s['album_id'], '107261872')
|
||||
self.assertTrue(s['id_type'], 'track')
|
||||
|
||||
def test_deezer_search_album_valid(self):
|
||||
albums = deezer_search("Coldplay", TYPE_ALBUM)
|
||||
self.assertIsInstance(albums, list)
|
||||
for album in albums:
|
||||
self.assertSetEqual(set(album.keys()), {'id', 'id_type', 'album', 'album_id', 'img_url', 'artist', 'title', 'preview_url'})
|
||||
|
||||
found_album_names = [x['album'] for x in albums]
|
||||
known_album_names = ['Parachutes', 'X&Y', 'A Head Full of Dreams']
|
||||
for known_album_name in known_album_names:
|
||||
self.assertIn(known_album_name, found_album_names)
|
||||
|
||||
def test_deezer_search_invalid_search_typ(self):
|
||||
songs = deezer_search("Coldplay", "this is a wrong search type")
|
||||
self.assertIsInstance(songs, list)
|
||||
self.assertListEqual(songs, [])
|
||||
|
||||
def test_deezer_search_song_invalid_no_song_found(self):
|
||||
songs = deezer_search("8f49834zf934fdshfkhejw", TYPE_TRACK)
|
||||
self.assertIsInstance(songs, list)
|
||||
self.assertListEqual(songs, [])
|
||||
|
||||
def test_deezer_search_album_invalid_no_song_found(self):
|
||||
songs = deezer_search("8f49834zf934fdshfkhejw", TYPE_ALBUM)
|
||||
self.assertIsInstance(songs, list)
|
||||
self.assertListEqual(songs, [])
|
||||
# END: TEST deezer_search
|
||||
|
||||
# BEGIN: TEST get_song_infos_from_deezer_website
|
||||
def test_get_track_infos_from_website(self):
|
||||
song = get_song_infos_from_deezer_website(TYPE_TRACK, "69962764")
|
||||
self.assertIsInstance(song, dict)
|
||||
song_keys = list(song.keys())
|
||||
for key in known_song_keys:
|
||||
self.assertIn(key, song_keys)
|
||||
self.assertEqual(song["SNG_ID"], "69962764")
|
||||
self.assertEqual(song["ART_NAME"], "The Clash")
|
||||
self.assertEqual(song["SNG_TITLE"], "Should I Stay or Should I Go")
|
||||
# MD5_ORIGIN changes over time
|
||||
#self.assertEqual(song["MD5_ORIGIN"], "df51967a8b9b88d079fb0d9f4a0c1c38")
|
||||
self.assertEqual(len(song["MD5_ORIGIN"]), 32)
|
||||
|
||||
def test_get_album_infos_from_website(self):
|
||||
songs = get_song_infos_from_deezer_website(TYPE_ALBUM, "1434890")
|
||||
self.assertIsInstance(songs, list)
|
||||
self.assertEqual(len(songs), 15)
|
||||
for song in songs:
|
||||
song_keys = list(song.keys())
|
||||
for key in known_song_keys:
|
||||
self.assertIn(key, song_keys)
|
||||
self.assertEqual(songs[0]["SNG_ID"], "15523769")
|
||||
self.assertEqual(songs[0]["ART_NAME"], "System of A Down")
|
||||
self.assertEqual(songs[0]["SNG_TITLE"], "Prison Song")
|
||||
self.assertEqual(len(songs[14]["MD5_ORIGIN"]), 32)
|
||||
self.assertEqual(songs[1]["SNG_ID"], "15523770")
|
||||
self.assertEqual(songs[1]["ART_NAME"], "System of A Down")
|
||||
self.assertEqual(songs[1]["SNG_TITLE"], "Needles")
|
||||
self.assertEqual(songs[2]["SNG_ID"], "15523772")
|
||||
self.assertEqual(songs[2]["ART_NAME"], "System of A Down")
|
||||
self.assertEqual(songs[2]["SNG_TITLE"], "Deer Dance")
|
||||
self.assertEqual(songs[3]["SNG_ID"], "15523775")
|
||||
self.assertEqual(songs[3]["ART_NAME"], "System of A Down")
|
||||
self.assertEqual(songs[3]["SNG_TITLE"], "Jet Pilot")
|
||||
self.assertEqual(songs[4]["SNG_ID"], "15523778")
|
||||
self.assertEqual(songs[4]["ART_NAME"], "System of A Down")
|
||||
self.assertEqual(songs[4]["SNG_TITLE"], "X")
|
||||
self.assertEqual(songs[5]["SNG_ID"], "15523781")
|
||||
self.assertEqual(songs[5]["ART_NAME"], "System of A Down")
|
||||
self.assertEqual(songs[5]["SNG_TITLE"], "Chop Suey!")
|
||||
self.assertEqual(songs[6]["SNG_ID"], "15523784")
|
||||
self.assertEqual(songs[6]["ART_NAME"], "System of A Down")
|
||||
self.assertEqual(songs[6]["SNG_TITLE"], "Bounce")
|
||||
self.assertEqual(songs[7]["SNG_ID"], "15523788")
|
||||
self.assertEqual(songs[7]["ART_NAME"], "System of A Down")
|
||||
self.assertEqual(songs[7]["SNG_TITLE"], "Forest")
|
||||
self.assertEqual(songs[8]["SNG_ID"], "15523790")
|
||||
self.assertEqual(songs[8]["ART_NAME"], "System of A Down")
|
||||
self.assertEqual(songs[8]["SNG_TITLE"], "ATWA")
|
||||
self.assertEqual(songs[9]["SNG_ID"], "15523791")
|
||||
self.assertEqual(songs[9]["ART_NAME"], "System of A Down")
|
||||
self.assertEqual(songs[9]["SNG_TITLE"], "Science")
|
||||
self.assertEqual(songs[10]["SNG_ID"], "15523792")
|
||||
self.assertEqual(songs[10]["ART_NAME"], "System of A Down")
|
||||
self.assertEqual(songs[10]["SNG_TITLE"], "Shimmy")
|
||||
self.assertEqual(songs[11]["SNG_ID"], "15523793")
|
||||
self.assertEqual(songs[11]["ART_NAME"], "System of A Down")
|
||||
self.assertEqual(songs[11]["SNG_TITLE"], "Toxicity")
|
||||
self.assertEqual(songs[12]["SNG_ID"], "15523796")
|
||||
self.assertEqual(songs[12]["ART_NAME"], "System of A Down")
|
||||
self.assertEqual(songs[12]["SNG_TITLE"], "Psycho")
|
||||
self.assertEqual(songs[13]["SNG_ID"], "15523799")
|
||||
self.assertEqual(songs[13]["ART_NAME"], "System of A Down")
|
||||
self.assertEqual(songs[13]["SNG_TITLE"], "Aerials")
|
||||
self.assertEqual(songs[14]["SNG_ID"], "15523803")
|
||||
self.assertEqual(songs[14]["ART_NAME"], "System of A Down")
|
||||
self.assertEqual(songs[14]["SNG_TITLE"], "Arto")
|
||||
|
||||
def test_get_invalid_track_infos_from_website(self):
|
||||
with self.assertRaises(Deezer404Exception):
|
||||
get_song_infos_from_deezer_website(TYPE_TRACK, "thisdoesnotexist")
|
||||
|
||||
def test_get_invalid_album_infos_from_website(self):
|
||||
with self.assertRaises(Deezer404Exception):
|
||||
get_song_infos_from_deezer_website(TYPE_ALBUM, "thisdoesnotexist")
|
||||
# END: TEST get_song_infos_from_deezer_website
|
||||
|
||||
# BEGIN: parse_deezer_playlist
|
||||
def _call_parse_valid_deezer_playlist(self, playlist):
|
||||
playlist_name, songs = parse_deezer_playlist(playlist)
|
||||
self.assertEqual(playlist_name, "test-playlist")
|
||||
self.assertIsInstance(songs, list)
|
||||
self.assertEqual(len(songs), 2)
|
||||
for song in songs:
|
||||
song_keys = list(song.keys())
|
||||
for key in known_song_keys:
|
||||
self.assertIn(key, song_keys)
|
||||
self.assertEqual(songs[0]["SNG_ID"], "113951680")
|
||||
self.assertEqual(songs[0]["ART_NAME"], 'Fredrika Stahl')
|
||||
self.assertEqual(songs[0]["SNG_TITLE"], 'Make a Change')
|
||||
# MD5_ORIGIN is only there if we are logged in
|
||||
self.assertEqual(songs[0]["MD5_ORIGIN"], '57250623592ef44c8caeead79917f7e5')
|
||||
|
||||
def test_parse_valid_deezer_playlist_with_url(self):
|
||||
playlist_url = "https://www.deezer.com/de/playlist/7639370122"
|
||||
self._call_parse_valid_deezer_playlist(playlist_url)
|
||||
|
||||
def test_parse_valid_deezer_playlist_with_id(self):
|
||||
playlist_id = "7639370122"
|
||||
self._call_parse_valid_deezer_playlist(playlist_id)
|
||||
|
||||
def test_parse_invalid_deezer_playlist_with_id(self):
|
||||
invalid_playlist_id = "999999999999999999999999999"
|
||||
with self.assertRaises(DeezerApiException):
|
||||
playlist_name, songs = parse_deezer_playlist(invalid_playlist_id)
|
||||
|
||||
def test_parse_invalid_input_for_deezer_playlist_with_id(self):
|
||||
invalid_playlist_id = "!\"§$%&/((;-';k(()=+ü\\?"
|
||||
with self.assertRaises(DeezerApiException):
|
||||
playlist_name, songs = parse_deezer_playlist(invalid_playlist_id)
|
||||
|
||||
def test_parse_invalid_deezer_playlist_with_url(self):
|
||||
invalid_playlist_url = "https://www.heise.de"
|
||||
with self.assertRaises(DeezerApiException):
|
||||
playlist_name, songs = parse_deezer_playlist(invalid_playlist_url)
|
||||
# END: parse_deezer_playlist
|
||||
|
||||
# BEGIN: get_deezer_favorites
|
||||
def test_get_deezer_favorites_userid_not_numeric(self):
|
||||
user_id = "123notnumeric"
|
||||
with self.assertRaises(Exception):
|
||||
get_deezer_favorites(user_id)
|
||||
|
||||
def test_get_deezer_favorites_userid_api_error(self):
|
||||
user_id = "0"
|
||||
with self.assertRaises(Exception):
|
||||
get_deezer_favorites(user_id)
|
||||
|
||||
def test_get_deezer_favorites_userid_valid(self):
|
||||
user_id = "2517244282" # own of test (works)
|
||||
songs = get_deezer_favorites(user_id)
|
||||
self.assertIsInstance(songs, list)
|
||||
for song in songs:
|
||||
self.assertIsInstance(song, int)
|
||||
# END: get_deezer_favorites
|
||||
|
||||
# BEGIN: download_song
|
||||
@pytest.mark.skipif(config["deezer"].get("quality", "mp3") == "flac", reason="skiping deezer mp3 download. Quality set to flac")
|
||||
def test_download_song_valid_mp3(self):
|
||||
def check_mp3_metadata_deezer_song(test_file: Path):
|
||||
self.assertTrue(test_song.exists())
|
||||
try:
|
||||
audio = MP3(test_file)
|
||||
except MutagenError as e:
|
||||
pytest.fail(f"File is not in mp3 format: {e}")
|
||||
self.assertEqual(audio['TPE1'].text[0], 'Faber')
|
||||
self.assertEqual(audio['TALB'].text[0], 'Alles Gute')
|
||||
self.assertEqual(audio['TIT2'].text[0], 'Tausendfrankenlang')
|
||||
self.assertEqual(audio['TRCK'].text[0], '4')
|
||||
self.assertEqual(audio['TDRC'].text[0].year, 2015)
|
||||
self.assertEqual(audio['TPOS'].text[0], '1')
|
||||
self.assertTrue('APIC:Cover' in audio)
|
||||
|
||||
test_song = Path("/tmp/song-548935.mp3")
|
||||
test_song.unlink(missing_ok=True)
|
||||
|
||||
song_infos = deezer_search("faber tausendfrankenlang", TYPE_TRACK)[0]
|
||||
song = get_song_infos_from_deezer_website(TYPE_TRACK, song_infos['id'])
|
||||
download_song(song, test_song.as_posix())
|
||||
check_mp3_metadata_deezer_song(test_song)
|
||||
test_song.unlink()
|
||||
|
||||
@pytest.mark.skipif(config["deezer"].get("quality", "mp3") == "mp3", reason="skiping deezer flac download. Quality set to mp3")
|
||||
def test_download_song_valid_flac(self):
|
||||
def check_flac_metadata_deezer_song(test_file: Path):
|
||||
try:
|
||||
audio = FLAC(test_file)
|
||||
except MutagenError as e:
|
||||
pytest.fail(f"File is not in mp3 format: {e}")
|
||||
|
||||
assert audio["artist"] == ["Faber",]
|
||||
assert audio["title"] == ['Tausendfrankenlang',]
|
||||
assert audio["album"] == ['Alles Gute',]
|
||||
assert audio["tracknumber"] == ['4',]
|
||||
assert audio["discnumber"] == ["1",]
|
||||
assert len(audio.pictures) == 1
|
||||
assert audio.pictures[0].data[:5] == b'\xff\xd8\xff\xe0\x00'
|
||||
|
||||
test_song = Path("/tmp/song-548935.flac")
|
||||
test_song.unlink(missing_ok=True)
|
||||
|
||||
song_infos = deezer_search("faber tausendfrankenlang", TYPE_TRACK)[0]
|
||||
song = get_song_infos_from_deezer_website(TYPE_TRACK, song_infos['id'])
|
||||
download_song(song, test_song.as_posix())
|
||||
check_flac_metadata_deezer_song(test_song)
|
||||
test_song.unlink()
|
||||
|
||||
def test_download_song_invalid_song_type(self):
|
||||
with self.assertRaises(AssertionError):
|
||||
download_song("this sould be a dict", "/not/relevant/outputfile.mp3")
|
||||
# END: download_song
|
||||
|
||||
|
||||
class TestSpotifyMethods(unittest.TestCase):
|
||||
# BEGIN parse_uri
|
||||
def test_parse_url_spotify(self):
|
||||
res = parse_uri("spotify:album:Hksdhfaif23ffushef9823")
|
||||
self.assertEqual(res['type'], "album")
|
||||
self.assertEqual(res['id'], "Hksdhfaif23ffushef9823")
|
||||
|
||||
res = parse_uri("spotify:playlist:Hksdhfaif23ffushef9823")
|
||||
self.assertEqual(res['type'], "playlist")
|
||||
self.assertEqual(res['id'], "Hksdhfaif23ffushef9823")
|
||||
|
||||
res = parse_uri("spotify:track:Hksdhfaif23ffushef9823")
|
||||
self.assertEqual(res['type'], "track")
|
||||
self.assertEqual(res['id'], "Hksdhfaif23ffushef9823")
|
||||
|
||||
def test_parse_url_open_domain(self):
|
||||
res = parse_uri("https://open.spotify.com/track/Hksdhfaif23ffushef9823")
|
||||
self.assertEqual(res['type'], "track")
|
||||
self.assertEqual(res['id'], "Hksdhfaif23ffushef9823")
|
||||
|
||||
def test_parse_url_play_domain(self):
|
||||
res = parse_uri("https://play.spotify.com/track/Hksdhfaif23ffushef9823")
|
||||
self.assertEqual(res['type'], "track")
|
||||
self.assertEqual(res['id'], "Hksdhfaif23ffushef9823")
|
||||
|
||||
def test_parse_url_embed_domain(self):
|
||||
res = parse_uri("https://embed.spotify.com/?uri=spotify:track:Hksdhfaif23ffushef9823")
|
||||
self.assertEqual(res['type'], "track")
|
||||
self.assertEqual(res['id'], "Hksdhfaif23ffushef9823")
|
||||
# END parse_uri
|
||||
|
||||
# BEGIN test invalid
|
||||
def test_spotify_parser_invalid_playlist_id(self):
|
||||
playlist_id = "thisdoesnotexist"
|
||||
with self.assertRaises(SpotifyWebsiteParserException):
|
||||
get_songs_from_spotify_website(playlist_id, None)
|
||||
|
||||
def test_spotify_parser_invalid_playlist_url(self):
|
||||
playlist_url = "https://www.heise.de"
|
||||
with self.assertRaises(SpotifyInvalidUrlException):
|
||||
get_songs_from_spotify_website(playlist_url, None)
|
||||
# END test invalid
|
||||
|
||||
# BEGIN valid stuff
|
||||
def check_parse_spotify_playlist_website(self, playlist):
|
||||
songs = get_songs_from_spotify_website(playlist, None)
|
||||
self.assertIn("Cyndi Lauper Time After Time", songs)
|
||||
|
||||
def test_spotify_parser_valid_playlist_embed_url(self):
|
||||
playlist_url = "https://open.spotify.com/embed/playlist/0wl9Q3oedquNlBAJ4MGZtS"
|
||||
self.check_parse_spotify_playlist_website(playlist_url)
|
||||
|
||||
def test_spotify_parser_valid_playlist_url(self):
|
||||
playlist_url = "https://open.spotify.com/playlist/0wl9Q3oedquNlBAJ4MGZtS"
|
||||
self.check_parse_spotify_playlist_website(playlist_url)
|
||||
|
||||
def test_spotify_parser_valid_playlist_id(self):
|
||||
playlist_id = "0wl9Q3oedquNlBAJ4MGZtS"
|
||||
self.check_parse_spotify_playlist_website(playlist_id)
|
||||
# END valid stuff
|
||||
|
||||
|
||||
class TestYoutubeMethods(unittest.TestCase):
|
||||
is_github_ci = len(os.environ.get("GITHUB_ACTION", "")) > 0
|
||||
|
||||
@pytest.mark.xfail(is_github_ci, reason="Fails with 'Sign in to confirm you’re not a bot. This helps protect our community. Learn more'", raises=YoutubeDLFailedException)
|
||||
def test_youtube_dl_valid_url(self):
|
||||
out_file = Path("/tmp/Pharrell Williams - Happy (Video).mp3")
|
||||
out_file.unlink(missing_ok=True)
|
||||
url = "https://www.youtube.com/watch?v=ZbZSe6N_BXs"
|
||||
destination_file = youtubedl_download(url, "/tmp")
|
||||
self.assertEqual(out_file.as_posix(), destination_file)
|
||||
self.assertTrue(out_file.exists())
|
||||
try:
|
||||
audio = MP3(out_file)
|
||||
self.assertEqual(audio['TPE1'].text[0], 'Pharrell Williams')
|
||||
self.assertEqual(audio['TIT2'].text[0], 'Pharrell Williams - Happy (Video)')
|
||||
except MutagenError as e:
|
||||
pytest.fail(f"File is not in mp3 format: {e}")
|
||||
out_file.unlink()
|
||||
|
||||
def test_youtube_dl_invalid_url(self):
|
||||
url = "https://www.heise.de"
|
||||
with self.assertRaises(YoutubeDLFailedException):
|
||||
youtubedl_download(url, "/tmp")
|
||||
|
||||
@pytest.mark.xfail(is_github_ci, reason="Fails with 'Sign in to confirm you’re not a bot. This helps protect our community. Learn more'", raises=YoutubeDLFailedException)
|
||||
def test_youtube_dl_command_execution(self):
|
||||
url = "https://www.youtube.com/watch?v=ZbZSe6N_BXs&$(touch /tmp/pwned.txt)"
|
||||
try:
|
||||
youtubedl_download(url, "/tmp")
|
||||
except DownloadedFileNotFoundException:
|
||||
pytest.xfail("Fails if the file already exists from the previous test. TODO")
|
||||
pwn_succeeded = os.path.exists("/tmp/pwned.txt")
|
||||
self.assertEqual(pwn_succeeded, False)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||