Git Product home page Git Product logo

pymusicdl's Introduction

A simple music downloading app which doesn't require any API keys.

Check pymusicdl-termux for android setup.


Features

  • Download single song
  • Download Youtube Playlist
  • Download Spotify playlist/album (searches on youtube and downloads the top result)
  • Convert downloaded songs to mp3 or flac

The final result

https://open.spotify.com/playlist/4WtqLI6gaRFaWB4g6mDnAX

Setup

Check it out on YouTube! youtube decided to remove the video and I didn't back it up anywhere :p

Installation and usage:


Windows
Note

Read the instructions carefully

  • Make sure Python is added to your Path.
    • You can check it by typing py --version in cmd.
      • Consider running this piece of code (in cmd) for installing python (if you don't have python installed):
      curl -o python.exe https://www.python.org/ftp/python/3.9.5/python-3.9.5-amd64.exe && python.exe
      
      make sure to check "add to PATH"
  • Make sure PIP is added to your Path.
    • You can check it by typing pip --version or py -m pip --version in cmd.
      • Consider running this piece of code (in cmd) for installing pip (if you don't have PIP installed):
      curl -o get-pip.py https://bootstrap.pypa.io/get-pip.py && py get-pip.py
      
  • Run the following command in Command prompt
curl -o setup.bat https://raw.githubusercontent.com/insaiyancvk/pymusicdl/main/setup.bat && setup && del setup.bat
  • Everytime you want to download music just type musicdl in cmd :)

Linux
  • Install the pymusicdl.
pip install pymusicdl
pip install https://github.com/mps-youtube/pafy/archive/refs/heads/develop.zip
  • Install FFMPEG based on the distro.

    • Debian/Ubuntu - sudo apt install ffmpeg
    • Fedora/RHEL - sudo dnf install ffmpeg
    • Arch - sudo pacman -S ffmpeg

    Referred from ubuntupit

  • Download "musicdl" to ~/.local/bin, make it executable.

curl -o ~/.local/bin/musicdl https://raw.githubusercontent.com/insaiyancvk/pymusicdl/pure-python/musicdl && chmod +x ~/.local/bin/musicdl && clear && echo -e '\n\nType \033[1m\033[3mmusicdl\033[0m in your terminal to download music :)\n\n'
  • Everytime you want to download music just type musicdl in terminal :)

Android

Check pymusicdl-termux for sample images

  • Download Termux.

    DO NOT DOWNLOAD IT FROM PLAYSTORE, for more info check here

    • If you have Android version >=7, then click here to directly download termux apk
    • Otherwise, download F-Droid apk and install it. Then install Termux from it.
  • Run the below command for installing everything automatically.

curl -sS -o setup.sh https://raw.githubusercontent.com/insaiyancvk/pymusicdl/pymusicdl-termux/setup.sh && chmod +x setup.sh && ./setup.sh
  • Everytime you want to download music just type musicdl in termux :)

Updating the package:

pip install pymusicdl_termux -U
  • or you can use python3 -m pip install pymusicdl -U in Termux

To fix the 'dislike_count' error:

  • Uninstall pafy and install from github repository.

    (run the following command in command prompt)

    pip uninstall pafy && pip install https://github.com/mps-youtube/pafy/archive/refs/heads/develop.zip


Updating the package:

pip install pymusicdl -U
  • or you can use python3 -m pip install pymusicdl -U if you are on linux

  • and py -m pip install pymusicdl -U if you are on windows

Fun fact: I did this project when I got covid :)

Buy Me A Coffee

pymusicdl's People

Contributors

insaiyancvk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

pymusicdl's Issues

Issue

i have this error

