Created
October 20, 2009 00:12
-
-
Save perplexes/213864 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'contrib/resolver_libs/playdar_resolver' | |
$:.unshift(File.dirname(__FILE__)) | |
require 'rhap' | |
class RhapsodyResolver < PlaydarResolver | |
def resolver_settings | |
{:name => "Rhapsody Resolver"} | |
end | |
def results(query) | |
return [] unless query['track'].sounds_like("Crazy Little Thing Called Love") | |
r = Rhap.new(ARGV[0], ARGV[1]) | |
[{ | |
:artist => "Queen", | |
:track => "Crazy Little Thing Called Love", | |
:size => 4971780, | |
:bitrate => 160, | |
:duration => 248, | |
# Don't worky | |
#:extra_headers => ["User-Agent: Nothing"], | |
:url => r.get_track_url('tra.2011082'), | |
#:url => "http://127.0.0.1:8081/crazy.mp3", | |
#:url => "http://play.mokele.co.uk/music/Hiding%20In%20Your%20Insides.mp3", | |
:score => 0.99 | |
}] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment