xunlei 0.0.1 → 0.0.2
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.
- data/README.md +19 -4
- data/bin/xunlei +9 -0
- data/lib/xunlei/engine.rb +1 -1
- data/lib/xunlei/version.rb +1 -1
- metadata +8 -8
data/README.md
CHANGED
@@ -7,26 +7,41 @@ Summary:
|
|
7
7
|
-----------
|
8
8
|
|
9
9
|
This is a browser script for lixian.vip.xunlei.com.
|
10
|
-
It drives Google Chrome to do automation tasks for you,
|
11
|
-
make sure you have Google Chrome installed first.
|
10
|
+
It drives Google Chrome with [chromedriver](http://code.google.com/p/selenium/wiki/ChromeDriver) to do automation tasks for you,
|
11
|
+
so please make sure you have Google Chrome installed first.
|
12
|
+
|
13
|
+
It can automatically dump task file names and urls as well as browser cookies,
|
14
|
+
so that it can delegate to wget to download files for you.
|
15
|
+
|
16
|
+
It can handle both normal tasks and BT tasks, and won't complain even if you
|
17
|
+
have pages and pages of tasks on http://lixian.vip.xunlei.com
|
18
|
+
|
19
|
+
And since it uses wget -c option,
|
20
|
+
you don't need to worry about interrupted downloads
|
21
|
+
or completely downloaded files been overwritten any more.
|
22
|
+
|
23
|
+
Oh, did I mention it also handles Chinese/Japanese/Korean characters
|
24
|
+
in file names without any problems?
|
12
25
|
|
13
26
|
WARNING:
|
14
27
|
it stores your USERNAME and PASSWORD for
|
15
28
|
lixian.vip.xunlei.com as PLAINTEXT at ~/.xunlei/credentials.yml
|
29
|
+
There's not much we can do though.
|
16
30
|
|
17
31
|
Install:
|
18
32
|
-----------
|
19
33
|
|
34
|
+
# you might need to use sudo
|
20
35
|
gem install xunlei
|
21
36
|
|
22
37
|
Usage:
|
23
38
|
-----------
|
24
39
|
|
25
|
-
Dump all tasks from web:
|
40
|
+
Dump all tasks from web and store them at ~/.xunlei/all_tasks.yml:
|
26
41
|
|
27
42
|
xunlei dump_tasks
|
28
43
|
|
29
|
-
Download files
|
44
|
+
Download files as described in ~/.xunlei/all_tasks.yml via wget:
|
30
45
|
|
31
46
|
xunlei download
|
32
47
|
|
data/bin/xunlei
CHANGED
@@ -141,6 +141,7 @@ command :dump_tasks do |c|
|
|
141
141
|
tasks.each do |task|
|
142
142
|
puts task[:name]
|
143
143
|
end
|
144
|
+
puts
|
144
145
|
end
|
145
146
|
end
|
146
147
|
|
@@ -195,5 +196,13 @@ command :show do |c|
|
|
195
196
|
end
|
196
197
|
end
|
197
198
|
|
199
|
+
command :config do |c|
|
200
|
+
c.syntax = "config"
|
201
|
+
c.description = "open #{xunlei_folder_name} folder"
|
202
|
+
c.action do |args, options|
|
203
|
+
system("open #{xunlei_folder_name}")
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
198
207
|
alias_command :down, :download
|
199
208
|
alias_command :dump, :dump_tasks
|
data/lib/xunlei/engine.rb
CHANGED
@@ -85,7 +85,7 @@ module Xunlei
|
|
85
85
|
task_div.click
|
86
86
|
task_div.a(:class => "rwbtn ic_down").wait_until_present
|
87
87
|
|
88
|
-
if task_div.
|
88
|
+
if task_div.div(:class => "w03img").imgs.first.src == "http://cloud.vip.xunlei.com/160/img/icon_type/tpimg_bt.png"
|
89
89
|
task_files += process_bt_task(task_div)
|
90
90
|
else
|
91
91
|
task_files << process_normal_task(task_div)
|
data/lib/xunlei/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xunlei
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-10-
|
12
|
+
date: 2011-10-20 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
16
|
-
requirement: &
|
16
|
+
requirement: &70251257863900 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70251257863900
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: watir-webdriver
|
27
|
-
requirement: &
|
27
|
+
requirement: &70251257862540 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70251257862540
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: commander
|
38
|
-
requirement: &
|
38
|
+
requirement: &70251257859720 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70251257859720
|
47
47
|
description: A browser script to access lixian.vip.xunlei.com tasks automatically
|
48
48
|
email:
|
49
49
|
- afu@forresty.com
|