hulu-automuter 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -64,6 +64,19 @@ browser.
64
64
 
65
65
  Press `CTRL-c` to stop hulu-automuter.
66
66
 
67
+ ## For Linux Audio
68
+
69
+ On Linux, the default amixer mute command is
70
+
71
+ amixer set Master mute
72
+
73
+ This will probbaly work if you use your computer's speakers or headphone
74
+ jack. If you use USB speakers, you may need to change this default by
75
+ setting the AUTOMUTE_COMMAND environment variable.
76
+
77
+ export AUTOMUTE_COMMAND="amixer -c 1 set PCM mute"
78
+ hulu-automuter
79
+
67
80
 
68
81
  ## Tips
69
82
 
@@ -31,6 +31,17 @@ a HTTP proxy at localhost:8123.
31
31
  Then you can start hulu-automuter and go to hulu.com in your configured web
32
32
  browser.
33
33
 
34
+ On Linux, the default amixer mute command is
35
+
36
+ amixer set Master mute
37
+
38
+ This will probbaly work if you use your computer's speakers or headphone
39
+ jack. If you use USB speakers, you may need to change this default by
40
+ setting the AUTOMUTE_COMMAND environment variable.
41
+
42
+ export AUTOMUTE_COMMAND="amixer -c 1 set PCM mute"
43
+ hulu-automuter
44
+
34
45
  END
35
46
 
36
47
  if ARGV.first =~ /-p/
@@ -47,12 +58,17 @@ require 'webrick/httpproxy'
47
58
 
48
59
  module HuluControl
49
60
  class Linux
61
+ def initialize
62
+ @mute_command = ENV['AUTOMUTE_COMMAND'] || "amixer set Master mute"
63
+ puts "The automute command is '#@mute_command'"
64
+ end
65
+
50
66
  def mute
51
- "amixer set Master mute"
67
+ @mute_command
52
68
  end
53
69
 
54
70
  def unmute
55
- "amixer set Master unmute"
71
+ @mute_command.sub("mute", "unmute")
56
72
  end
57
73
  end
58
74
 
@@ -89,10 +105,10 @@ hc = case RUBY_PLATFORM
89
105
  proxyproc = Proc.new{|req,res|
90
106
  r = req.path
91
107
  next unless req.host =~ /hulu\.com/
92
- if r =~ /adload/ || r =~ /revenue\/(request|start)/ || req.query =~ /adstartvolume=/
108
+ if r =~ /adload/
93
109
  $stdout.puts ["ad loaded", hc.mute].join(', ')
94
110
  `#{hc.mute}`
95
- elsif r =~ /contentplaybackresume/ || r =~ /playback\/(start|position)/ # || r =~ /revenue\/end/
111
+ elsif r =~ /contentplaybackresume/
96
112
  $stdout.puts ["content resuming", hc.unmute].join(', ')
97
113
  `#{hc.unmute}`
98
114
  end
@@ -1,3 +1,3 @@
1
1
  module HuluAutomuter
2
- VERSION = '0.0.8'
2
+ VERSION = '0.0.9'
3
3
  end
metadata CHANGED
@@ -1,24 +1,33 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: hulu-automuter
3
- version: !ruby/object:Gem::Version
4
- version: 0.0.8
5
- prerelease:
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 9
9
+ version: 0.0.9
6
10
  platform: ruby
7
- authors:
11
+ authors:
8
12
  - Daniel Choi
9
13
  autorequire:
10
14
  bindir: bin
11
15
  cert_chain: []
12
- date: 2011-07-28 00:00:00.000000000Z
16
+
17
+ date: 2011-09-14 00:00:00 -04:00
18
+ default_executable:
13
19
  dependencies: []
20
+
14
21
  description: Auto-mute Hulu commericials
15
- email:
22
+ email:
16
23
  - dhchoi@gmail.com
17
- executables:
24
+ executables:
18
25
  - hulu-automuter
19
26
  extensions: []
27
+
20
28
  extra_rdoc_files: []
21
- files:
29
+
30
+ files:
22
31
  - .gitignore
23
32
  - NOTES
24
33
  - README.markdown
@@ -33,28 +42,39 @@ files:
33
42
  - screens/hulu1.png
34
43
  - screens/hulu2-sm.png
35
44
  - screens/hulu2.png
45
+ has_rdoc: true
36
46
  homepage: http://danielchoi.com/software/hulu_automuter.html
37
47
  licenses: []
48
+
38
49
  post_install_message:
39
50
  rdoc_options: []
40
- require_paths:
51
+
52
+ require_paths:
41
53
  - lib
42
- required_ruby_version: !ruby/object:Gem::Requirement
54
+ required_ruby_version: !ruby/object:Gem::Requirement
43
55
  none: false
44
- requirements:
45
- - - ! '>='
46
- - !ruby/object:Gem::Version
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ segments:
60
+ - 1
61
+ - 8
62
+ - 6
47
63
  version: 1.8.6
48
- required_rubygems_version: !ruby/object:Gem::Requirement
64
+ required_rubygems_version: !ruby/object:Gem::Requirement
49
65
  none: false
50
- requirements:
51
- - - ! '>='
52
- - !ruby/object:Gem::Version
53
- version: '0'
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ segments:
70
+ - 0
71
+ version: "0"
54
72
  requirements: []
73
+
55
74
  rubyforge_project: hulu_automuter
56
- rubygems_version: 1.8.6
75
+ rubygems_version: 1.3.7
57
76
  signing_key:
58
77
  specification_version: 3
59
78
  summary: Auto-mute Hulu commericials
60
79
  test_files: []
80
+