Skip to main content

pydownsongs

Pydownsongs is intended for both developers and regular users to download songs

Installation

Install by typing the following in CMD/PowerShell (Windows):

python -m pip install pydownsongs

For Mac/Linux, type the following in Terminal/PowerShell:

python3 -m pip install pydownsongs

Note: The script requires Python3 and is not supported for Python2

Usage

Refer to these quality levels first:
1: Very High
2: High
3: Medium
4: Low
5: Very Low

Pydownsongs can be used in following ways:

  • directly through command line:
    Give the list of songs directly in command line followed by quality level number
pydownsongs <song1> <song2> .... <qualitynumber>

Example:

pydownsongs "Closer chainsmokers" 3
  • by using the file method directly in command line:
    You can store the name of songs in a text file and can download songs using command like this:
pydownsongs -f <filename> <qualitynumber>

Example:

pydownsongs -f songs.txt 4
  • by using the spotify playlist directly in command line:
    You can download the tracks of a spotify playlist directly by providing a link of playlist and then the quality level like this:
pydownsongs -s "<link>" <qualitynumber>

Example:

pydownsongs -s "https://open.spotify.com/playlist/7KMTl7JzxUt5pRaOu77Omu?si=722aaaa6a18d41e0" 4

But, for this to work, you have to create your spotify developer id and secrets at developer.spotify.com and then add both these in following format in a file named pydownsongs.toml in the following format:

id = '<youridhere>'
secrets = '<yoursecretpasswordhere>'

This file has to be placed in the following location: ~/.config/pydownsongs.toml (on GNU/Linux)
C:\Users\.config\pydownsongs.toml (on windows)

  • by calling download function in through a python program:
import pydownsongs
pydownsongs.download(songname, qualitylevel)

Example:

import pydownsongs
pydownsongs.download("closer chain smokers", 2)
  • by calling downloadarray function through python program:
    This function can be called to download a list of songs
arr = ["a", "b", "c"]
pydownsongs.downloadarray(arr, 4)

Example:

arr = ["closer chainsmokers", "yaara tere wargaa jass manak"]
pydownsongs.downloadarray(arr, 4)

Notes

(I assume that the songs rank top on youtube when given the names that you have mentioned in the list. If there may be duplicate songs, consider writing keywords with songname like if you want to search the song Closer, you may type "Closer chainsmokers".) Make sure that you have active Internet Connection otherwise the script would show you "No Internet Connection" and would exit itself. If any song(s) could not be downloaded by the script it would show "Some error occured" after the song and the name of that song would be copied to failedtemp.txt (this file would be created in the folder in which you are running the script if there are any fails).

Disclaimer

This script does not promote the downloading of copyright content. This is solely for educational purposes for learning web scrapping by python. I am not responsible for any piracy.

Credits

Special thanks to Swayam Gagneja (swayamgagneja12345@gmail.com) for providing base for spotify playlist file to which I made subsequent changes and linked to main file

Metadata

Release files for pydownsongs 1.6.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydownsongs 1.6.2
File Size Uploaded
pydownsongs-1.6.2.tar.gz 10.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pydownsongs 1.6.2
File Interpreter ABI Platform
pydownsongs-1.6.2-py3.9.egg Legacy Egg format - - Details

Total release size: 30.3 kB

Release files / pydownsongs-1.6.2.tar.gz

Download URL pydownsongs-1.6.2.tar.gz
Size 10.4 kB
Tags Source
SHA-256 checksum
How to use checksums
88a729c23ea7d346f464e2471736008ba2796889b39280324c8ad0d69c8c8d76
BLAKE2b-256 checksum
How to use checksums
d0ab2d663ae80e5dc3e0099cf77b607f1c15705782ceb5afb22cbde32cc1e0d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / pydownsongs-1.6.2-py3.9.egg

Download URL pydownsongs-1.6.2-py3.9.egg
Size 19.9 kB
Tags Egg
SHA-256 checksum
How to use checksums
bc65cda2061e99df98c650aaf5fe0f9b64981c2b35f1472c2cc6f27959157ceb
BLAKE2b-256 checksum
How to use checksums
fb0798c374f8cedec91f2b6f30d7864bdd5474e3ced397dbc888ccd1e6eced6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release history Release notifications | RSS feed

This release

1.6.2 This release

2 release files

1.6.1

1 release file

1.6

1 release file

1.5

2 release files

1.4

1 release file

1.2.2

1 release file

1.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page