Skip to content

Instantly share code, notes, and snippets.

@perplexes
Created October 20, 2009 00:12
Show Gist options
  • Save perplexes/213864 to your computer and use it in GitHub Desktop.
Save perplexes/213864 to your computer and use it in GitHub Desktop.
#!/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