Skip to main content

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

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydownsongs-1.6.2.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

pydownsongs-1.6.2-py3.9.egg (19.9 kB view details)

Uploaded Source

File details

Details for the file pydownsongs-1.6.2.tar.gz.

File metadata

  • Download URL: pydownsongs-1.6.2.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for pydownsongs-1.6.2.tar.gz
Algorithm Hash digest
SHA256 88a729c23ea7d346f464e2471736008ba2796889b39280324c8ad0d69c8c8d76
MD5 71ecae8bb846c094cd211196ac5bd548
BLAKE2b-256 d0ab2d663ae80e5dc3e0099cf77b607f1c15705782ceb5afb22cbde32cc1e0d6

See more details on using hashes here.

File details

Details for the file pydownsongs-1.6.2-py3.9.egg.

File metadata

  • Download URL: pydownsongs-1.6.2-py3.9.egg
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for pydownsongs-1.6.2-py3.9.egg
Algorithm Hash digest
SHA256 bc65cda2061e99df98c650aaf5fe0f9b64981c2b35f1472c2cc6f27959157ceb
MD5 64a15f01e117247bde173b12cde9ad73
BLAKE2b-256 fb0798c374f8cedec91f2b6f30d7864bdd5474e3ced397dbc888ccd1e6eced6c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page