poddb_client 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,19 @@
1
+
2
+ ------------------------------------------------------------------------
3
+ Enclosure urls with spaces in them break during download
4
+
5
+ Downloading podcast item 85689
6
+ /home/choi/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/uri/common.rb:156:in `split': bad URI(is not URI?): http://www.wypr.org/sites/default/files/podcast_audio/Midday 11.21.2011 1st HOUR.mp3 (URI::InvalidURIError)
7
+ from /home/choi/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/uri/common.rb:174:in `parse'
8
+ from /home/choi/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/uri/common.rb:628:in `parse'
9
+ from /home/choi/.rvm/gems/ruby-1.9.2-p290/gems/poddb_client-0.2.6/lib/poddb_client/downloading.rb:32:in `download'
10
+ from /home/choi/.rvm/gems/ruby-1.9.2-p290/gems/poddb_client-0.2.6/lib/poddb_client/downloading.rb:59:in `download_and_play'
11
+ from /home/choi/.rvm/gems/ruby-1.9.2-p290/gems/poddb_client-0.2.6/lib/poddb_client.rb:145:in `interactive'
12
+ from /home/choi/.rvm/gems/ruby-1.9.2-p290/gems/poddb_client-0.2.6/lib/poddb_client.rb:117:in `run'
13
+ from /home/choi/.rvm/gems/ruby-1.9.2-p290/gems/poddb_client-0.2.6/bin/poddb:4:in `<top (required)>'
14
+ from /home/choi/.rvm/gems/ruby-1.9.2-p290/bin/poddb:19:in `load'
15
+ from /home/choi/.rvm/gems/ruby-1.9.2-p290/bin/poddb:19:in `<main>'
16
+ [choi world~/Music/poddb]$ sed -n '32p' /home/choi/.rvm/gems/ruby-1.9.2-p290/gems/poddb_client-0.2.6/lib/poddb_client/downloading.rb
17
+ filename_suffix = File.extname(URI.parse(enclosure_url).path)
18
+
19
+
@@ -152,9 +152,9 @@ class PoddbClient
152
152
  def list_podcasts
153
153
  @outfile = PODCAST_LIST_OUTFILE
154
154
  @output = if @list_podcasts
155
- `curl -s '#{SERVER}/podcasts?#@params'`
155
+ curl "/podcasts?#@params"
156
156
  elsif @list_favorite_podcasts
157
- `curl -s '#{SERVER}/podcasts?podcast_ids=#{favorite_podcast_ids.join(',')}'`
157
+ curl "/podcasts?podcast_ids=#{favorite_podcast_ids.join(',')}"
158
158
  end
159
159
  if File.size?(FAVORITE_PODCASTS_FILE)
160
160
  @output = @output.split("\n").map {|line|
@@ -169,12 +169,12 @@ class PoddbClient
169
169
  end
170
170
 
171
171
  def items_from_favorites
172
- @output = `curl -s '#{SERVER}/items?podcast_ids=#{favorite_podcast_ids.join(',')}&#@params'`
172
+ @output = curl "/items?podcast_ids=#{favorite_podcast_ids.join(',')}&#@params"
173
173
  mark_already_downloaded
174
174
  end
175
175
 
176
176
  def search
177
- @output = `curl -s '#{SERVER}/search?#@params'`
177
+ @output = curl "/search?#@params"
178
178
  mark_already_downloaded
179
179
  end
180
180
 
@@ -182,6 +182,12 @@ class PoddbClient
182
182
  `rm -rf #{CACHE_DIR}/*`
183
183
  end
184
184
 
185
+
186
+ def curl(path)
187
+ @output = `curl -s '#{SERVER}/#{path}'`
188
+ @output = @output.force_encoding("UTF-8")
189
+ @output = @output.encode("UTF-8", undef: :replace, invalid: :replace)
190
+ end
185
191
  private
186
192
 
187
193
  def favorite_podcast_ids
@@ -21,7 +21,9 @@ class PoddbClient
21
21
 
22
22
  def download(item_id)
23
23
  puts "Downloading podcast item #{item_id}"
24
- response = `curl -s #{SERVER}/item/#{item_id}/download`
24
+ cmd = "curl -s #{SERVER}/item/#{item_id}/download"
25
+ puts cmd
26
+ response = `#{cmd}`
25
27
  data = YAML::load(response)
26
28
  item = data[:item]
27
29
  podcast = data[:podcast]
@@ -1,3 +1,3 @@
1
1
  class PoddbClient
2
- VERSION = '0.2.6'
2
+ VERSION = '0.2.7'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poddb_client
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: 2011-10-12 00:00:00.000000000Z
12
+ date: 2012-10-20 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Podcast aggregation from the command line
15
15
  email:
@@ -25,6 +25,7 @@ files:
25
25
  - Rakefile
26
26
  - bin/poddb
27
27
  - coverage.markdown
28
+ - docs/issues.txt
28
29
  - lib/interactive.vim
29
30
  - lib/poddb_client.rb
30
31
  - lib/poddb_client/downloading.rb
@@ -51,7 +52,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
51
52
  version: '0'
52
53
  requirements: []
53
54
  rubyforge_project: poddb_client
54
- rubygems_version: 1.8.10
55
+ rubygems_version: 1.8.23
55
56
  signing_key:
56
57
  specification_version: 3
57
58
  summary: Podcast aggregation from the command line