-----------------
Spotify On The Go
-----------------
Download songs and playlist from Spotify. The tracks are downloaded from
YouTube videos and converted as mp3 files.
Install
=======
::
pip install spotify-onthego
Note that you will need valid Spotify app credentials. If you don't have a
valid client ID/secret pair of keys, you can create a Spotify app `here
<https://developer.spotify.com/my-applications/#!/applications/create>`_.
Once you have created a Spotify app, you will also have to add a redirect URI
for this app ("Add URI").
After the first run of the CLI tool, the authentication token and credentials
will be stored in a local configuration file.
Requirements
------------
If you wish to convert the downloaded files to mp3 format, you will need to
install ffmpeg or avconv.
On Debian/Ubuntu::
sudo apt-get install ffmpeg
On Mac OS, just follow the instructions from the `official ffmpeg website <https://www.ffmpeg.org/download.html>`__.
Usage
=====
::
$ spotify-playlist -h
usage: spotify-playlist [-h] [-i] [-S] [-a {webm,ogg,m4a}] [-C] playlist dst
Download the tracks of a Spotify playlist from YouTube
positional arguments:
playlist Name of playlist. E.g: 'Road music'
dst Destination directory
optional arguments:
-h, --help show this help message and exit
-i, --interactive Interactively select the song to download from
Youtube.
-S, --no-skip Don't skip files that were already downloaded.
-a {webm,ogg,m4a}, --audio {webm,ogg,m4a}
Preferred audio format to download. By default, the
best quality audio format will be downloaded. On some
platforms (e.g: Debian Wheezy), the default ffmpeg
utility does not support audio conversion from webm,
so you should specify a different value here. Note
that this audio file will eventually be converted to
mp3 (unless you specify --no-convert)
-C, --no-convert Don't convert audio files to mp3 format.
::
$ spotify-mymusic -h
usage: spotify-mymusic [-h] [-l LIMIT] [-i] [-S] [-a {webm,ogg,m4a}] [-C] dst
Download the songs from 'Your Music'
positional arguments:
dst Destination directory
optional arguments:
-h, --help show this help message and exit
-l LIMIT, --limit LIMIT
Limit to top N songs
-i, --interactive Interactively select the song to download from
Youtube.
-S, --no-skip Don't skip files that were already downloaded.
-a {webm,ogg,m4a}, --audio {webm,ogg,m4a}
Preferred audio format to download. By default, the
best quality audio format will be downloaded. On some
platforms (e.g: Debian Wheezy), the default ffmpeg
utility does not support audio conversion from webm,
so you should specify a different value here. Note
that this audio file will eventually be converted to
mp3 (unless you specify --no-convert)
-C, --no-convert Don't convert audio files to mp3 format.
Download playlist
-----------------
Download all songs from 'My Playlist' and save them as mp3::
spotify-playlist "My Playlist" ./music/myspotifyplaylist/
Create a cronjob to download your Discover Weekly playlist every monday at 7am::
0 7 * * 1 /home/username/venv/bin/spotify-playlist "Discover Weekly" /home/username/music/discoverweekly
Wildcards are supported, too::
spotify-playlist "Mixtape*" ./music/
Download favorite songs
------------------------
Download your 30 most recent tracks from "My Music"::
spotify-mymusic -l 30 ./music/mytracks/
Interactive mode
----------------
By default, ``spotify-onthego`` downloads the first match found on Youtube for
the search ``"<song title> <artist name>"`` (song and artist separated by an
empty space). If you want to manually select the Youtube result to download,
run in interactive mode with the ``-i`` option::
$ spotify-mymusic -i mymusic/
++ Processing Porcupine Tree - Deadwing
[1] Porcupine Tree - DeadWing https://www.youtube.com/watch?v=GMEwM3YHiME
[2] Porcupine Tree - Deadwing https://www.youtube.com/watch?v=-Rwp-yvmcRM
[3] Porcupine Tree - Deadwing [Lyrics on Video] https://www.youtube.com/watch?v=dDepB1mwPhc
[4] Making of Deadwing https://www.youtube.com/watch?v=ZuYjGfaixDM
[5] Porcupine Tree- Mellotron Scratch https://www.youtube.com/watch?v=Ag2zXiiuF5Q
[6] Porcupine Tree - Shesmovedon (Deadwing ver.) https://www.youtube.com/watch?v=OtfJcTBklh8
[7] Porcupine Tree - Shallow (lyrics) https://www.youtube.com/watch?v=7_8UmXv5Xac
[8] Porcupine Tree - Arriving Somewhere But Not Here (lyrics on screen) https://www.youtube.com/watch?v=f2ROFnA4HRA
[9] Porcupine Tree - Deadwing (Lyrics) https://www.youtube.com/watch?v=tMMlEZCaQTY
[10] Deadwing- Porcupine Tree(Drum Cover) https://www.youtube.com/watch?v=Zb5KTnXGiNU
Select song to download (default: 1, next=n):
Of course, interactive mode should not be used in automated cron jobs.
Troubleshooting
===============
In case of 401 error, this may be caused by a previous authorization token that
did not have the right scope. Just remove the
:code:`~/.local/share/spotify-onthego/spotify.token` file and start the command
again.
If mp3 generation fails with an error message related to eyed3, check that your
installed version of eyed3 is at least 0.8::
$ pip freeze | grep eyeD3
eyeD3==0.8
Development
===========
See something that's not working for you, or something that you would like to
be included? Just open a `pull request
<https://github.com/regisb/spotify-onthego/pulls>`_ with your code, or a
`Github issue <https://github.com/regisb/spotify-onthego/issues>`_ where you
describe the feature you would like to have.
To setup a development environment, install the ``dev`` requirements::
pip install -r requirements/dev.txt
Code should be `black-formatted <https://black.readthedocs.io/en/stable/>`__. To automatically format your code, run::
make format
Periodically run code lint and formatting tests with:
make test
License
=======
This project is licensed under the `GNU General Public License
v3.0 <https://opensource.org/licenses/gpl-3.0.html>`_.
Raw data
{
"_id": null,
"home_page": "https://github.com/regisb/spotify-onthego",
"name": "spotify-onthego",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "spotify youtube download playlist music songs",
"author": "R\u00e9gis Behmo",
"author_email": "nospam@behmo.com",
"download_url": "https://files.pythonhosted.org/packages/12/e6/6989794ed69e6ca2b810e4b04e8ab7c1dc39878c4ddf7395140f4f84e92c/spotify-onthego-1.0.11.tar.gz",
"platform": null,
"description": "-----------------\nSpotify On The Go\n-----------------\n\nDownload songs and playlist from Spotify. The tracks are downloaded from\nYouTube videos and converted as mp3 files.\n\nInstall\n=======\n\n::\n\n pip install spotify-onthego\n\nNote that you will need valid Spotify app credentials. If you don't have a\nvalid client ID/secret pair of keys, you can create a Spotify app `here\n<https://developer.spotify.com/my-applications/#!/applications/create>`_.\n\nOnce you have created a Spotify app, you will also have to add a redirect URI\nfor this app (\"Add URI\").\n\nAfter the first run of the CLI tool, the authentication token and credentials\nwill be stored in a local configuration file.\n\nRequirements\n------------\n\nIf you wish to convert the downloaded files to mp3 format, you will need to\ninstall ffmpeg or avconv.\n\nOn Debian/Ubuntu::\n\n sudo apt-get install ffmpeg\n\nOn Mac OS, just follow the instructions from the `official ffmpeg website <https://www.ffmpeg.org/download.html>`__.\n\nUsage\n=====\n\n::\n \n $ spotify-playlist -h\n usage: spotify-playlist [-h] [-i] [-S] [-a {webm,ogg,m4a}] [-C] playlist dst\n\n Download the tracks of a Spotify playlist from YouTube\n\n positional arguments:\n playlist Name of playlist. E.g: 'Road music'\n dst Destination directory\n\n optional arguments:\n -h, --help show this help message and exit\n -i, --interactive Interactively select the song to download from\n Youtube.\n -S, --no-skip Don't skip files that were already downloaded.\n -a {webm,ogg,m4a}, --audio {webm,ogg,m4a}\n Preferred audio format to download. By default, the\n best quality audio format will be downloaded. On some\n platforms (e.g: Debian Wheezy), the default ffmpeg\n utility does not support audio conversion from webm,\n so you should specify a different value here. Note\n that this audio file will eventually be converted to\n mp3 (unless you specify --no-convert)\n -C, --no-convert Don't convert audio files to mp3 format.\n\n::\n\n $ spotify-mymusic -h\n usage: spotify-mymusic [-h] [-l LIMIT] [-i] [-S] [-a {webm,ogg,m4a}] [-C] dst\n\n Download the songs from 'Your Music'\n\n positional arguments:\n dst Destination directory\n\n optional arguments:\n -h, --help show this help message and exit\n -l LIMIT, --limit LIMIT\n Limit to top N songs\n -i, --interactive Interactively select the song to download from\n Youtube.\n -S, --no-skip Don't skip files that were already downloaded.\n -a {webm,ogg,m4a}, --audio {webm,ogg,m4a}\n Preferred audio format to download. By default, the\n best quality audio format will be downloaded. On some\n platforms (e.g: Debian Wheezy), the default ffmpeg\n utility does not support audio conversion from webm,\n so you should specify a different value here. Note\n that this audio file will eventually be converted to\n mp3 (unless you specify --no-convert)\n -C, --no-convert Don't convert audio files to mp3 format.\n\nDownload playlist\n-----------------\n\nDownload all songs from 'My Playlist' and save them as mp3::\n\n spotify-playlist \"My Playlist\" ./music/myspotifyplaylist/\n\nCreate a cronjob to download your Discover Weekly playlist every monday at 7am::\n\n 0 7 * * 1 /home/username/venv/bin/spotify-playlist \"Discover Weekly\" /home/username/music/discoverweekly\n\nWildcards are supported, too::\n\n spotify-playlist \"Mixtape*\" ./music/\n\nDownload favorite songs\n------------------------\n\nDownload your 30 most recent tracks from \"My Music\"::\n\n spotify-mymusic -l 30 ./music/mytracks/\n\nInteractive mode\n----------------\n\nBy default, ``spotify-onthego`` downloads the first match found on Youtube for\nthe search ``\"<song title> <artist name>\"`` (song and artist separated by an\nempty space). If you want to manually select the Youtube result to download,\nrun in interactive mode with the ``-i`` option::\n\n $ spotify-mymusic -i mymusic/\n ++ Processing Porcupine Tree - Deadwing\n [1] Porcupine Tree - DeadWing https://www.youtube.com/watch?v=GMEwM3YHiME\n [2] Porcupine Tree - Deadwing https://www.youtube.com/watch?v=-Rwp-yvmcRM\n [3] Porcupine Tree - Deadwing [Lyrics on Video] https://www.youtube.com/watch?v=dDepB1mwPhc\n [4] Making of Deadwing https://www.youtube.com/watch?v=ZuYjGfaixDM\n [5] Porcupine Tree- Mellotron Scratch https://www.youtube.com/watch?v=Ag2zXiiuF5Q\n [6] Porcupine Tree - Shesmovedon (Deadwing ver.) https://www.youtube.com/watch?v=OtfJcTBklh8\n [7] Porcupine Tree - Shallow (lyrics) https://www.youtube.com/watch?v=7_8UmXv5Xac\n [8] Porcupine Tree - Arriving Somewhere But Not Here (lyrics on screen) https://www.youtube.com/watch?v=f2ROFnA4HRA\n [9] Porcupine Tree - Deadwing (Lyrics) https://www.youtube.com/watch?v=tMMlEZCaQTY\n [10] Deadwing- Porcupine Tree(Drum Cover) https://www.youtube.com/watch?v=Zb5KTnXGiNU\n Select song to download (default: 1, next=n):\n\nOf course, interactive mode should not be used in automated cron jobs.\n\nTroubleshooting\n===============\n\nIn case of 401 error, this may be caused by a previous authorization token that\ndid not have the right scope. Just remove the\n:code:`~/.local/share/spotify-onthego/spotify.token` file and start the command\nagain.\n\nIf mp3 generation fails with an error message related to eyed3, check that your\ninstalled version of eyed3 is at least 0.8::\n\n $ pip freeze | grep eyeD3\n eyeD3==0.8\n\n\nDevelopment\n===========\n\nSee something that's not working for you, or something that you would like to\nbe included? Just open a `pull request\n<https://github.com/regisb/spotify-onthego/pulls>`_ with your code, or a\n`Github issue <https://github.com/regisb/spotify-onthego/issues>`_ where you\ndescribe the feature you would like to have. \n\nTo setup a development environment, install the ``dev`` requirements::\n \n pip install -r requirements/dev.txt\n\nCode should be `black-formatted <https://black.readthedocs.io/en/stable/>`__. To automatically format your code, run::\n \n make format\n\nPeriodically run code lint and formatting tests with:\n\n make test\n\nLicense\n=======\n\nThis project is licensed under the `GNU General Public License\nv3.0 <https://opensource.org/licenses/gpl-3.0.html>`_.\n\n\n",
"bugtrack_url": null,
"license": "GPL",
"summary": "Download Spotify songs and playlists (with YouTube)",
"version": "1.0.11",
"project_urls": {
"Homepage": "https://github.com/regisb/spotify-onthego"
},
"split_keywords": [
"spotify",
"youtube",
"download",
"playlist",
"music",
"songs"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "12e66989794ed69e6ca2b810e4b04e8ab7c1dc39878c4ddf7395140f4f84e92c",
"md5": "0f21f58f051a69bfa678ec7a43d52ef0",
"sha256": "6e566f747e75e1e3bafc988e6fe41d5803ee0d3a01c590f380041975699d59e7"
},
"downloads": -1,
"filename": "spotify-onthego-1.0.11.tar.gz",
"has_sig": false,
"md5_digest": "0f21f58f051a69bfa678ec7a43d52ef0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 23389,
"upload_time": "2024-09-12T06:18:19",
"upload_time_iso_8601": "2024-09-12T06:18:19.165207Z",
"url": "https://files.pythonhosted.org/packages/12/e6/6989794ed69e6ca2b810e4b04e8ab7c1dc39878c4ddf7395140f4f84e92c/spotify-onthego-1.0.11.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-12 06:18:19",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "regisb",
"github_project": "spotify-onthego",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "spotify-onthego"
}