# @nadim147/spdl

> A yt-dlp downloader that uses Spotify track metadata.

Latest version **1.5.0** (published 2024-01-16) · LGPL-3.0-only license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @nadim147/spdl
pnpm add @nadim147/spdl
yarn add @nadim147/spdl
bun add @nadim147/spdl
```

Provides the command `spdl`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.5.0 |
| Published | 2024-01-16 |
| First published | 2023-10-29 |
| Weekly downloads | 0 |
| License | LGPL-3.0-only |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 9 |
| Unpacked size | 166.2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Nadim147c |
| Maintainers | nadim147 |
| Keywords | spotify, yt-dlp, playlist, youtube |

## Links

- npm: https://www.npmjs.com/package/@nadim147/spdl
- Repository: https://github.com/Nadim147c/SPDL
- Homepage: https://github.com/Nadim147c/SPDL#readme
- Issues: https://github.com/Nadim147c/SPDL/issues
- npm.io page: https://npm.io/package/@nadim147/spdl

## Dependencies (9)

- [ora](https://npm.io/package/ora.md) ^7.0.1
- [zod](https://npm.io/package/zod.md) ^3.22.4
- [axios](https://npm.io/package/axios.md) ^1.6.5
- [chalk](https://npm.io/package/chalk.md) ^5.3.0
- [dotenv](https://npm.io/package/dotenv.md) ^16.3.1
- [inquirer](https://npm.io/package/inquirer.md) ^9.2.12
- [node-id3](https://npm.io/package/node-id3.md) ^0.2.6
- [youtubei.js](https://npm.io/package/youtubei.js.md) ^8.2.0
- [@commander-js/extra-typings](https://npm.io/package/@commander-js/extra-typings.md) ^11.1.0

## Recent versions

- 1.5.0 (latest) — 2024-01-16
- 1.4.1 — 2024-01-16
- 1.4.0 — 2024-01-11
- 1.3.1 — 2024-01-10
- 1.3.0 — 2024-01-10
- 1.2.1 — 2024-01-08
- 1.2.0 — 2024-01-07
- 1.1.0 — 2024-01-04
- 1.0.2 — 2023-12-31
- 1.0.1 — 2023-12-24
- 1.0.0 — 2023-12-12
- 0.6.1 — 2023-12-11
- 0.6.0 — 2023-12-11
- 0.5.0 — 2023-12-09
- 0.4.3 — 2023-12-08
- … 9 more at https://npm.io/package/@nadim147/spdl/versions

## README

# SPDL

SPDL is a YouTube-DL (yt-dlp) based tool that allows you to download music while adding metadata from Spotify. It enhances your music library by pulling track information from Spotify and applying it to your downloaded music files. It also allows you to save you spotify playlist in folder/directory.

-   [Requirements](#requirements)
-   [Installation](#installation)
    -   [Auto Installation](#auto-installation)
    -   [Manual Installation](#manual-installation)
    -   [Post installation](#post-installation)
-   [Usage](#usage)
-   [Commands](#Commands)
-   [Issues and Contribution](#issues-and-contribution)
-   [License And Credits](#license-and-credits)

## Requirements

Before using this tool, ensure you have the following prerequisites installed on your system:

-   **Node**: v21.0.0 or Higher. You can find it from [here](https://nodejs.org/).
-   **Yt-dlp**: Ensure you have the latest version of Yt-dlp. You can find it on [GitHub](https://github.com/yt-dlp/yt-dlp/wiki/Installation).
-   **ffmpeg**: Lastest or the minimum version required by `yt-dlp`. You can find it from [here](https://www.ffmpeg.org/download.html).

You can use various package managers to install these prerequisites. Here are some examples:

**Windows**:

> **Note**: Winget isn't installed by default on windows 10. Run `winget` to check if it's installed or not.
> You can install it from [Microsoft Store](https://apps.microsoft.com/detail/9NBLGGH4NNS1) or [GitHub](https://github.com/microsoft/winget-cli/releases/latest).

```bash
# Using winget package manager
winget install -s winget nodejs ffmpeg yt-dlp
```

If you have `python3` installed on your system use `pip` to install `yt-dlp`.]

```bash
pip3 install yt-dlp
```

**Make sure to choose the appropriate package manager for your system to install these requirements.**

## Installation

#### Auto Installation:

To install spdl from npm run this following command.

> **You can also use `yarn` or `pnpm` if you prefer.**

```
npm install -g @nadim147/spdl
spdl setup
```

#### Manual Installation:

To install manually, follow these steps:

1.  Clone the repository:

    ```bash
    git clone https://github.com/Nadim147c/SPDL.git
    cd SPDL
    ```

2.  Install all node with `pnpm` (`npm i -g pnpm`) package manager.

    ```
    pnpm install
    ```

3.  Build:

    ```bash
    pnpm build
    ```

4.  Linking:

    ```bash
    npm link
    ```

5.  Now, `spdl` command will be availble in your termnial. Run `spdl --version` to check the current version.

    Create Spotify app from [Spotify API Deshboard](https://developer.spotify.com/dashboard).
    After that, Run `spdl setup` and it will prompt you to setup your Spotify API tokens.

## Usage

Run `spdl` or `spdl --help` to get the help menu.

To download a track, run:

```bash
spdl [spotify_track_url]
```

To download a playlist, run: `Only for public playlist`

```bash
spdl [spotify_playlist_url]
```

Same is for albums. `spdl [spotify_album_url]` to download an album.

Here's some options that you can use when running `spdl` command.

```
-V, --verbose                Verbosity of loging when running command (default:
                             false)
