## d-fi <img src="https://notabug.org/sayem314/d-fi/raw/master/assets/logo.png" width="80" height="80" style="vertical-align:middle;margin:5px;background-color:white" />

> A streaming music downloader.

![Screenshot](https://notabug.org/sayem314/d-fi/raw/master/assets/screenshot.png)

**d-fi is a program for downloading music from streaming music services. Remember that the artists and studios put a lot of work into making music - purchase the original music to support them.**

### v2 Migration Guide

Please read [here](https://notabug.org/sayem314/d-fi/src/master/docs/migration_v2.md)

### Features

- _Supports downloading tracks, albums, artists, and playlists_
- _Allows music quality selection (**128 kbps**, **320 kbps** and **FLAC**)_
- _Auto tagging **MP3** & **FLAC** (including album cover and lyrics)_
- _Support downloading from both links and via searching_

### Supported Sites

#### _Deezer_, _Spotify_ and _Tidal_

- _Tracks_
- _Albums_
- _Audiobook_
- _Playlists_
- _Artists_

> Note that Spotify and Tidal tracks will be sourced from Deezer using ISRC matching and UPC for albums. Also Spotify artist tracks are limited upto 10 items.

### Install

#### _Method 1_

First install `nodejs` following [this tutorial](https://nodejs.org/en/download/package-manager/)

Once `nodejs` installation is complete run this command.

    sudo npm i -g d-fi

or if you are using yarn

    yarn global add d-fi

Now you can run using command `d-fi` to start.

#### _Method 2_

Download pre-built binary from [here](https://github.com/d-fi/releases/releases) and then double click on Windows to run. For Linux and macOS user, first open your choice of terminal and the execute with `./d-fi`

### CLI Parameters

All options are optional. You can suppress prompts via providing `quality` and `url` if you are using scripts. You can also use config file. Read the docs [here](https://notabug.org/sayem314/d-fi/src/master/docs/config.md)

| Parameter             |      Short      |                                                      Supported values                                                      |                                                                  Description                                                                  |
| :-------------------- | :-------------: | :------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------: |
| `--quality`           |      `-q`       |                                                        128/320/flac                                                        |                                                     The quality of the files to download                                                      |
| `--output`            |      `-o`       | Output file format according to `saveLayout`. See more [here](https://notabug.org/sayem314/d-fi/src/master/docs/config.md) |                                                       The path to download the files to                                                       |
| `--url`               | `-u or nothing` |                                              album/artist/playlist/track url                                               |                                                              Downloads from url                                                               |
| `--input-file`        |      `-i`       |                            Downloads all urls listed in text file. Example: `d-fi -i links.txt`                            |                                                              Downloads from url                                                               |
| `--concurrency`       |  `-c` 1 to 50   |                                                Downloads X songs at a time                                                 |
| `--set-arl`           |      `-a`       |                                                        `arl` string                                                        |                                                                Set arl cookies                                                                |
| `--headless`          |      `-d`       |                                                         _Nothing_                                                          | Run in headless mode. You must provide both `--url` and `--quality` if you run in headless mode. This mode is meant for scripting automation. |
| `--resolve-full-path` |     `-rfp`      |                                                         _Nothing_                                                          |                                               Create playlist file with absolute path location                                                |
| `--create-playlist`   |      `-cp`      |                                                         _Nothing_                                                          |                                                    Create playlist for albums and artists                                                     |
| `--config-file`       |     `-conf`     |                                 Config location. Example: `d-fi -conf my-d-fi.config.json`                                 |                                                    Specify custom location to config file                                                     |
| `--update`            |      `-U`       |                                                         _Nothing_                                                          |                                                       Download new update (binary only)                                                       |
| `--help`              |      `-h`       |                                                         _Nothing_                                                          |                                                              Shows the CLI help                                                               |

## Search Parameters

|   Prefix    |   Description   |
| :---------: | :-------------: |
|  `artist:`  |  Search artist  |
|  `album:`   |  Search album   |
| `playlist:` | Search playlist |

### Donations

If you want to show your appreciation, you can donate me on [here](https://sayem.eu.org/donate). Thanks!

> Telegram community group: [@dFiCommunity](https://t.me/dFiCommunity)

### Disclaimer

> d-fi was not developed for pirating music but educational and private usage.
>
> It may be illegal to use this in your country,
>
> I am not responsible in any way for the usage of others.

---

> Made with :heart: & :coffee: by Sayem
>
> Based on SMLoadr and Deezloader Remix
