rget 4.4.1 → 4.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/bin/nicodl +3 -0
  3. data/bin/ulizadl +44 -0
  4. data/rget.gemspec +1 -1
  5. metadata +5 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d863406e388176c12dfac1d108b1c473005002733b1527ee5d09b4ebcb46bd84
4
- data.tar.gz: 4e8b58cfac36c5c55302b0cecc1e58f83e12d0aaa14fa6abe5c6981b99ac3fd6
3
+ metadata.gz: 18e07797f4bbf813a7a6c72ecd222821e0c08aac2c3ba94cef08c2524e08ac8b
4
+ data.tar.gz: a9a221ef18663ca77253ddea413612e28c320de291138530e4c7869871c04284
5
5
  SHA512:
6
- metadata.gz: b5e8f4a54892e776bac0886d621aa7467f1fa6ff922bde87d1a0edb3bc4c884fa8af7b2925f47a9741a4977f30c2705bc9009297a69f3fc2574401d94edc3a7d
7
- data.tar.gz: 0bfa23ab8d2e19926eb961e158748fbf0d54faf1ca65d9a0e5bfe25e9a502e553317c9d70ec031db0b8ecb1ac16eba6cf36e19cf6d75c7d025386dfe9362ac0b
6
+ metadata.gz: 89bfda21a389f9b18032fafa58f7bc9142e2be8b804745b076a8f54cf919b7fa29bd61da8b7cc6c9126d8bcc486181696da065c177f801fd9834edcf8437cef9
7
+ data.tar.gz: 7c5c3a364f2d094afce9d5c6c1fc58121714c1d55b4f1a69a8a82cb51ee72d164c96b09d0a7f2d25c7442b4cb1059d066953cb83328311163195068a9f0f53b8
data/bin/nicodl CHANGED
@@ -87,6 +87,9 @@ ARGV.each do |player_url|
87
87
  rescue Niconico::Live::TicketRetrievingFailed
88
88
  $stderr.puts $!
89
89
  exit 2
90
+ rescue Niconico::Live::ReservationNotAccepted
91
+ $stderr.puts "press 'タイムシフト視聴する' button before getting videos."
92
+ exit 3
90
93
  end
91
94
  end
92
95
  end
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env ruby
2
+ require "uri"
3
+ require "mechanize"
4
+ require 'open-uri'
5
+
6
+ if ARGV.size != 2
7
+ $stderr.puts "download TS file decoded by Uliza style video streaming"
8
+ $stderr.puts "ulizadl <playlist.m3u8> <output(.ts)>"
9
+ exit 1
10
+ end
11
+
12
+ m3u8 = ARGV.shift
13
+ ts_file = "#{ARGV.shift}.ts"
14
+
15
+ begin
16
+ agent = Mechanize.new
17
+ agent.user_agent_alias = 'Windows Chrome'
18
+ agent.verify_mode = OpenSSL::SSL::VERIFY_NONE
19
+ agent.get(m3u8)
20
+ body = agent.page.body
21
+ rescue ArgumentError
22
+ body = open(m3u8, &:read)
23
+ end
24
+ tses = body.scan(/.*\.ts.*/)
25
+ key_url = body.scan(/URI="(.*)"/).flatten.first
26
+
27
+ if key_url
28
+ key = agent.get_file(key_url)
29
+ decoder = OpenSSL::Cipher.new('aes-128-cbc')
30
+ decoder.key = key
31
+ decoder.decrypt
32
+ else
33
+ decoder = ''
34
+ def decoder.update(s); return s; end
35
+ end
36
+
37
+ open(ts_file, 'wb:ASCII-8BIT') do |ts|
38
+ tses.each_with_index do |file, count|
39
+ print "#{count+1}/#{tses.size}\r"
40
+ ts.write(decoder.update(agent.get_file(file)))
41
+ end
42
+ ts.write(decoder.final)
43
+ puts
44
+ end
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "rget"
7
- spec.version = "4.4.1"
7
+ spec.version = "4.5.0"
8
8
  spec.authors = ["TADA Tadashi"]
9
9
  spec.email = ["t@tdtds.jp"]
10
10
  spec.description = %q{Downloading newest radio programs on the web. Supported radio stations are hibiki, onsen, niconico and freshlive.}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rget
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.4.1
4
+ version: 4.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - TADA Tadashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-17 00:00:00.000000000 Z
11
+ date: 2018-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -144,6 +144,7 @@ executables:
144
144
  - add_mp3info
145
145
  - nicodl
146
146
  - rget
147
+ - ulizadl
147
148
  extensions: []
148
149
  extra_rdoc_files: []
149
150
  files:
@@ -155,6 +156,7 @@ files:
155
156
  - bin/add_mp3info
156
157
  - bin/nicodl
157
158
  - bin/rget
159
+ - bin/ulizadl
158
160
  - lib/dropbox.rb
159
161
  - lib/freshlive.rb
160
162
  - lib/hibiki.rb
@@ -185,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
187
  version: '0'
186
188
  requirements: []
187
189
  rubyforge_project:
188
- rubygems_version: 2.7.3
190
+ rubygems_version: 2.7.6
189
191
  signing_key:
190
192
  specification_version: 4
191
193
  summary: Downloading newest radio programs on the web.