javlibrary 0.2.4 → 0.2.5
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/lib/javlibrary.rb +7 -7
- data/lib/javlibrary/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b6b0d7a17a538195d57a811e3885e93cf313f245
|
|
4
|
+
data.tar.gz: 87a8dfd5ecadc55dadbbf1a672eb3a3649a387ec
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fd942a1110d658621e77bfea1948a6935808735217a4d1fe28f0faba0c0c689a044e906304665c7e79fe84a4994895c2ea87d77ffbaa485cd85024d381a69da9
|
|
7
|
+
data.tar.gz: 10c09754ae04e751baf1d800fcee7b0b5e1123c4e852d984708a83e4cf3ab62f32bd3423b2fc1cfbf57525a79fc84cbbdcc28d57acd448431194a1d1e12f8f3d
|
data/lib/javlibrary.rb
CHANGED
|
@@ -20,7 +20,7 @@ class JavlibrarySpider
|
|
|
20
20
|
@url = JAVLIBRARY_URL[0]
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
def client
|
|
23
|
+
def client()
|
|
24
24
|
client = Mysql2::Client.new(:host => "127.0.0.1",
|
|
25
25
|
:username => @user,
|
|
26
26
|
:password => @password,
|
|
@@ -91,7 +91,7 @@ class JavlibrarySpider
|
|
|
91
91
|
end
|
|
92
92
|
|
|
93
93
|
def download_all_videos
|
|
94
|
-
client = client
|
|
94
|
+
client = client()
|
|
95
95
|
result = client.query("SELECT video_num, video_label FROM label WHERE video_download=0")
|
|
96
96
|
client.close
|
|
97
97
|
|
|
@@ -127,7 +127,7 @@ class JavlibrarySpider
|
|
|
127
127
|
end
|
|
128
128
|
|
|
129
129
|
def actor_hash
|
|
130
|
-
client = client
|
|
130
|
+
client = client()
|
|
131
131
|
actor_hash = Hash.new
|
|
132
132
|
client.query("SELECT * FROM actor").each do |item|
|
|
133
133
|
actor_hash["#{item['actor_name']}"] = item['actor_id']
|
|
@@ -163,7 +163,7 @@ class JavlibrarySpider
|
|
|
163
163
|
end
|
|
164
164
|
|
|
165
165
|
def genres_insert
|
|
166
|
-
client = client
|
|
166
|
+
client = client()
|
|
167
167
|
genres = genres()
|
|
168
168
|
genres.each do |e|
|
|
169
169
|
begin
|
|
@@ -189,7 +189,7 @@ class JavlibrarySpider
|
|
|
189
189
|
def get_all_actor
|
|
190
190
|
firsturl = "http://www.#{@url}/cn/star_list.php?prefix="
|
|
191
191
|
|
|
192
|
-
client = client
|
|
192
|
+
client = client()
|
|
193
193
|
'A'.upto('Z') do |alphabet|
|
|
194
194
|
tempurl = firsturl + alphabet
|
|
195
195
|
begin
|
|
@@ -263,7 +263,7 @@ class JavlibrarySpider
|
|
|
263
263
|
end
|
|
264
264
|
end
|
|
265
265
|
|
|
266
|
-
client = client
|
|
266
|
+
client = client()
|
|
267
267
|
result.each do |e|
|
|
268
268
|
begin
|
|
269
269
|
client.query("INSERT INTO label (video_label, video_download) VALUES ('#{e}', '0')")
|
|
@@ -275,7 +275,7 @@ class JavlibrarySpider
|
|
|
275
275
|
end
|
|
276
276
|
|
|
277
277
|
def select_actor(type)
|
|
278
|
-
client = client
|
|
278
|
+
client = client()
|
|
279
279
|
result = client.query("SELECT actor_label FROM actor WHERE type='#{type}'")
|
|
280
280
|
client.close
|
|
281
281
|
|
data/lib/javlibrary/version.rb
CHANGED