--write-lrc                  Generate .lrc file for track if lyrics exists
                             (default: false)
-o, --output <Path>          Directory to download the tracks/playlists
                             (default: Current Directory)
-l, --search-limit <Amount>  Number of search to make before downloading avoid
                             track. More than 3 isn't recommanded (default:
                             first 3 tracks)
-s, --sleep-time <Seconds>   Amount of seconds to wait in between each track to
                             avoid getting limited. Changing it isn't
                             recommanded (default: 30)
--no-subdir                  Do not create sub directory for album and playlist
```

The most up-to-date and accurate information about parameters can be found in the built-in help menu (`spdl --help`). Any changes in command and their usage will be available there.

## Commands

There is `clear-cache` command for clearing caches.

```
spdl clear-cache [options]
```

> Note: You must use at least one option for `clear-cache` command.

Available options:

```
-V, --verbose  Verbosity of loging when running command (default:
               false)
--all          Remove all caches (default: false)
--images       Remove image caches (default: false)
--tracks       Remove track caches (default: false)
--albums       Remove album caches (default: false)
--playlists    Remove playlist caches (default: false)
--tokens       Remove token caches (default: false)
```

## Issues and Contributions

If you encounter any problems, have questions, or need assistance with spdl, please feel free to [create an issue](https://github.com/Nadim147c/spdl/issues). I'll try to help you with any issues or inquiries you might have.

While I aim to maintain this repository by myself, contributions are welcomed.

> Note: I'm not a experienced js developer and coding style might be confusing.

To contribute, [create an issue](https://github.com/Nadim147c/spdl/issues) detailing the problem you'd like to address or the feature you'd like to add. This way, we can discuss and plan the changes.
And also I'm using changesets and run `pnpm changeset` before you commit your changes.

For any questions or additional information, don't hesitate to reach out through the [issues section](https://github.com/Nadim147c/spdl/issues).

## License And Credits

> This project isn't affilated with Spotify, Youtube and Kugou.

This project is licensed under [GNU GPL-3](./LICENSE).

Downloading lyrics from [Kugou](./src/structure/Kugou.ts) is implemented from [z-huang/InnerTune](https://github.com/z-huang/InnerTune).

---
_Source: https://npm.io/package/@nadim147/spdl · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
