streamrip/README.md

247 lines
8.7 KiB
Markdown
Raw Normal View History

2021-03-25 19:19:12 +01:00
# streamrip
2021-05-04 07:34:26 +02:00
[![Downloads](https://static.pepy.tech/personalized-badge/streamrip?period=total&units=international_system&left_color=black&right_color=green&left_text=Downloads)](https://pepy.tech/project/streamrip)
2021-03-25 19:19:12 +01:00
2021-05-07 07:03:55 +02:00
2021-04-06 06:09:51 +02:00
A scriptable stream downloader for Qobuz, Tidal, Deezer and SoundCloud.
2021-03-25 19:19:12 +01:00
2021-04-14 02:00:00 +02:00
2021-03-29 23:08:26 +02:00
## Features
2021-03-25 19:19:12 +01:00
2021-04-13 01:12:36 +02:00
- Super fast, as it utilizes concurrent downloads and conversion
2021-04-06 06:09:51 +02:00
- Downloads tracks, albums, playlists, discographies, and labels from Qobuz, Tidal, Deezer, and SoundCloud
2021-04-21 18:40:33 +02:00
- Supports downloads of Spotify and Apple Music playlists through [last.fm](https://www.last.fm)
2021-03-29 23:08:26 +02:00
- Automatically converts files to a preferred format
- Has a database that stores the downloaded tracks' IDs so that repeats are avoided
- Easy to customize with the config file
2021-05-04 00:44:25 +02:00
- Integration with `youtube-dl`
2021-03-25 19:19:12 +01:00
## Installation
2021-03-30 01:02:33 +02:00
First, ensure [pip](https://pip.pypa.io/en/stable/installing/) is installed. Then run the following in the command line:
2021-03-29 23:08:26 +02:00
2021-03-30 19:19:14 +02:00
2021-03-30 19:40:22 +02:00
macOS/Linux:
2021-03-30 19:19:14 +02:00
2021-03-25 19:19:12 +01:00
```bash
2021-03-30 22:37:19 +02:00
pip3 install streamrip simple-term-menu --upgrade
2021-03-25 19:19:12 +01:00
```
2021-03-30 19:40:22 +02:00
Windows:
2021-03-30 19:19:14 +02:00
```bash
2021-03-30 22:37:19 +02:00
pip3 install streamrip windows-curses --upgrade
2021-03-30 19:19:14 +02:00
```
2021-05-04 10:16:48 +02:00
If you would like to use `streamrip`'s conversion capabilities, download TIDAL videos, or download music from SoundCloud, install [ffmpeg](https://ffmpeg.org/download.html).
2021-03-30 19:19:14 +02:00
2021-03-25 19:19:12 +01:00
2021-03-29 23:08:26 +02:00
## Example Usage
2021-03-25 19:19:12 +01:00
**For Tidal and Qobuz, you NEED a premium subscription.**
Download an album from Qobuz
```bash
rip -u https://open.qobuz.com/album/0060253780968
```
2021-03-30 19:32:44 +02:00
![Streamrip downloading an album](https://github.com/nathom/streamrip/blob/main/demo/download_url.png?raw=true)
2021-03-25 19:19:12 +01:00
Download the album and convert it to `mp3`
```bash
rip --convert mp3 -u https://open.qobuz.com/album/0060253780968
```
2021-03-29 23:11:58 +02:00
2021-03-29 21:12:50 +02:00
To set the quality, use the `--quality` option to `0, 1, 2, 3, 4`:
2021-04-06 06:09:51 +02:00
| Quality ID | Audio Quality | Available Sources |
| ---------- | --------------------- | -------------------------------------------- |
| 0 | 128 kbps MP3 or AAC | Deezer, Tidal, SoundCloud (most of the time) |
| 1 | 320 kbps MP3 or AAC | Deezer, Tidal, Qobuz, SoundCloud (rarely) |
| 2 | 16 bit, 44.1 kHz (CD) | Deezer, Tidal, Qobuz, SoundCloud (rarely) |
| 3 | 24 bit, ≤ 96 kHz | Tidal (MQA), Qobuz, SoundCloud (rarely) |
| 4 | 24 bit, ≤ 192 kHz | Qobuz |
2021-03-29 21:12:50 +02:00
2021-03-29 23:11:58 +02:00
2021-03-29 21:12:50 +02:00
```bash
rip --quality 3 https://tidal.com/browse/album/147569387
```
2021-04-06 06:09:51 +02:00
Search for albums matching `lil uzi vert` on SoundCloud
2021-03-25 19:19:12 +01:00
```bash
2021-04-06 06:09:51 +02:00
rip search -s soundcloud 'lil uzi vert'
2021-03-25 19:19:12 +01:00
```
2021-03-29 23:30:20 +02:00
![streamrip interactive search](https://github.com/nathom/streamrip/blob/main/demo/interactive_search.png?raw=true)
2021-03-25 19:19:12 +01:00
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'
```
2021-03-29 23:11:58 +02:00
> Avaiable options for `--list`:
>
> - most-streamed
> - recent-releases
> - best-sellers
> - press-awards
> - ideal-discography
> - editor-picks
> - most-featured
> - qobuzissims
> - new-releases
> - new-releases-full
> - harmonia-mundi
> - universal-classic
> - universal-jazz
> - universal-jeunesse
> - universal-chanson
## The Config File
This is where most of streamrip's functionality can be controlled. Here are
the descriptions of the fields. They can also be found inside the file, which
can be accessed with `rip config --open`.
```yaml
2021-04-20 18:48:39 +02:00
qobuz:
quality: '1: 320kbps MP3, 2: 16/44.1, 3: 24/<=96, 4: 24/>=96'
2021-04-20 18:48:39 +02:00
download_booklets: 'This will download booklet pdfs that are included with some albums'
password: 'This is an md5 hash of the plaintext password'
app_id: 'Do not change'
secrets: 'Do not change'
tidal:
2021-04-20 18:48:39 +02:00
quality: '0: 256kbps AAC, 1: 320kbps AAC, 2: 16/44.1 "HiFi" FLAC, 3: 24/44.1 "MQA" FLAC'
download_videos: 'This will download videos included in Video Albums.'
user_id: 'Do not change any of the fields below'
token_expiry: 'Tokens last 1 week after refresh. This is the Unix timestamp of the expiration time.'
deezer: "Deezer doesn't require login"
quality: '0, 1, or 2'
soundcloud:
quality: 'Only 0 is available'
database: 'This stores a list of item IDs so that repeats are not downloaded.'
filters: "Filter a Qobuz artist's discography. Set to 'true' to turn on a filter."
extras: 'Remove Collectors Editions, live recordings, etc.'
repeats: 'Picks the highest quality out of albums with identical titles.'
non_albums: 'Remove EPs and Singles'
features: 'Remove albums whose artist is not the one requested'
non_remaster: 'Only download remastered albums'
downloads:
folder: 'Folder where tracks are downloaded to'
source_subdirectories: "Put Qobuz albums in a 'Qobuz' folder, Tidal albums in 'Tidal' etc."
artwork:
embed: 'Write the image to the audio file'
size: "The size of the artwork to embed. Options: thumbnail, small, large, original. 'original' images can be up to 30MB, and may fail embedding. Using 'large' is recommended."
keep_hires_cover: 'Save the cover image at the highest quality as a seperate jpg file'
metadata: 'Only applicable for playlist downloads.'
set_playlist_to_album: "Sets the value of the 'ALBUM' field in the metadata to the playlist's name. This is useful if your music library software organizes tracks based on album name."
new_playlist_tracknumbers: "Replaces the original track's tracknumber with it's position in the playlist"
path_format: 'Changes the folder and file names generated by streamrip.'
folder: 'Available keys: "albumartist", "title", "year", "bit_depth", "sampling_rate", and "container"'
track: 'Available keys: "tracknumber", "artist", "albumartist", "composer", and "title"'
lastfm: 'Last.fm playlists are downloaded by searching for the titles of the tracks'
source: 'The source on which to search for the tracks.'
concurrent_downloads: 'Download (and convert) tracks all at once, instead of sequentially. If you are converting the tracks, and/or have fast internet, this will substantially improve processing speed.'
2021-04-20 18:48:39 +02:00
```
2021-04-23 01:54:07 +02:00
## Integration with macOS Music app
`streamrip` was designed to be used seamlessly with the macOS Music app. To set it up, you need to find the `Automatically Add to Music.localized` folder inside the file given at `Music.app -> Preferences -> Files -> Music Media folder location`. Set the downloads folder to the path in the config file.
Next, enable `conversion` and set the `codec` to `alac`. If you want to save space, set `sampling_rate` to `48000`. Finally, set `keep_hires_cover` to `false`.
Now, you can download anything and it will appear in your Library!
2021-03-25 19:19:12 +01:00
2021-04-06 06:54:21 +02:00
## Troubleshooting
2021-04-22 01:52:47 +02:00
If you're getting an error that looks something like `command not found: rip`, make sure the location of the `rip` executable is on the `$PATH` (`PATH` for Windows) environment variable.
If you're having other issues with the tool, try the following:
2021-03-25 19:19:12 +01:00
2021-04-14 20:49:45 +02:00
- Consult the help pages and their example commands.
```bash
rip --help
2021-04-15 04:01:43 +02:00
rip filter --help
2021-04-14 20:49:45 +02:00
rip search --help
2021-04-15 04:01:43 +02:00
rip discover --help
2021-04-14 20:49:45 +02:00
rip config --help
2021-04-15 04:01:43 +02:00
rip lastfm --help
2021-04-14 20:49:45 +02:00
```
- Update `streamrip` with by running `pip3 install streamrip --upgrade`
- Reset the config file with `rip config --reset`
2021-04-14 20:54:29 +02:00
If none of the above work, open an [issue](#guidelines-for-opening-issues).
2021-04-06 06:54:21 +02:00
## Contributions
2021-04-14 20:49:45 +02:00
All contributions are appreciated! You can help out the project by opening an issue
or by submitting code.
### Guidelines for opening issues
- Include a general description of the feature request or bug in the title
- Limit each Issue to a single subject
2021-04-14 20:54:29 +02:00
- For bug reports, include the traceback, command (including the url) you used,
and version of `streamrip`
2021-04-14 20:49:45 +02:00
### Contributing code
If you're new to Git, follow these steps to open your first Pull Request (PR):
2021-04-06 06:54:21 +02:00
- Fork this repository
- Clone the new repository
- Commit your changes
- Open a pull request to the `dev` branch
Please document any functions or obscure lines of code.
2021-03-25 19:19:12 +01:00
2021-03-29 23:19:23 +02:00
## Acknowledgements
Thanks to Vitiko98, Sorrow446, and DashLt for their contributions to this project, and the previous projects that made this one possible.
`streamrip` was inspired by:
- [qobuz-dl](https://github.com/vitiko98/qobuz-dl)
- [Qo-DL Reborn](https://github.com/badumbass/Qo-DL-Reborn)
2021-03-29 23:23:22 +02:00
- [Tidal-Media-Downloader](https://github.com/yaronzz/Tidal-Media-Downloader)
2021-04-06 06:09:51 +02:00
- [scdl](https://github.com/flyingrub/scdl)
2021-03-29 23:23:22 +02:00
## Disclaimer
2021-04-13 01:12:36 +02:00
I will not be responsible for how you use `streamrip`. By using `streamrip`, you agree to the terms and conditions of the Qobuz, Tidal, and Deezer APIs.