diff --git a/README.md b/README.md index ddc089dd..9484c3a6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,16 @@ # spotify_dl Downloads songs from any Spotify playlist or from your "My Music" collection. +[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) +[![PyPI download month](https://img.shields.io/pypi/dm/spotify_dl.svg)](https://pypi.python.org/pypi/spotify_dl/) +[![PyPI license](https://img.shields.io/pypi/l/spotify_dl.svg)](https://pypi.python.org/pypi/spotify_dl/) +[![PyPI pyversions](https://img.shields.io/pypi/pyversions/spotify_dl.svg)](https://pypi.python.org/pypi/spotify_dl/) +[![GitHub release](https://img.shields.io/github/release/SathyaBhat/spotify-dl.svg)](https://GitHub.com/SathyaBhat/spotify-dl/releases/) +[![GitHub stars](https://img.shields.io/github/stars/SathyaBhat/spotify-dl.svg?style=social&label=Star&maxAge=2592000)](https://GitHub.com/SathyaBhat/spotify-dl/stargazers/) +[![GitHub contributors](https://img.shields.io/github/contributors/SathyaBhat/spotify-dl.svg)](https://GitHub.com/SathyaBhat/spotify-dl/graphs/contributors/) + +[![Awesome Badges](https://img.shields.io/badge/badges-awesome-green.svg)](https://github.com/Naereen/badges) + # Tell me more! I wanted an easy way to grab the songs present in my library so I can download it & use it offline(Spotify still hasn't launched here. Y U NO COME?). [spotify_to_mp3](https://github.com/frosas/spotify-to-mp3) worked well but it relied on grooveshark, which unfortunately is no more. @@ -34,7 +44,7 @@ Pre-requisite: You need Python 3+ - `spotify_playlist_link` is a link to Spotify's playlist. You can get it from the 3-dot menu. - ![image](https://cloud.githubusercontent.com/assets/25424/25472453/f256c94a-2b48-11e7-8f91-7bfa1ce232c2.png) + ![image](images/spotify-playlist.png) If the Spotify playlist link is skipped then it will download songs from your "My Music" collection - `download_directory` is the location where the songs must be downloaded to. If you give a `.` then it will download to the current directory. @@ -50,6 +60,7 @@ Pre-requisite: You need Python 3+ - Windows users can download FFMPEG pre-built binaries from [here](http://ffmpeg.zeranoe.com/builds/). Extract the file using [7-zip](http://7-zip.org/) to a foldrer and [add the folder to your PATH environment variable](http://www.wikihow.com/Install-FFmpeg-on-Windows) ### How do I set defaults? + You can set defaults per user by creating a file at `~/.spotify_dl_settings`. Create a key with value for every argument you want a default for. Example: ``` json { @@ -58,7 +69,9 @@ You can set defaults per user by creating a file at `~/.spotify_dl_settings`. Cr , "skip_mp3" : "t" } ``` + ### Credits + - [rhnvrm](https://github.com/rhnvrm) for [adding in youtube-dl](https://github.com/SathyaBhat/spotify-dl/pull/1) - [mr-karan](https://github.com/mr-karan) for [adding save to directory](https://github.com/SathyaBhat/spotify-dl/pull/6) - [shantanugoel](https://github.com/shantanugoel) for adding in [User playlist](https://github.com/SathyaBhat/spotify-dl/pull/7), [skip MP3 conversion](https://github.com/SathyaBhat/spotify-dl/pull/34) and [Ability to use custom format string support](https://github.com/SathyaBhat/spotify-dl/pull/34) diff --git a/build.bat b/build.bat index 297ca80b..e75042fe 100755 --- a/build.bat +++ b/build.bat @@ -1,4 +1,3 @@ -pandoc --from=markdown --to=rst --output=README.rst README.md del /q dist\* python setup.py sdist python setup.py bdist_wheel diff --git a/images/spotify-playlist.png b/images/spotify-playlist.png new file mode 100644 index 00000000..5387f2e1 Binary files /dev/null and b/images/spotify-playlist.png differ diff --git a/requirements.txt b/requirements.txt index 03bb378c..c2c45f94 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ spotipy==2.3.8 google-api-python-client==1.6.2 youtube-dl>=2015.12.23 +sentry-sdk==0.14.1 \ No newline at end of file diff --git a/setup.py b/setup.py index 0d4b216b..3e5f9a2c 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ with open('requirements.txt') as f: requirements = f.read().splitlines() -version = '3.3.0' +version = '3.5.0' setup( name='spotify_dl', diff --git a/spotify_dl/constants.py b/spotify_dl/constants.py index 4f372c88..b12f4e98 100644 --- a/spotify_dl/constants.py +++ b/spotify_dl/constants.py @@ -4,5 +4,7 @@ YOUTUBE_API_VERSION = "v3" VIDEO = 'youtube#video' YOUTUBE_VIDEO_URL = 'https://www.youtube.com/watch?v=' -VERSION = '3.0.1' +VERSION = '3.5.0' +import sentry_sdk +sentry_sdk.init("https://7d74a39472c9449dac51eb24bb33bdc3@sentry.io/2383261") diff --git a/spotify_dl/spotify_dl.py b/spotify_dl/spotify_dl.py index 5d8beeaf..0a6e9e34 100644 --- a/spotify_dl/spotify_dl.py +++ b/spotify_dl/spotify_dl.py @@ -75,12 +75,13 @@ def spotify_dl(): sp = spotipy.Spotify(auth=token) log.debug('Arguments: {}'.format(args)) - url_match = playlist_url_pattern.match(args.url) - if args.url and url_match and len(url_match.groups()) > 0: - uri = "spotify:" + url_match.groups()[0].replace('/', ':') - args.uri = [uri] - else: - raise Exception('Invalid playlist URL ') + if args.url: + url_match = playlist_url_pattern.match(args.url) + if url_match and len(url_match.groups()) > 0: + uri = "spotify:" + url_match.groups()[0].replace('/', ':') + args.uri = [uri] + else: + raise Exception('Invalid playlist URL ') if args.uri: current_user_id, playlist_id = extract_user_and_playlist_from_uri(args.uri[0], sp) else: