Giter Club home page Giter Club logo

playlistdownloader's Introduction

PlaylistDownloader

PlaylistDownloader is a project to download audio files (songs, etc.) from multiple providers with a simple Python extension of existing libraries. The project extends the following features:

  • Auto-detects the provider of the required audio file
  • Provides a REST API that parses a list of playlists or songs in a text file

This program is essentially a wrapper for youtube-dl, which already offers most of these features.

PlaylistDownloader downloads playlists (from Spotify, YouTube, etc.) by finding and downloading the MP3 files of the music videos on YouTube.

Installation

For now, Windows is not well supported.

Install all required packages:

pip install poetry
poetry install

Ubuntu and WSL

Fix bug with YouTube search using youtube-dl:

./scripts/youtube-dl.sh

Fix bug with youtube-dl download:

sudo apt-get install ffmpeg

Change the API key for Spotify with your own key Spotify Developer App to make it work in:

  • rest/rest.py
  • examples/random_link.py
  • examples/spotify_link.py
# Spotipy Client ID
SPOTIPYCLIENTID = "SPOTIPY_CLIENT_ID"
SPOTIPYCLIENTSECRET = "SPOTIPY_CLIENT_ID"

TODO

  • No API key for Spotify
  • Add more providers

How To Use

PlaylistDownloader works with different music platforms like:

  • SoundCloud
  • YouTube
  • Spotify (requires API key)

Auto-recognition of links

Download playlists containing links for the three different services:

python3 random-playlink.py data/random-list.txt --output random

YouTube

Download a list of YouTube video links:

python3 youtube-playlist.py data/youtube-list.txt --output youtube

SoundCloud

Download a list of SoundCloud links:

python3 soundcloud-playlist.py data/soundcloud-list.txt --output soundcloud

Spotify

Download a Spotify playlist:

python3 spotify-playlist.py "https://open.spotify.com/user/spotifycharts/playlist/37i9dQZEVXbMDoHDwVN2tF?si=ZBG2E3XeSbGHEH0vZcYYTQ"  --output "Spotify-Playlist"

Download a Spotify playlist with a specific API key:

python3 spotify-playlist.py "https://open.spotify.com/user/spotifycharts/playlist/37i9dQZEVXbMDoHDwVN2tF?si=ZBG2E3XeSbGHEH0vZcYYTQ" --output "Spotify-Playlist" --spotipyid CLIENTID --spotipysecret CLIENTSECRET"

Get the Spotify link for the playlist ID and username:

Get Spotify link for the playlist id

REST API

TODO

  • Change the REST API to not save data locally on the server
  • Create a cleaner, simpler UI
  • Simplify installation and setup
  • Add more providers

Start server

python3 rest.py

Test the API with curl

curl -X POST http://127.0.0.1:5000/api/downloader/random-list.txt
curl -X GET http://127.0.0.1:5000/api

playlistdownloader's People

Contributors

antoinebou12 avatar dependabot[bot] avatar renovate[bot] avatar

Watchers

 avatar  avatar

Forkers

n8wacht

playlistdownloader's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update dependency beautifulsoup4 to v4.12.3
  • Update dependency bs4 to ^0.0.2
  • Update dependency genbadge to v1.1.1
  • Update dependency httpx to ^0.27.0
  • Update dependency mkdocs to v1.5.3
  • Update dependency sphinx to v7.2.6
  • Update dependency typer to ^0.11.0
  • Update python Docker tag to v3.12
  • Update actions/checkout action to v4
  • Update actions/setup-python action to v5
  • Update actions/upload-artifact action to v4
  • Update dependency black to v24
  • Update dependency pytest to v8
  • Update dependency pytest-cov to v5
  • Update dependency werkzeug to v3
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
.devcontainer/Dockerfile
  • mcr.microsoft.com/vscode/devcontainers/python 3-bullseye
api/Dockerfile
  • python 3.11
github-actions
.github/workflows/python-docs.yml
  • actions/checkout v3
  • actions/setup-python v4
  • actions/upload-artifact v3
.github/workflows/python-test.yml
  • actions/checkout v3
  • actions/setup-python v4
  • actions/upload-artifact v3
  • actions/upload-artifact v3
pep621
pyproject.toml
poetry
pyproject.toml
  • python ^3.10
  • youtube_dl ^2021.12.17
  • spotipy ^2.23.0
  • bs4 ^0.0.1
  • typer ^0.9.0
  • rich ^13.3.5
  • httpx ^0.24.0
  • pytest-cov ^4.0.0
  • beautifulsoup4 ^4.12.2
  • fastapi ^0.95.1
  • uvicorn ^0.22.0
  • werkzeug ^2.3.4
  • pytest ^7.2.2
  • pytest-cov ^4.0.0
  • sphinx ^7.0.0
  • pre-commit ^3.0.0
  • black ^23.1.0
  • genbadge ^1.0.0
  • mkdocs ^1.4.2
  • mkdocs-material ^9.1.5
  • mkdocstrings ^0.21.0

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.