Looks like something went wrong :(
Traceback (most recent call last):
File "C:\Users\nizar\AppData\Local\Programs\Python\Python39\lib\site-packages\pymusicdl\musicDL.py", line 92, in main
spotify_downloader().interface()
File "C:\Users\nizar\AppData\Local\Programs\Python\Python39\lib\site-packages\pymusicdl\modules\spotify_downloader.py", line 198, in interface
tracks,alburls = self.get_playlist_tracks(sp, plID)
File "C:\Users\nizar\AppData\Local\Programs\Python\Python39\lib\site-packages\pymusicdl\modules\spotify_downloader.py", line 109, in get_playlist_tracks
if len(playlist['items'][i]['track']['album']['images']) == 0:
TypeError: 'NoneType' object is not subscriptable

The error has been logged to logger.log file in 'musicDL downloads' on Desktop for reference
Take a screenshort and raise an issue in github or send it to the devs

Issue installing.

musicdl
Traceback (most recent call last):
File "C:\Users\mail\AppData\Local\Programs\Python\Python39\Scripts\musicdl.bat", line 3, in
from pymusicdl.musicDL import main, check_ffmpeg
File "C:\Users\mail\AppData\Local\Programs\Python\Python39\lib\site-packages\pymusicdl_init_.py", line 7, in
from pymusicdl.musicDL import main
File "C:\Users\mail\AppData\Local\Programs\Python\Python39\lib\site-packages\pymusicdl\musicDL.py", line 6, in
logging.basicConfig(filename=LOG_FILE, level=logging.ERROR)
File "C:\Users\mail\AppData\Local\Programs\Python\Python39\lib\logging_init_.py", line 2003, in basicConfig
h = FileHandler(filename, mode,
File "C:\Users\mail\AppData\Local\Programs\Python\Python39\lib\logging_init_.py", line 1146, in init
StreamHandler.init(self, self.open())
File "C:\Users\mail\AppData\Local\Programs\Python\Python39\lib\logging_init
.py", line 1175, in _open
return open(self.baseFilename, self.mode, encoding=self.encoding,
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\mail\Desktop\musicDL downloads\logger.log'

dislike_count

so i chose spotify in the menu on musicdl and pasted the link.. it fetched all details it needed but right after that this came about

image

Also there is a problem where if one song in a playlist is not available the entire proccess stops
it kinda sucks but managable

File not converting to Flac

I had downloaded a playlist from Spotify and it did not transfer to flac. I tried to download a single song and the message came

Capture

I opened the logger.log on notepad and this message came

Capture2

File not converting to Flac and MP3

I had downloaded a playlist from Spotify and it did not transfer to flac. I tried to download a single song and the message came

Capture

( I forgot to Screenshot the MP3 command prompt, Sorry For that)

I opened the logger.log on notepad and this message came when I tried to convert it to flac

Capture2

And this came when I tried to convert it to MP3

Capture3
Capture4

403 error suddenly

When you are downloading an Spotify playlist suddenly the program fails and reports "403: Forbidden" error. Haven't tryed with Youtube playlists nor single songs.

It happens ramdomly and without any user input.

imagen

Trouble downloading spotify playlists

When I pick the third option "Download from Spotify" I get many error messages and I don't know how to resolve the issue. Any help would be appreciated.

Here's a screenshot of what happens
Desktop Screenshot 2021 10 24 - 18 04 03 10

Here's the log file
logger.log

Please Help

this is the error i get

Traceback (most recent call last):
File "C:\Users\advsa\AppData\Local\Programs\Python\Python39\Scripts\musicdl.bat", line 6, in
main()
File "C:\Users\advsa\AppData\Local\Programs\Python\Python39\lib\site-packages\pymusicdl\musicDL.py", line 64, in main
create_dir()
File "C:\Users\advsa\AppData\Local\Programs\Python\Python39\lib\site-packages\pymusicdl\musicDL.py", line 40, in create_dir
os.chdir(os.path.expanduser("~/Desktop"))
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'C:\Users\advsa/Desktop'

Can anyone please help me solve this

Song # isn't updated in metadata

Describe the bug
When downloading an album, the song # in that album isn't updated in the metadata of the music file

To Reproduce
Steps to reproduce the behavior:

  1. Download any album using musicdl

Expected behavior
In metadata properties, the song # should be available. This helps in sorting in music players, file explorer, etc.

Screenshots
image

musicdl command doesn't work

I followed everything from the video provided but the command 'musicdl' doesn't work at all.

I use windows

downloaded everything needed but still not working helpp pls
scrnshot

Spotify Issue,

Unable to use option "Download from Spotify"

To Reproduce
. Select "download from Spotify"

Expected behavior
Get prompted for spotify playlist url

logger.log

Download speed

The download speed is very very slow idk why my wifi download speed is 50 mbps and the download speed in the cmd is 20-80kbps it will take forever to download a playlist of 50 songs

Should recognize already downloaded songs

When the process fails, it does not detects already downloaded songs automatically and begins to download them again in case that you want to continue/retry the process.

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.