grooveshark 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -127,7 +127,7 @@ module Grooveshark
127
127
  private
128
128
 
129
129
  def get_method_salt(method)
130
- get_method_client(method) == 'jsqueue' ? 'spiralLightbulbs' : 'riceAndChicken'
130
+ get_method_client(method) == 'jsqueue' ? 'closeButNoCigar' : 'breakfastBurritos'
131
131
  end
132
132
  end
133
133
  end
@@ -22,11 +22,7 @@ module Grooveshark
22
22
  body['header']['token'] = create_token(method) if @comm_token
23
23
 
24
24
  begin
25
- data = RestClient.post(url, body.to_json, {
26
- 'User-Agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.77 Safari/537.1',
27
- 'Content-Type' => 'application/json',
28
- 'Referer' => get_method_referer(method)
29
- })
25
+ data = RestClient.post(url, body.to_json, {'Content-Type' => 'application/json'})
30
26
  rescue Exception => ex
31
27
  raise GeneralError, ex.message
32
28
  end
@@ -61,11 +57,7 @@ module Grooveshark
61
57
  end
62
58
 
63
59
  def get_method_client_revision(method)
64
- get_method_client(method) == 'jsqueue' ? '20120227' : '20120227.01'
65
- end
66
-
67
- def get_method_referer(method)
68
- "http://grooveshark.com/JSQueue.swf?20120521.02" if get_method_client(method) == 'jsqueue'
60
+ get_method_client(method) == 'jsqueue' ? '20120312.02' : '20120312'
69
61
  end
70
62
  end
71
63
  end
@@ -1,3 +1,3 @@
1
1
  module Grooveshark
2
- VERSION = '0.2.6'
3
- end
2
+ VERSION = '0.2.7'
3
+ end
@@ -48,8 +48,9 @@ describe 'Client' do
48
48
 
49
49
  context 'download' do
50
50
  it 'should download without being banned' do
51
- 4.times do # Usually the IP is banned on the 4th request on protocol mismatch
52
- gs = Grooveshark::Client.new
51
+ gs = Grooveshark::Client.new
52
+ ten_minutes_later = Time.new + 15 * 60 # Usually IP is banned after about 10 minutes
53
+ while Time.new < ten_minutes_later do
53
54
  # Try with a short song (this one is about a minute long)
54
55
  song = gs.search_songs("Alan Reeves The Chase").first
55
56
  url = gs.get_song_url(song)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grooveshark
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-05 00:00:00.000000000 Z
12
+ date: 2013-01-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -130,7 +130,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
130
130
  version: '0'
131
131
  segments:
132
132
  - 0
133
- hash: -1817251716244594771
133
+ hash: 504227010873878309
134
134
  required_rubygems_version: !ruby/object:Gem::Requirement
135
135
  none: false
136
136
  requirements:
@@ -139,10 +139,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  version: '0'
140
140
  segments:
141
141
  - 0
142
- hash: -1817251716244594771
142
+ hash: 504227010873878309
143
143
  requirements: []
144
144
  rubyforge_project:
145
- rubygems_version: 1.8.24
145
+ rubygems_version: 1.8.23
146
146
  signing_key:
147
147
  specification_version: 3
148
148
  summary: Grooveshark API