Giter Site home page Giter Site logo

teashawn / spotrip Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chris124567/spotrip

0.0 0.0 0.0 2 KB

Spotify ripper: download an artists entire discography, individual albums, or tracks; written in Go with a patched version of Librespot to allow for free accounts

spotrip's Introduction

NOTICE

Due to potential legal problems from circumventing Spotify's content protection, I have deleted the code in this repository.

This README used to read:

spotrip

This is an open source Spotify song ripping application written in Golang (using a modified version of Librespot). It works with both Spotify free and premium accounts. It can download individual tracks, albums, or entire artist discographies. It downloads the audio files served by Spotify's servers and does not work by recording audio outputs.

Note

Use of this tool may result in your account getting banned by Spotify. Please do not use it on accounts you have spent any money on. I am not liable for how you use this tool in any way. From my experience using this tool, I have observed that Spotify has rate limiting measures and must have some idea of what is going on.

Dependencies

At least Go 1.11 to allow for module support.

For adding metadata to the downloaded files, the taglib developer libraries are required. Learn how to install them here.

Build

Get the package:

$ go get github.com/chris124567/spotrip

There will be a warning about some undefined functions. It can safely be ignored. This is because we have a local version of librespot, which adds additional functionality. This project uses the "replace" directive in go.mod to avoid having to replace all the import paths, but the Go developers do not want to make go get support the replace directive. Just make sure to run the next step to be able to use the program.

$ cd $GOPATH/src/github.com/chris124567/spotrip
$ scripts/build.sh

You should now see an executable file called spotrip. This is the program.

Usage

A typical session would look something like (replacing credentials obviously):

$ spotrip --username [email protected] --password password --search "bing crosby"

Artist: Bing Crosby (6ZjFtWeHP9XN7FeKSUe80S)
Artist: Bing Crosby & Ella Fitzgerald (12vDf3ySm1HSBb9xFmmFdG)
Artist: Bing Crosby and Fred Astaire (2adeNkZOTG985M6JcXaJgV)
...
Album: Bing Crosby - Bing Crosby - Christmas Classics (3My4DXwRjAS5HXontsJx1A)
Album: Bing Crosby - Bing Crosby Sings Christmas Songs (3tKDUoAPs0fEgR5GSqXXNl)
Album: Bing Crosby - Bing Crosby And Some Jazz Friends (1rQ6SUk3ktdbL0cAdKYqIM)
...
Track: Bing Crosby - Silent Night (4eJPzDcuWmXMedrwAbUeCt)
Track: Bing Crosby - Little Angel (6CbXPzY82Jcoq2sBUzMgbq)
Track: Bing Crosby - Paradise Isle (7bp5088fuDSi5D0VhDa6PE)

The IDs are the 22 character identifiers listed in parentheses.

To download all tracks by "Bing Crosby," you would run:

$ spotrip --username [email protected] --password password --artists 6ZjFtWeHP9XN7FeKSUe80S

To download the "Christmas Classics" album, you would run:

$ spotrip --username [email protected] --password password --albums 3My4DXwRjAS5HXontsJx1A

To download "Silent Night," you would run

$ spotrip --username [email protected] --password password --tracks 4eJPzDcuWmXMedrwAbUeCt

--artists, --albums, and --tracks all accept multiple IDs as arguments. Just separate them by comma, like so:

$ spotrip --username [email protected] --password password --tracks "4eJPzDcuWmXMedrwAbUeCt,6CbXPzY82Jcoq2sBUzMgbq"

Also, any of the arguments can be used simultaneously. --albums can be used when --tracks or --artists is used without any problems (this is also preferable to running the commands separately to prevent repeated Spotify authentications).

Help

  -albums string
        List of album IDs to download, separated by commas.
  -artist_info string
        Specify an artist ID in this field to get JSON formatted information about that artist.
  -artists string
        List of artist IDs to download (downloads all of their albums, singles, and compilations), separated by commas.
  -password string
        Password of the spotify account. Required.
  -search string
        Search query.
  -tracks string
        List of track IDs to download, separated by commas.
  -username string
        Username of the spotify account. Required.

Additional Note on Search

To prevent yourself from generating a "suspicious" amount of logins from this tool, you may want to use the search interface available at https://open.spotify.com/search. Simply right click the album, track, or artist you wish to download and press "Copy Song Link." The ID follows the last slash of the URL, for instance, in:

https://open.spotify.com/track/4qOPuARt2HNHAOlgXBezoT

4qOPuARt2HNHAOlgXBezoT would be the track ID.

Todo

This application currently has several limitations that will be addressed in future versions, notably:

* Only 160 KBPS OGG downloads are supported (even though Spotify offers 320 KBPS to Premium members and also gives 96 KBPS to free members as a low bandwith option).  This will be a configurable option in the future with priority system for qualities (in case one is not available).
* There is no way to customize output file names
* There is no playlist downloading support
* There is no podcast/show support

Credits

Thanks to Librespot for reverse engineering the Spotify protocol and releasing their tools for free. They are the ones that make third party Spotify clients possible.

spotrip's People

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.