lolink 0.0.6 → 0.0.7
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 +53 -0
- data/bin/lolink +7 -5
- data/lib/lolink.rb +19 -8
- data/lib/lolink/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34f3d389382b5140de4acda39f04323c175353ef
|
4
|
+
data.tar.gz: 27f0248b564ea8c04557f8d3e0361e909dadf7f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c5d9c6bdc112033fb14b8e3476514735dc35cf8cc6f1e89fd5ae859f6b145a2389c687d3f758bdee14fc4ded6a924c31b6004e276a6a3dc735c689d5e339971
|
7
|
+
data.tar.gz: 934f4919480e42864691f336f6d352b532d53bfc8d4343d925a038747caaf252c2b677917422f28527ab7a704ddda75c9849c41a21114c6fea1771bfa31ba991
|
data/README.md
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# lolink - LOL 国服客户端下载地址和升级补丁下载地址
|
2
|
+
|
3
|
+
## 安装
|
4
|
+
`gem install lolink`
|
5
|
+
|
6
|
+
## 说明
|
7
|
+
|
8
|
+
* 完整客户端下载地址
|
9
|
+
```bash
|
10
|
+
$ lolink
|
11
|
+
http://dlied1.qq.com/lol/full/LOL_V3.2.1.3_FULL.exe
|
12
|
+
http://dlied1.qq.com/lol/full/LOL_V3.2.1.3_FULL.7z.001
|
13
|
+
http://dlied1.qq.com/lol/full/LOL_V3.2.1.3_FULL.7z.002
|
14
|
+
http://dlied1.qq.com/lol/full/LOL_V3.2.1.3_FULL.7z.003
|
15
|
+
http://dlied1.qq.com/lol/full/LOL_V3.2.1.3_FULL.7z.004
|
16
|
+
```
|
17
|
+
* 最新升级补丁下载地址
|
18
|
+
```bash
|
19
|
+
$ lolink -p
|
20
|
+
http://down.qq.com/lol/patch/LOL_V3.2.1.2-V3.2.1.3_PATCH.exe
|
21
|
+
http://down.qq.com/lol/patch/LOL_V3.2.1.3_PATCH.7z.001
|
22
|
+
http://down.qq.com/lol/patch/LOL_V3.2.1.3_PATCH.7z.002
|
23
|
+
```
|
24
|
+
* 调用 aria2 直接下载完整客户端
|
25
|
+
```bash
|
26
|
+
$ lolink -d
|
27
|
+
03/03 09:57:44 [NOTICE] Downloading 5 item(s)
|
28
|
+
|
29
|
+
03/03 09:57:44 [NOTICE] Allocating disk space. Use --file-allocation=none to disable it. See --file-allocation option in man page for more details.
|
30
|
+
|
31
|
+
03/03 09:57:44 [NOTICE] Download complete: /Users/kikyous/Workspace/lolink/LOL_V3.2.1.3_FULL.exe
|
32
|
+
[DL:272KiB][#b6c8d0 0B/1.8GiB(0%)][#e51e96 0B/1.8GiB(0%)][#4d078e 0B/1.8GiB(0%)][#f52244 0B/1.4GiB(0%)] [FileAlloc:#b6c8d0 1.2GiB/
|
33
|
+
|
34
|
+
...
|
35
|
+
```
|
36
|
+
|
37
|
+
* 调用 aria2 直接下载最新补丁
|
38
|
+
|
39
|
+
```bash
|
40
|
+
$ lolink -p -d
|
41
|
+
03/03 09:59:31 [NOTICE] Downloading 3 item(s)
|
42
|
+
|
43
|
+
03/03 09:59:31 [NOTICE] Allocating disk space. Use --file-allocation=none to disable it. See --file-allocation option in man page for more details.
|
44
|
+
|
45
|
+
03/03 09:59:32 [NOTICE] Download complete: /Users/kikyous/Workspace/lolink/LOL_V3.2.1.2-V3.2.1.3_PATCH.exe
|
46
|
+
[DL:336KiB][#840971 0B/1.8GiB(0%)][#15ac83 0B/1.4GiB(0%)] [FileAlloc:#840971 0.9GiB/1.8GiB(51%)](+1)
|
47
|
+
|
48
|
+
```
|
49
|
+
|
50
|
+
* 查看 lolink 版本
|
51
|
+
```bash
|
52
|
+
$ lolink -v
|
53
|
+
```
|
data/bin/lolink
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
+
lib = File.expand_path('../../lib', __FILE__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
5
|
require 'lolink'
|
4
6
|
require 'optparse'
|
5
7
|
|
@@ -12,13 +14,13 @@ OptionParser.new do |opts|
|
|
12
14
|
opts.on("-p", "--patch", "Patch links") do |v|
|
13
15
|
options[:patch] = true
|
14
16
|
end
|
15
|
-
opts.on("-v", "--version", "
|
16
|
-
|
17
|
-
|
17
|
+
opts.on("-v VERSION", "--version=VERSION", "Get VERSION update patch, e.g. -v v3.2.2.5-V3.2.2.6") do |v|
|
18
|
+
options[:patch] = true
|
19
|
+
options[:version] = v.upcase
|
18
20
|
end
|
19
21
|
end.parse!
|
20
22
|
|
21
|
-
d = Lolink.new
|
23
|
+
d = Lolink.new(options[:version])
|
22
24
|
if options.include? :patch
|
23
25
|
links=d.patch_links
|
24
26
|
else
|
@@ -27,5 +29,5 @@ end
|
|
27
29
|
if options.include? :download
|
28
30
|
Lolink.aria2(links)
|
29
31
|
else
|
30
|
-
|
32
|
+
puts links
|
31
33
|
end
|
data/lib/lolink.rb
CHANGED
@@ -4,9 +4,18 @@ require 'nokogiri'
|
|
4
4
|
require 'lolink/version'
|
5
5
|
|
6
6
|
class Lolink
|
7
|
-
|
7
|
+
attr_accessor :versions
|
8
|
+
def initialize(v=nil)
|
8
9
|
@base_url = "http://down.qq.com/lol"
|
9
|
-
|
10
|
+
if v
|
11
|
+
self.versions = v
|
12
|
+
else
|
13
|
+
parse_version
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def version
|
18
|
+
@version ||= @versions.split('-').last
|
10
19
|
end
|
11
20
|
|
12
21
|
def parse_version
|
@@ -15,8 +24,6 @@ class Lolink
|
|
15
24
|
link = @doc.search('.downlst.fl a#xzq').first.attr('href')
|
16
25
|
|
17
26
|
@versions = link.match(/(V.+-V.+)_PATCH/)[1]
|
18
|
-
|
19
|
-
@version = @versions.split('-').last
|
20
27
|
end
|
21
28
|
|
22
29
|
def test_link
|
@@ -34,19 +41,23 @@ class Lolink
|
|
34
41
|
links
|
35
42
|
end
|
36
43
|
|
44
|
+
def version_number
|
45
|
+
version.gsub /[^\d]/, ''
|
46
|
+
end
|
47
|
+
|
37
48
|
def full_links
|
38
|
-
files = ["http://dlied1.qq.com/lol/full/LOL_#{
|
49
|
+
files = ["http://dlied1.qq.com/lol/full/#{version_number}/LOL_#{version}_FULL.exe"]
|
39
50
|
|
40
51
|
files += test_link do |i|
|
41
|
-
"http://dlied1.qq.com/lol/full/LOL_#{
|
52
|
+
"http://dlied1.qq.com/lol/full/#{version_number}/LOL_#{version}_FULL.7z.#{i}"
|
42
53
|
end
|
43
54
|
end
|
44
55
|
|
45
56
|
def patch_links
|
46
|
-
files = ["#{@base_url}/patch/LOL_#{
|
57
|
+
files = ["#{@base_url}/patch/#{version_number}/LOL_#{versions}_PATCH.exe"]
|
47
58
|
|
48
59
|
files += test_link do |i|
|
49
|
-
"#{@base_url}/patch/LOL_#{
|
60
|
+
"#{@base_url}/patch/#{version_number}/LOL_#{version}_PATCH.7z.#{i}"
|
50
61
|
end
|
51
62
|
end
|
52
63
|
|
data/lib/lolink/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lolink
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kikyous
|
@@ -57,6 +57,7 @@ executables:
|
|
57
57
|
extensions: []
|
58
58
|
extra_rdoc_files: []
|
59
59
|
files:
|
60
|
+
- README.md
|
60
61
|
- bin/lolink
|
61
62
|
- lib/lolink.rb
|
62
63
|
- lib/lolink/version.rb
|