viddl-rb 0.96 → 0.98

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA512:
3
- data.tar.gz: ff67e34025fae7f2799db8f7fcde11485942e5a7971d8f915bff66ec9ed49d20a0d8013f14268765dade6adc24c6c80320306fef363b78c876076942071d11eb
4
- metadata.gz: d77571b6da60ad4fdb6c235232c19c528ce7e3f03f290c580d89953ee4dc24d04d77fc02d9e5422007c4902a8263fa0c5fccf47e5329ca37c9970fa82ccbd462
5
2
  SHA1:
6
- data.tar.gz: fafe08cbf9074f38e92dcb632f397e45f86d2c00
7
- metadata.gz: 2019cc2be56479dd8827a2979641b8b14bc6cd08
3
+ data.tar.gz: 8a400ba81f44686ac1d23b19efaa1e37e76c98b1
4
+ metadata.gz: f8dc72f7877933446a2a0c243e5ea6205a8a13c5
5
+ SHA512:
6
+ data.tar.gz: 868498697d3850fe3d11071e6a4375a4215e6313a685cba072ac9f1318dbf6fe34b3fbdc3067bce13454697ce1720b94081442c552d5f2a8d630d67d81a4695c
7
+ metadata.gz: f0d977af3eb3a90ecdf5dbdc82e411051dba179807adeafc8cb8a3a5f07addd77ed9550fb9aa2af18379537678a98a754d24c258151fe6d70a85b97f63e3356d
data/README.md CHANGED
@@ -25,7 +25,7 @@ Viddl-rb supports the following command line options:
25
25
  -d, --downloader TOOL Specifies the tool to download with. Supports 'wget', 'curl' and 'net-http'
26
26
  -q, --quality QUALITY Specifies the video format and resolution in the following way: width:height:res (e.g. 1280:720:mp4)
27
27
  The width, height and resolution may be omitted with a *.
28
- For example, to match any quality with a width of 720 pixels in any format specify --quality *:720:*
28
+ For example, to match any quality with a height of 720 pixels in any format specify --quality *:720:*
29
29
  -h, --help Displays the help screen
30
30
  ```
31
31
 
@@ -1,4 +1,3 @@
1
- require 'shellwords'
2
1
 
3
2
  module ViddlRb
4
3
 
@@ -8,7 +7,7 @@ module ViddlRb
8
7
  def self.extract(file_name, save_dir)
9
8
  # capture stderr because ffmpeg expects an output param and will error out
10
9
  puts "Gathering information about the downloaded file."
11
- escaped_input_file_path = Shellwords.escape(File.join(save_dir, file_name))
10
+ escaped_input_file_path = UtilityHelper.make_shellsafe_path(File.join(save_dir, file_name))
12
11
  file_info = Open3.popen3("ffmpeg -i #{escaped_input_file_path}") {|stdin, stdout, stderr, wait_thr| stderr.read }
13
12
  puts "Done gathering information about the downloaded file."
14
13
 
@@ -1,7 +1,9 @@
1
- # This class contains utility methods that are used by both the bin utility and the library.
1
+
2
+ require 'shellwords'
2
3
 
3
4
  module ViddlRb
4
5
 
6
+ # This class contains utility methods that are used by both the bin utility and the library.
5
7
  class UtilityHelper
6
8
 
7
9
  # Loads all plugins in the plugin directory.
@@ -33,6 +35,19 @@ module ViddlRb
33
35
  (RbConfig::CONFIG["host_os"] =~ /windows|mingw/i) != nil
34
36
  end
35
37
 
38
+ def self.jruby?
39
+ ENV["RUBY_VERSION"].downcase.include?("jruby")
40
+ end
41
+
42
+ def self.make_shellsafe_path(path)
43
+ # JRuby cannot open some paths that are escaped with Shellwords.escape so this is a workaround.
44
+ if jruby?
45
+ '"' + path + '"'
46
+ else
47
+ Shellwords.escape(path)
48
+ end
49
+ end
50
+
36
51
  #checks to see whether the os has a certain utility like wget or curl
37
52
  #`` returns the standard output of the process
38
53
  #system returns the exit code of the process
@@ -87,7 +87,8 @@ class Decipherer
87
87
  'vflLjFx3B' => 'w40 w62 r s2 w21 s3 r w7 s3', # 10 Feb 2014
88
88
  'vfliqjKfF' => 'w40 w62 r s2 w21 s3 r w7 s3', # 13 Feb 2014
89
89
  'ima-vflxBu-5R' => 'w40 w62 r s2 w21 s3 r w7 s3', # 13 Feb 2014
90
- 'ima-vflrGwWV9' => 'w36 w45 r s2 r' # 20 Feb 2014
90
+ 'ima-vflrGwWV9' => 'w36 w45 r s2 r', # 20 Feb 2014
91
+ 'ima-vflCME3y0' => 'w8 s2 r w52' # 27 Feb 2014
91
92
  }
92
93
 
93
94
  def decipher_with_version(cipher, cipher_version)
@@ -22,7 +22,7 @@ class UrlResolver
22
22
  #http://www.youtube.com/watch?v=9WEP5nCxkEY&videos=jKY836_WMhE&playnext_from=TL&playnext=1
23
23
  #http://www.youtube.com/watch?v=Tk78sr5JMIU&videos=jKY836_WMhE
24
24
 
25
- playlist_ID = url[/(?:list=PL|p=)(.+?)(?:&|\/|$)/, 1]
25
+ playlist_ID = url[/(?:list=PL|p=|list=)(.+?)(?:&|\/|$)/, 1]
26
26
  Youtube.notify "Playlist ID: #{playlist_ID}"
27
27
  feed_url = PLAYLIST_FEED % playlist_ID
28
28
  url_array = get_video_urls(feed_url)
@@ -87,7 +87,6 @@ class VideoResolver
87
87
 
88
88
  def get_deciphered_sig(sig)
89
89
  return sig if sig.length == CORRECT_SIGNATURE_LENGTH
90
- #crequire 'pry'; binding.pry; exit
91
90
  @decipherer.decipher_with_version(sig, get_html5player_version)
92
91
  end
93
92
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: viddl-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: "0.96"
4
+ version: "0.98"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc Seeger
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2014-02-25 00:00:00 Z
12
+ date: 2014-02-27 00:00:00 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mime-types