diff --git a/.gitignore b/.gitignore index c60bfd8..6512e80 100644 --- a/.gitignore +++ b/.gitignore @@ -1,155 +1,5 @@ -Qobuz Downloads -Downloads -tests -*__pycache* -.env -__pycache__/ -*.py[cod] -*$py.class -.bumpversion.cfg -/*.py -!/setup.py - -# C extensions -*.so - -*.json -*.db -*.sh - - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -*.py,cover -.hypothesis/ -.pytest_cache/ -cover/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 -db.sqlite3-journal - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -.pybuilder/ -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -# For a library or package, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# .python-version - -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -#Pipfile.lock - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow -__pypackages__/ - -# Celery stuff -celerybeat-schedule -celerybeat.pid - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ - -# pytype static type analyzer -.pytype/ - -# Cython debug symbols -cython_debug/ -*.yaml -*.flac -*.m4a -*.ogg -*.mp3 +__pycache__ +*.egg-info +secrets.py +dist +build diff --git a/README.md b/README.md new file mode 100644 index 0000000..06d4991 --- /dev/null +++ b/README.md @@ -0,0 +1,80 @@ +# streamrip + +A scriptable stream downloader for Qobuz, Tidal, and Deezer. + + + +## Installation + +```bash +pip3 install streamrip +``` + + + +## Basic Usage + +**For Tidal and Qobuz, you NEED a premium subscription.** + +Download an album from Qobuz + +```bash +rip -u https://open.qobuz.com/album/0060253780968 +``` + +Download the album and convert it to `mp3` + +```bash +rip --convert mp3 -u https://open.qobuz.com/album/0060253780968 +``` + +Search for *Fleetwood Mac - Rumours* on Qobuz + +```bash +rip search 'fleetwood mac rumours' +``` + +![streamrip interactive search](demo/interactive_search.png) + +Search for *Rumours* on Tidal, download it, convert it to `ALAC` + +```bash +rip -c alac search 'fleetwood mac rumours' +``` + +Qobuz discographies can be filtered using the `filter` subcommand + +```bash +rip filter --repeats --features 'https://open.qobuz.com/artist/22195' +``` + + + +Want to find some new music? Use the `discover` command (only on Qobuz) + +```bash +rip discover --list 'best-sellers' +``` + + + +For more help and examples + +```bash +rip --help +``` + +```bash +rip filter --help +``` + +```bash +rip search --help +``` + +```bash +rip discover --help +``` + +**This tool is still in development. If there are any features you would like to see, please open an issue.** + diff --git a/demo/interactive_search.png b/demo/interactive_search.png new file mode 100644 index 0000000..6d3a6b4 Binary files /dev/null and b/demo/interactive_search.png differ diff --git a/streamrip/clients.py b/streamrip/clients.py index 9ea2cba..9ef9c65 100644 --- a/streamrip/clients.py +++ b/streamrip/clients.py @@ -1,4 +1,5 @@ import datetime +import click import hashlib import logging import os @@ -122,6 +123,7 @@ class QobuzClient(ClientInterface): :type pwd: str :param kwargs: app_id: str, secrets: list, return_secrets: bool """ + click.secho(f"Logging into {self.source}", fg='green') if self.logged_in: logger.debug("Already logged in") return @@ -421,6 +423,7 @@ class TidalClient(ClientInterface): self.logged_in = False def login(self, email: str, pwd: str): + click.secho(f"Logging into {self.source}", fg='green') if self.logged_in: return diff --git a/test.py b/test.py new file mode 100644 index 0000000..bfa3c77 --- /dev/null +++ b/test.py @@ -0,0 +1,40 @@ +import base64 +import json +import logging +import re +import sys +from pprint import pprint + +# from music_dl.config import Config +# from music_dl.constants import URL_REGEX +from music_dl.cli import main + +# from music_dl.core import MusicDL + +# import requests +# from tqdm import tqdm +logger = logging.basicConfig(level=logging.DEBUG) + +main() + + +""" +client = TidalClient() +client.login(**config.creds(client.source)) +# https://www.qobuz.com/us-en/label/rhino/download-streaming-albums/7425 +# https://www.qobuz.com/us-en/album/chemtrails-over-the-country-club-lana-del-rey/dmm832vafkjdc +album = Album(id='dmm832vafkjdc', client=client) +album.load_meta() +album.download(embed_cover=True) +album.convert('ALAC') +""" + +s = """ +# converts everything +https://open.qobuz.com/album/ +rumours tidal: 68714459 +https://open.qobuz.com/album/uhy28719w8ybb +https://open.qobuz.com/playlist/5800943 +https://open.qobuz.com/artist/11877118774 +https://open.qobuz.com/track/19512574 +"""