downcer 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +49 -7
- data/config/.downcerrc +1 -0
- data/lib/downcer/cli.rb +1 -1
- data/lib/downcer/version.rb +1 -1
- metadata +1 -1
data/README.markdown
CHANGED
@@ -46,19 +46,61 @@ Usage
|
|
46
46
|
github.com:
|
47
47
|
command: hub
|
48
48
|
option: clone
|
49
|
+
my.private.server.local:
|
50
|
+
command: wget
|
51
|
+
option: --http-user=username --http-password=password
|
49
52
|
default:
|
50
53
|
command: curl
|
51
54
|
option: -LO
|
52
55
|
|
53
56
|
2. Run `downcer`
|
54
57
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
58
|
+
YouTube ([youtube-dl](http://rg3.github.com/youtube-dl))
|
59
|
+
|
60
|
+
```sh
|
61
|
+
$ downcer 'http://www.youtube.com/watch?v=QH2-TGUlwu4'
|
62
|
+
Use `youtube-dl`
|
63
|
+
--
|
64
|
+
[youtube] Setting language
|
65
|
+
[youtube] QH2-TGUlwu4: Downloading video webpage
|
66
|
+
[youtube] QH2-TGUlwu4: Downloading video info webpage
|
67
|
+
[youtube] QH2-TGUlwu4: Extracting video information
|
68
|
+
[download] Destination: Nyan_Cat_original-QH2-TGUlwu4.flv
|
69
|
+
[download] 100.0% of 13.93M at 1.90M/s ETA 00:00
|
70
|
+
```
|
71
|
+
|
72
|
+
GitHub Repository
|
73
|
+
|
74
|
+
```sh
|
75
|
+
$ downcer https://github.com/holman/spark
|
76
|
+
Use `hub`
|
77
|
+
--
|
78
|
+
Cloning into 'spark'...
|
79
|
+
remote: Counting objects: 193, done.
|
80
|
+
remote: Compressing objects: 100% (105/105), done.
|
81
|
+
remote: Total 193 (delta 99), reused 174 (delta 85)
|
82
|
+
Receiving objects: 100% (193/193), 31.69 KiB, done.
|
83
|
+
Resolving deltas: 100% (99/99), done.
|
84
|
+
```
|
85
|
+
|
86
|
+
Private basic authentication file server
|
87
|
+
|
88
|
+
```sh
|
89
|
+
$ downcer http://my.private.server.local/movies/sample.mp4
|
90
|
+
Use `wget`
|
91
|
+
--
|
92
|
+
--2012-09-11 21:19:11-- http://my.private.server.local/movies/sample.mp4
|
93
|
+
Resolving my.private.server.local... 10.0.1.2
|
94
|
+
Connecting to my.private.server.local|10.0.1.2|:80... connected.
|
95
|
+
HTTP request sent, awaiting response... 401 Unauthorized
|
96
|
+
Reusing existing connection to my.private.server.local:80.
|
97
|
+
HTTP request sent, awaiting response... 200 OK
|
98
|
+
Length: 208737764 (199M) [text/plain]
|
99
|
+
Saving to: ‘sample.m4v’
|
100
|
+
100%[=================================================================>] 208,737,764 2.49MB/s in 98s
|
101
|
+
|
102
|
+
2012-09-11 21:20:49 (2.04 MB/s) - ‘sample.m4v’ saved [208737764/208737764]
|
103
|
+
```
|
62
104
|
|
63
105
|
|
64
106
|
LICENSE
|
data/config/.downcerrc
CHANGED
data/lib/downcer/cli.rb
CHANGED
@@ -12,7 +12,7 @@ module Downcer
|
|
12
12
|
def initialize(url)
|
13
13
|
@url = URI.parse(URI.encode(url))
|
14
14
|
@config = get_config(@url)
|
15
|
-
rescue URI::InvalidURIError => e
|
15
|
+
rescue NoMethodError, URI::InvalidURIError => e
|
16
16
|
abort 'Usage: downcer <url>'
|
17
17
|
rescue SystemCallError => e
|
18
18
|
abort e.to_s
|
data/lib/downcer/version.rb
CHANGED