Sha256: d3469b2a539feff17dabe35c3ed8ff56624a39612091d79148e0d3650fd3c31c

Contents?: true

Size: 486 Bytes

Versions: 5

Compression:

Stored size: 486 Bytes

Contents

module SpotifyToMp3
  class Grooveshark
    def initialize(client)
      @client = client
    end

    def get_track(query)
      client_track = @client.search_songs(query).first or raise "Track not found"
      Track.new(client_track)
    end

    def download(track)
      url = @client.get_song_url(track.client_track)
      file = RestClient::Request.execute(:method => :post, :url => url, :raw_response => true).file
      FileUtils.mv(file.path, track.filename)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
spotify-to-mp3-0.5.4 lib/spotify_to_mp3/grooveshark.rb
spotify-to-mp3-0.5.3 lib/spotify_to_mp3/grooveshark.rb
spotify-to-mp3-0.5.2 lib/spotify_to_mp3/grooveshark.rb
spotify-to-mp3-0.5.1 lib/spotify_to_mp3/grooveshark.rb
spotify-to-mp3-0.5 lib/spotify_to_mp3/grooveshark.rb