viddl-rb 1.0.0 → 1.0.1
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 +4 -4
- data/README.md +8 -7
- data/plugins/bandcamp.rb +40 -0
- data/plugins/soundcloud.rb +20 -28
- metadata +10 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
|
4
|
-
|
3
|
+
data.tar.gz: d497fc050ace12babbf349b9a784bc4d25f575b6
|
4
|
+
metadata.gz: f762d1748ff20ddecf6a8a243934ed8002c2bf7b
|
5
5
|
SHA512:
|
6
|
-
|
7
|
-
|
6
|
+
data.tar.gz: ec1be57e9dfbb1e44489fa6cca3af761ab3433b012a7e7984a21fa09a1011155b7141939f3770e40a369a3b714f2dba8ac205630e1af9a4a98244422b4cead93
|
7
|
+
metadata.gz: 584785893e0f19ee4da9b374619e878c726297847cf3f7f2dfbd8cedf18338c1806d68a3d3f6690c9d678ad8b08bcba76de3fb3ca2204394d4bad5eddc06ef99
|
data/README.md
CHANGED
@@ -16,15 +16,15 @@ Download a video:
|
|
16
16
|
|
17
17
|
Viddl-rb supports the following command line options:
|
18
18
|
```
|
19
|
-
-e, --extract-audio
|
20
|
-
-a, --abort-on-failure Abort
|
21
|
-
-u, --url-only
|
22
|
-
-t, --title-only
|
19
|
+
-e, --extract-audio Extract the audio track of the download to a separate file
|
20
|
+
-a, --abort-on-failure Abort if one of the videos in a list fails to download
|
21
|
+
-u, --url-only Just display the download url without downloading the file.
|
22
|
+
-t, --title-only Just display the title without downloading the file.
|
23
23
|
-f, --filter REGEX Filters a video playlist according to the regex (Youtube only right now)
|
24
24
|
-s, --save-dir DIRECTORY Specifies the directory where videos should be saved
|
25
|
-
-d, --downloader TOOL Specifies the tool to download with. Supports 'wget', 'curl' and 'net-http'
|
26
|
-
-q, --quality QUALITY Specifies the video format and resolution in the following way: width:height:
|
27
|
-
The width, height and
|
25
|
+
-d, --downloader TOOL Specifies the tool to download with. Supports 'wget', 'curl', 'aria2c' and 'net-http'
|
26
|
+
-q, --quality QUALITY Specifies the video format and resolution in the following way: width:height:format (e.g. 1280:720:mp4)
|
27
|
+
The width, height and format may be omitted with a *.
|
28
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
|
```
|
@@ -128,6 +128,7 @@ __Co Maintainers:__
|
|
128
128
|
* [farleyknight](https://github.com/farleyknight): Various small fixes and improvements
|
129
129
|
|
130
130
|
__Contributors:__
|
131
|
+
* [albertoboni](https://github.com/albertoboni) bandcamp plugin, soundcloud improvements
|
131
132
|
* [divout](https://github.com/divout) aka Ivan K: blip.tv plugin, bugfixes
|
132
133
|
* Sniper: bugfixes
|
133
134
|
* [Serabe](https://github.com/Serabe) aka Sergio Arbeo: packaging viddl as a binary
|
data/plugins/bandcamp.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'open-uri'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
class Bandcamp < PluginBase
|
5
|
+
|
6
|
+
# this will be called by the main app to check whether this plugin is responsible for the url passed
|
7
|
+
def self.matches_provider?(url)
|
8
|
+
url.include?("bandcamp.com")
|
9
|
+
end
|
10
|
+
|
11
|
+
|
12
|
+
# return the url for original video file and title
|
13
|
+
def self.get_urls_and_filenames(url, options = {})
|
14
|
+
# locate the js object with all the tracks data
|
15
|
+
url_and_files = []
|
16
|
+
doc = Nokogiri::HTML(open(get_http_url(url)))
|
17
|
+
js = doc.at("script:contains('var TralbumData')").text
|
18
|
+
match = js[/trackinfo.*(\[.*\])/,1]
|
19
|
+
|
20
|
+
# parse the js object
|
21
|
+
JSON.parse(match).each do |track_data|
|
22
|
+
track_url = ''
|
23
|
+
|
24
|
+
# hopefully the last is the best
|
25
|
+
track_url = track_data["file"].values.last
|
26
|
+
|
27
|
+
# create a good mp3 name
|
28
|
+
track_name = self.make_filename_safe(track_data['title']) + '.mp3'
|
29
|
+
|
30
|
+
# add to the response
|
31
|
+
url_and_files << {url: track_url, name: track_name}
|
32
|
+
end
|
33
|
+
|
34
|
+
url_and_files
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.get_http_url(url)
|
38
|
+
url.sub(/https?:\/\//, "http:\/\/")
|
39
|
+
end
|
40
|
+
end
|
data/plugins/soundcloud.rb
CHANGED
@@ -1,40 +1,32 @@
|
|
1
|
+
require 'nokogiri'
|
1
2
|
require 'open-uri'
|
3
|
+
require 'json'
|
4
|
+
|
2
5
|
class Soundcloud < PluginBase
|
3
6
|
# this will be called by the main app to check whether this plugin is responsible for the url passed
|
4
7
|
def self.matches_provider?(url)
|
5
8
|
url.include?("soundcloud.com")
|
6
9
|
end
|
7
10
|
|
11
|
+
|
8
12
|
# return the url for original video file and title
|
9
13
|
def self.get_urls_and_filenames(url, options = {})
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
str.gsub!(/'/, '')
|
27
|
-
|
28
|
-
# Replace any non-letter or non-number character with a space
|
29
|
-
str.gsub!(/[^A-Za-z0-9]+/, ' ')
|
30
|
-
|
31
|
-
# Remove spaces from beginning and end of string
|
32
|
-
str.strip!
|
33
|
-
|
34
|
-
# Replace groups of spaces with single hyphen
|
35
|
-
str.gsub!(/\ +/, '-')
|
36
|
-
|
37
|
-
str
|
14
|
+
url_and_files = []
|
15
|
+
doc = Nokogiri::HTML(open(get_http_url(url)))
|
16
|
+
|
17
|
+
# locate the controller script that contains all the tracks data
|
18
|
+
# this will work for either artist's or track's pages
|
19
|
+
doc.css('#main-content-inner .container + script').each do |container|
|
20
|
+
match = container.text.to_s.match(/\((\{.*\})\)/).to_a
|
21
|
+
track_data = JSON.parse(match[1])
|
22
|
+
|
23
|
+
file_url = track_data['streamUrl']
|
24
|
+
file_name = self.make_filename_safe(track_data['title'].to_s) + '.mp3'
|
25
|
+
|
26
|
+
url_and_files << {url: file_url, name: file_name}
|
27
|
+
end
|
28
|
+
|
29
|
+
url_and_files
|
38
30
|
end
|
39
31
|
|
40
32
|
def self.get_http_url(url)
|
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: 1.0.
|
4
|
+
version: 1.0.1
|
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-04-
|
12
|
+
date: 2014-04-27 00:00:00 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mime-types
|
@@ -79,22 +79,28 @@ extensions: []
|
|
79
79
|
extra_rdoc_files: []
|
80
80
|
|
81
81
|
files:
|
82
|
+
- Gemfile
|
83
|
+
- Gemfile.lock
|
84
|
+
- README.md
|
85
|
+
- Rakefile
|
82
86
|
- bin/helper/downloader.rb
|
83
87
|
- bin/helper/driver.rb
|
84
88
|
- bin/helper/parameter-parser.rb
|
85
89
|
- bin/viddl-rb
|
86
|
-
- lib/viddl-rb.rb
|
87
90
|
- helper/audio-helper.rb
|
88
91
|
- helper/download-helper.rb
|
89
92
|
- helper/plugin-helper.rb
|
90
93
|
- helper/utility-helper.rb
|
94
|
+
- lib/viddl-rb.rb
|
91
95
|
- plugins/arte_plus_seven.rb
|
96
|
+
- plugins/bandcamp.rb
|
92
97
|
- plugins/blip.rb
|
93
98
|
- plugins/dailymotion.rb
|
94
99
|
- plugins/metacafe.rb
|
95
100
|
- plugins/soundcloud.rb
|
96
101
|
- plugins/veoh.rb
|
97
102
|
- plugins/vimeo.rb
|
103
|
+
- plugins/youtube.rb
|
98
104
|
- plugins/youtube/cipher_guesser.rb
|
99
105
|
- plugins/youtube/cipher_io.rb
|
100
106
|
- plugins/youtube/ciphers.yml
|
@@ -103,11 +109,6 @@ files:
|
|
103
109
|
- plugins/youtube/format_picker.rb
|
104
110
|
- plugins/youtube/url_resolver.rb
|
105
111
|
- plugins/youtube/video_resolver.rb
|
106
|
-
- plugins/youtube.rb
|
107
|
-
- Gemfile
|
108
|
-
- Gemfile.lock
|
109
|
-
- Rakefile
|
110
|
-
- README.md
|
111
112
|
homepage: https://github.com/rb2k/viddl-rb
|
112
113
|
licenses:
|
113
114
|
- MIT
|
@@ -131,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
132
|
requirements: []
|
132
133
|
|
133
134
|
rubyforge_project: viddl-rb
|
134
|
-
rubygems_version: 2.
|
135
|
+
rubygems_version: 2.2.2
|
135
136
|
signing_key:
|
136
137
|
specification_version: 4
|
137
138
|
summary: An extendable commandline video downloader for flash video sites.
|