nhentai-api 0.2.0 → 0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/nhentai-api.rb +83 -469
  3. metadata +8 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8056e30327e8ad7dd214acbd23a73b0898bda87daf17fbcdc0ec1bb3b3fb5084
4
- data.tar.gz: a7d647dadb32275444c83a734113555969e4d55e17269002c1c3874b24c49b60
3
+ metadata.gz: 926018495ec0cfbf18b0cd8925ed8134dbc1535b153894c17b063f52243b699d
4
+ data.tar.gz: 64c9ed0d11c68d6e197228a0e4fc33d9f762c9fbeb4a3d47548a55769e45ebc8
5
5
  SHA512:
6
- metadata.gz: 262a7875d02e1e0ae90042d5e2cc23a01a7c16dba4ed807e43fdab2054f2ef2ac01a8400340f9ada475d0e46a4a5c97e36cfe894d6cf44b3bd81cc32d6aa3d77
7
- data.tar.gz: 995ee6712f274ff77d9ce8baf557d26f0d333afcdb2cc6c2d007fdc13461056a0c22fe131f608ae19ec26c3cfb2c8c8a8e7ec30df40c676abb1181ee5f7b37ea
6
+ metadata.gz: 5d3341acdeb0c156ff91e12d21d1f606c8a1ee2d53c5fea454892977389aba4a8730cfa968fb843856efeab522d7afaf75f1be3ad250cdf347220beb642b5c99
7
+ data.tar.gz: 4462036c84fa2d4096074bb100ec1a4e4a2aaccfdeb5dded595ea1f09cedacbedadc77bb90d10923a88c6821c1f6fb971e862e537930af2341396281b1474765
data/lib/nhentai-api.rb CHANGED
@@ -1,541 +1,155 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'net/http'
4
+ require 'ostruct'
2
5
  require 'time'
3
-
4
- class Info
5
- attr_reader :id, :name, :count, :url
6
-
7
- def initialize(id, name, count, url)
8
- @id = id
9
- @name = name
10
- @count = count
11
- @url = url
12
- end
13
- end
6
+ require 'json'
14
7
 
15
8
  class Doujinshi
16
- attr_reader :id, :client, :media_id, :count_pages
9
+ attr_reader :id, :client, :media_id, :count_pages, :response
17
10
 
18
11
  def initialize(id)
19
12
  @id = id
20
13
  @client = Net::HTTP.get_response(URI("https://nhentai.net/g/#{@id}/"))
21
- if self.exists?
22
- @media_id = @client.body.match(%r{\/([0-9]+)\/cover.jpg})[1]
23
- @count_pages = @client.body.match(/([0-9]+) pages/)[1].to_i
24
- end
14
+ return unless exists?
15
+
16
+ @media_id = client.body.match(%r{\/([0-9]+)\/cover})[1]
17
+ @count_pages = client.body.match(/Pages:\s*.*>([0-9]+)</)[1].to_i
25
18
  end
26
19
 
27
- #
28
- # Check if a doujinshi with the given id exist
29
- #
30
- # @return [Bool] true if the doujinshi exist, otherwise false
31
- # @since 0.1.0
32
- # @example
33
- # doujinshi.exists? #=> true
34
- #
35
20
  def exists?
36
- @client.code == '200'
21
+ client.code == '200'
37
22
  end
38
23
 
39
- #
40
- # Give the title of a doujinshi
41
- #
42
- # @return [String] the title of a given doujinshi
43
- # @since 0.1.0
44
- # @example
45
- # doujinshi.title #=> '[Illumination. (Ogadenmon)] Android no Ecchi na Yatsu | Horny Androids (NieR:Automata) [English] =TLL + mrwayne= [Digital]'
46
- #
47
24
  def title
48
- @client.body.match(%r{<div id="info">\s+<h1>(.+)<\/h1>})[1]
25
+ client.body.match(/"pretty">(.*?)</)[1]
49
26
  end
50
27
 
51
- #
52
- # Give the cover's URL of a doujinshi
53
- #
54
- # @return [String] the cover's URL of a given doujinshi
55
- # @since 0.1.0
56
- # @example
57
- # doujinshi.cover #=> 'https://t.nhentai.net/galleries/1170172/cover.jpg'
58
- #
59
28
  def cover
60
- "https://t.nhentai.net/galleries/#{@media_id}/cover.jpg"
29
+ res = client.body.match(%r{https://t.*.nhentai.net/galleries/#{media_id}/cover\.(.{3})"})
30
+
31
+ "https://t.nhentai.net/galleries/#{media_id}/cover.#{res[1]}"
61
32
  end
62
33
 
63
- #
64
- # Give the URL of a given page of a doujinshi
65
- #
66
- # @param [Integer] page a particular page of a doujinshi
67
- # @return [String] the URL of a given page of a doujinshi
68
- # @since 0.1.0
69
- # @example
70
- # doujinshi.get_page #=> 'https://i.nhentai.net/galleries/1170172/1.jpg'
71
- # doujinshi.get_page(10) #=> 'https://i.nhentai.net/galleries/1170172/10.jpg'
72
- #
73
34
  def page(page = 1)
74
- res = @client.body.match(%r{https://t.nhentai.net/galleries/#{@media_id}/#{page}t\.(.{3})"})
35
+ res = client.body.match(%r{https://t.*.nhentai.net/galleries/#{media_id}/#{page}t\.(.{3})"})
75
36
 
76
- "https://i.nhentai.net/galleries/#{@media_id}/#{page}.#{res[1]}"
37
+ "https://i.nhentai.net/galleries/#{media_id}/#{page}.#{res[1]}"
77
38
  end
78
39
 
79
- #
80
- # Give the URL of a all pages of a doujinshi
81
- #
82
- # @return [Array] array pages' URL
83
- # @since 0.1.0
84
- # @example
85
- # doujinshi.pages #=> ['https://i.nhentai.net/galleries/1170172/1.jpg', ..., 'https://i.nhentai.net/galleries/1170172/31.jpg']
86
- #
87
40
  def pages
88
- (1..@count_pages).map { |page| page(page) }
41
+ (1..count_pages).map { |page| page(page) }
89
42
  end
90
43
 
91
- #
92
- # Give the thumbnail's URL of a given page of a doujinshi
93
- #
94
- # @param [Integer] page a particular page of a doujinshi
95
- # @return [String] the thumbnail's URL of a given page of a doujinshi
96
- # @since 0.1.0
97
- # @example
98
- # doujinshi.get_thumbnail #=> 'https://t.nhentai.net/galleries/1170172/1t.jpg'
99
- # doujinshi.get_thumbnail(10) #=> 'https://t.nhentai.net/galleries/1170172/10t.jpg'
100
- #
101
44
  def thumbnail(page = 1)
102
- res = @client.body.match(%r{https://t.nhentai.net/galleries/#{@media_id}/(#{page}t\..{3})"})
45
+ res = client.body.match(%r{https://t.*.nhentai.net/galleries/#{media_id}/(#{page}t\..{3})"})
103
46
 
104
- "https://t.nhentai.net/galleries/#{@media_id}/#{res[1]}"
47
+ "https://t.nhentai.net/galleries/#{media_id}/#{res[1]}"
105
48
  end
106
49
 
107
- #
108
- # Give the URL of a all thumbnails of a doujinshi
109
- #
110
- # @return [Array] an array thumbnails' URL
111
- # @since 0.1.0
112
- # @example
113
- # doujinshi.thumbnails #=> ['https://t.nhentai.net/galleries/1170172/1t.jpg',..., 'https://t.nhentai.net/galleries/1170172/31t.jpg']
114
- #
115
50
  def thumbnails
116
- (1..@count_pages).map { |page| thumbnail(page) }
51
+ (1..count_pages).map { |page| thumbnail(page) }
117
52
  end
118
53
 
119
- #
120
- # Give the number of favorites on a doujinshi
121
- #
122
- # @return [Integer] a counter of favorites on a given doujinshi
123
- # @since 0.1.0
124
- # @example
125
- # doujinshi.num_favorites #=> 13326
126
- #
127
54
  def count_favorites
128
55
  regex = %r{<span>Favorite <span class="nobold">.(\d+).<\/span><\/span>}
129
56
 
130
- @client.body.match(regex)[1].to_i
57
+ client.body.match(regex)[1].to_i
131
58
  end
132
59
 
133
- #
134
- # Give the upload date of a doujinshi
135
- #
136
- # @return [Integer] the upload date of a given doujinshi
137
- # @since 0.1.0
138
- # @example
139
- # doujinshi.upload_date #=> 2018-01-17 15:56:16 +0000
140
- #
141
60
  def upload_date
142
- Time.iso8601(@client.body.match(/datetime="(.+)"/)[1])
143
- end
144
-
145
- #
146
- # Give all tags of a doujinshi
147
- #
148
- # @return [Array] of Tag class of a given doujinshi
149
- # @since 0.1.0
150
- # @example
151
- # doujinshi.tags
152
- #
153
- def tags
154
- res = @client.body.match(%r{Tags:\s*<span class="tags">(.+)<\/span>})
155
-
156
- parse_tags(res[1])
157
- end
158
-
159
- #
160
- # Give a counter of tags
161
- #
162
- # @return [Integer] of tags
163
- # @since 0.1.0
164
- # @example
165
- # doujinshi.count_tags #=> 9
166
- #
167
- def count_tags
168
- res = @client.body.match(%r{Tags:\s*<span class="tags">(.+)<\/span>})
169
-
170
- res.nil? ? 0 : parse_tags(res[1]).length
171
- end
172
-
173
- #
174
- # Check if a particular doujinshi have some tags
175
- #
176
- # @return [Bool] true if the doujinshi have tags, otherwise false
177
- # @since 0.1.0
178
- # @example
179
- # doujinshi.tags? #=> true
180
- #
181
- def tags?
182
- !@client.body.match(%r{Tags:\s*<span class="tags">(.+)<\/span>}).nil?
183
- end
184
-
185
- #
186
- # Give all parodies of a doujinshi
187
- #
188
- # @since 0.1.0
189
- # @see Doujinshi#tags
190
- #
191
- def parodies
192
- res = @client.body.match(%r{Parodies:\s+<span class="tags">(.+)<\/span>})
193
-
194
- parse_tags(res[1])
195
- end
196
-
197
- #
198
- # Give a counter of parodies
199
- #
200
- # @since 0.1.0
201
- # @see Doujinshi#count_tags
202
- #
203
- def count_parodies
204
- res = @client.body.match(%r{Parodies:\s+<span class="tags">(.+)<\/span>})
205
-
206
- res.nil? ? 0 : parse_tags(res[1]).length
207
- end
208
-
209
- #
210
- # Check if a particular doujinshi have some parodies
211
- #
212
- # @since 0.1.0
213
- # @see Doujinshi#tags?
214
- #
215
- def parodies?
216
- !@client.body.match(%r{Parodies:\s+<span class="tags">(.+)<\/span>}).nil?
217
- end
218
-
219
- #
220
- # Give all characters of a doujinshi
221
- #
222
- # @since 0.1.0
223
- # @see Doujinshi#tags
224
- #
225
- def characters
226
- res = @client.body.match(%r{Characters:\s+<span class="tags">(.+)<\/span>})
227
-
228
- parse_tags(res[1])
229
- end
230
-
231
- #
232
- # Give a counter of characters
233
- #
234
- # @since 0.1.0
235
- # @see Doujinshi#count_tags
236
- #
237
- def count_characters
238
- res = @client.body.match(%r{Characters:\s+<span class="tags">(.+)<\/span>})
239
-
240
- res.nil? ? 0 : parse_tags(res[1]).length
241
- end
242
-
243
- #
244
- # Check if a particular doujinshi have some characters
245
- #
246
- # @since 0.1.0
247
- # @see Doujinshi#tags?
248
- #
249
- def characters?
250
- !@client.body.match(%r{Characters:\s+<span class="tags">(.+)<\/span>}).nil?
251
- end
252
-
253
- #
254
- # Give all artists of a doujinshi
255
- #
256
- # @since 0.1.0
257
- # @see Doujinshi#tags
258
- #
259
- def artists
260
- res = @client.body.match(%r{Artists:\s+<span class="tags">(.+)<\/span>})
261
-
262
- parse_tags(res[1])
263
- end
264
-
265
- #
266
- # Give a counter of artists
267
- #
268
- # @since 0.1.0
269
- # @see Doujinshi#count_tags
270
- #
271
- def count_artists
272
- res = @client.body.match(%r{Artists:\s+<span class="tags">(.+)<\/span>})
273
-
274
- res.nil? ? 0 : parse_tags(res[1]).length
61
+ Time.iso8601(client.body.match(/<time .+ datetime="(.*?)"/)[1])
275
62
  end
276
63
 
277
- #
278
- # Check if a particular doujinshi have some artists
279
- #
280
- # @since 0.1.0
281
- # @see Doujinshi#tags?
282
- #
283
- def artists?
284
- !@client.body.match(%r{Artists:\s+<span class="tags">(.+)<\/span>}).nil?
285
- end
286
-
287
- #
288
- # Give all groups of a doujinshi
289
- #
290
- # @since 0.1.0
291
- # @see Doujinshi#tags
292
- #
293
- def groups
294
- res = @client.body.match(%r{Groups:\s+<span class="tags">(.+)<\/span>})
64
+ %w[tags parodies characters artists groups languages categories].each do |method|
65
+ define_method method do
66
+ return instance_variable_get("@#{method}") if instance_variable_defined?("@#{method}")
295
67
 
296
- parse_tags(res[1])
297
- end
68
+ res = client.body.match(%r{#{method.capitalize}:\s*<span class="tags">(.+)<\/span>})
69
+ return [] if res.nil?
298
70
 
299
- #
300
- # Give a counter of groups
301
- #
302
- # @since 0.1.0
303
- # @see Doujinshi#count_tags
304
- #
305
- def count_groups
306
- res = @client.body.match(%r{Groups:\s+<span class="tags">(.+)<\/span>})
71
+ instance_variable_set("@#{method}", parsing_informations(res[1]))
72
+ end
307
73
 
308
- res.nil? ? 0 : parse_tags(res[1]).length
309
- end
74
+ define_method "count_#{method}" do
75
+ send(method).size
76
+ end
310
77
 
311
- #
312
- # Check if a particular doujinshi have some groups
313
- #
314
- # @since 0.1.0
315
- # @see Doujinshi#tags?
316
- #
317
- def groups?
318
- !@client.body.match(%r{Groups:\s+<span class="tags">(.+)<\/span>}).nil?
78
+ define_method "#{method}?" do
79
+ !send(method).empty?
80
+ end
319
81
  end
320
82
 
321
- #
322
- # Give all languages of a doujinshi
323
- #
324
- # @since 0.1.0
325
- # @see Doujinshi#tags
326
- #
327
- def languages
328
- res = @client.body.match(%r{Languages:\s+<span class="tags">(.+)<\/span>})
329
-
330
- parse_tags(res[1])
331
- end
83
+ private
332
84
 
333
- #
334
- # Give a counter of languages
335
- #
336
- # @since 0.1.0
337
- # @see Doujinshi#count_tags
338
- #
339
- def count_languages
340
- res = @client.body.match(%r{Languages:\s+<span class="tags">(.+)<\/span>})
85
+ def parsing_informations(res)
86
+ res.split(%r{<a(.+?)<\/a>}).reject(&:empty?).map do |line|
87
+ id = parse_id(line)
88
+ name = parse_name(line)
89
+ count = parse_count(line)
90
+ url = parse_url(line)
341
91
 
342
- res.nil? ? 0 : parse_tags(res[1]).length
92
+ OpenStruct.new(id: id, name: name, count: count, url: url)
93
+ end
343
94
  end
344
95
 
345
- #
346
- # Check if a particular doujinshi have some languages
347
- #
348
- # @since 0.1.0
349
- # @see Doujinshi#tags?
350
- #
351
- def languages?
352
- !@client.body.match(%r{Languages:\s+<span class="tags">(.+)<\/span>}).nil?
96
+ def parse_id(line)
97
+ line.match(/tag-(\d+)/)[1]
353
98
  end
354
99
 
355
- #
356
- # Give all categories of a doujinshi
357
- #
358
- # @since 0.1.0
359
- # @see Doujinshi#tags
360
- #
361
- def categories
362
- res = @client.body.match(%r{Categories:\s+<span class="tags">(.+)<\/span>})
363
-
364
- parse_tags(res[1])
100
+ def parse_name(line)
101
+ line.match(/class="name">(.+?)</)[1].strip
365
102
  end
366
103
 
367
- #
368
- # Give a counter of categories
369
- #
370
- # @since 0.1.0
371
- # @see Doujinshi#count_tags
372
- #
373
- def count_categories
374
- res = @client.body.match(%r{Categories:\s+<span class="tags">(.+)<\/span>})
104
+ def parse_count(line)
105
+ count = line.match(/class="count">(\d+.)</)[1]
375
106
 
376
- res.nil? ? 0 : parse_tags(res[1]).length
107
+ count[-1] == 'K' ? count.to_i * 1000 : count.to_i
377
108
  end
378
109
 
379
- #
380
- # Check if a particular doujinshi have some categories
381
- #
382
- # @since 0.1.0
383
- # @see Doujinshi#tags?
384
- #
385
- def categories?
386
- !@client.body.match(%r{Categories:\s+<span class="tags">(.+)<\/span>}).nil?
110
+ def parse_url(line)
111
+ line.match(/href=\"(.+?)\"/)[1]
387
112
  end
113
+ end
388
114
 
389
- #
390
- # @private
391
- #
392
-
393
- private
394
-
395
- def parse_tags(res)
396
- res.split(%r{<a(.+?)<\/a>}).reject(&:empty?).map do |line|
397
- id = line.match(/tag-(\d+)/)[1]
398
- name = line.match(/">(.+?)</)[1].strip
399
- count = line.match(/\((.+?)\)</)[1].tr(',', '').to_i
400
- url = line.match(/href=\"(.+?)\"/)[1]
115
+ %w[tag parody character artist group language category].each do |class_name|
116
+ c = Class.new do
117
+ def self.count(keyword)
118
+ class_name = name.split('::').last.downcase
119
+ keyword = keyword.tr(' ', '-')
120
+ @client = Net::HTTP.get_response(URI("https://nhentai.net/#{class_name}/#{keyword}/"))
121
+ return unless exists?
401
122
 
402
- Info.new(id, name, count, url)
123
+ @client.body.match(%r{<a.*class="count">(.*)<\/span><\/a>})[1].to_i
403
124
  end
404
- end
405
- end
406
125
 
407
- class Tag
408
- #
409
- # List all doujinshi of the page of a given tag
410
- #
411
- # @param [String] keyword of the research
412
- # @param [Integer] sort optional, 1 is sorting by time, 2 is by popularity
413
- # @param [Integer] page each page can return 25 doujinshi
414
- # @return [Array] array of Info
415
- # @since 0.2.0
416
- #
417
- def self.listing(keyword, sort = 1, page = 1)
418
- keyword.tr!(' ', '-')
419
- sort = sort == 1 ? '' : 'popular'
420
- client = Net::HTTP.get_response(URI("https://nhentai.net/tag/#{keyword}/#{sort}?page=#{page}"))
421
- res = client.body.split(%r{<div class="gallery".+?>(.+)</div>}).select { |line| line.include?('<a href="/g/') }
422
-
423
- parse_tags(res)
424
- end
126
+ def self.listing(keyword, sort = 1, page = 1)
127
+ class_name = name.split('::').last.downcase
128
+ keyword = keyword.tr(' ', '-')
129
+ sort = sort == 1 ? '' : 'popular'
130
+ @client = Net::HTTP.get_response(URI("https://nhentai.net/#{class_name}/#{keyword}/#{sort}?page=#{page}"))
131
+ return unless exists?
425
132
 
426
- #
427
- # @private
428
- #
429
- def self.parse_tags(res)
430
- res.map do |line|
431
- id = line.match(%r{/g/(\d+)/})[1]
432
- name = line.match(%r{<div class="caption">(.+)</div>})[1].strip
433
- count = 1
434
- url = "/g/#{id}"
435
-
436
- Info.new(id, name, count, url)
133
+ res = @client.body.split(%r{<div class="gallery".+?>(.*?)<\/div>}).select { |line| line.include?('<a href="/g/') }
134
+ parse_tags(res)
437
135
  end
438
- end
439
- end
440
136
 
441
- class Parody < Tag
442
- #
443
- # List all doujinshi of the page of a given parody
444
- #
445
- # @since 0.2.0
446
- # @see Tag#listing
447
- #
448
- def self.listing(keyword, sort = 1, page = 1)
449
- keyword.tr!(' ', '-')
450
- sort = sort == 1 ? '' : 'popular'
451
- client = Net::HTTP.get_response(URI("https://nhentai.net/parody/#{keyword}/#{sort}?page=#{page}"))
452
- res = client.body.split(%r{<div class="gallery".+?>(.+)</div>}).select { |line| line.include?('<a href="/g/') }
453
-
454
- parse_tags(res)
455
- end
456
- end
457
-
458
- class Character < Tag
459
- #
460
- # List all doujinshi of the page of a given character
461
- #
462
- # @since 0.2.0
463
- # @see Tag#listing
464
- #
465
- def self.listing(keyword, sort = 1, page = 1)
466
- keyword.tr!(' ', '-')
467
- sort = sort == 1 ? '' : 'popular'
468
- client = Net::HTTP.get_response(URI("https://nhentai.net/character/#{keyword}/#{sort}?page=#{page}"))
469
- res = client.body.split(%r{<div class="gallery".+?>(.+)</div>}).select { |line| line.include?('<a href="/g/') }
470
-
471
- parse_tags(res)
472
- end
473
- end
137
+ private
474
138
 
475
- class Artist < Tag
476
- #
477
- # List all doujinshi of the page of a given artists
478
- #
479
- # @since 0.2.0
480
- # @see Tag#listing
481
- #
482
- def self.listing(keyword, sort = 1, page = 1)
483
- keyword.tr!(' ', '-')
484
- sort = sort == 1 ? '' : 'popular'
485
- client = Net::HTTP.get_response(URI("https://nhentai.net/artist/#{keyword}/#{sort}?page=#{page}"))
486
- res = client.body.split(%r{<div class="gallery".+?>(.+)</div>}).select { |line| line.include?('<a href="/g/') }
487
-
488
- parse_tags(res)
489
- end
490
- end
139
+ def self.exists?
140
+ @client.code == '200'
141
+ end
491
142
 
492
- class Group < Tag
493
- #
494
- # List all doujinshi of the page of a given group
495
- #
496
- # @since 0.2.0
497
- # @see Tag#listing
498
- #
499
- def self.listing(keyword, sort = 1, page = 1)
500
- keyword.tr!(' ', '-')
501
- sort = sort == 1 ? '' : 'popular'
502
- client = Net::HTTP.get_response(URI("https://nhentai.net/group/#{keyword}/#{sort}?page=#{page}"))
503
- res = client.body.split(%r{<div class="gallery".+?>(.+)</div>}).select { |line| line.include?('<a href="/g/') }
504
-
505
- parse_tags(res)
506
- end
507
- end
143
+ def self.parse_tags(res)
144
+ res.map do |line|
145
+ id = line.match(%r{/g/(\d+)/})[1]
146
+ name = line.match(/<div class="caption">(.+)/)[1].strip
147
+ url = "/g/#{id}"
508
148
 
509
- class Language < Tag
510
- #
511
- # List all doujinshi of the page of a given language
512
- #
513
- # @since 0.2.0
514
- # @see Tag#listing
515
- #
516
- def self.listing(keyword, sort = 1, page = 1)
517
- keyword.tr!(' ', '-')
518
- sort = sort == 1 ? '' : 'popular'
519
- client = Net::HTTP.get_response(URI("https://nhentai.net/language/#{keyword}/#{sort}?page=#{page}"))
520
- res = client.body.split(%r{<div class="gallery".+?>(.+)</div>}).select { |line| line.include?('<a href="/g/') }
521
-
522
- parse_tags(res)
149
+ OpenStruct.new(id: id, name: name, url: url)
150
+ end
151
+ end
523
152
  end
524
- end
525
153
 
526
- class Category < Tag
527
- #
528
- # List all doujinshi of the page of a given category
529
- #
530
- # @since 0.2.0
531
- # @see Tag#listing
532
- #
533
- def self.listing(keyword, sort = 1, page = 1)
534
- keyword.tr!(' ', '-')
535
- sort = sort == 1 ? '' : 'popular'
536
- client = Net::HTTP.get_response(URI("https://nhentai.net/category/#{keyword}/#{sort}?page=#{page}"))
537
- res = client.body.split(%r{<div class="gallery".+?>(.+)</div>}).select { |line| line.include?('<a href="/g/') }
538
-
539
- parse_tags(res)
540
- end
154
+ Kernel.const_set(class_name.capitalize, c)
541
155
  end
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nhentai-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: '0.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gael Roussel
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-06 00:00:00.000000000 Z
11
+ date: 2022-05-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: nhentai-api is a basic and easy to use API for nhentai.net
14
- email: groussel42@gmail.com
14
+ email: gaelroussel@protonmail.com
15
15
  executables: []
16
16
  extensions: []
17
17
  extra_rdoc_files: []
@@ -21,9 +21,8 @@ homepage: https://rubygems.org/gems/nhentai-api
21
21
  licenses:
22
22
  - MIT
23
23
  metadata:
24
- documentation_uri: https://www.rubydoc.info/github/groussel42/nhentai-api
25
- source_code_uri: https://github.com/groussel42/nhentai-api
26
- post_install_message:
24
+ source_code_uri: https://github.com/Mraiih/nhentai-api
25
+ post_install_message:
27
26
  rdoc_options: []
28
27
  require_paths:
29
28
  - lib
@@ -38,8 +37,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
38
37
  - !ruby/object:Gem::Version
39
38
  version: '0'
40
39
  requirements: []
41
- rubygems_version: 3.0.3
42
- signing_key:
40
+ rubygems_version: 3.3.3
41
+ signing_key:
43
42
  specification_version: 4
44
43
  summary: nhentai-api is a basic and easy to use API for nhentai.net
45
44
  test_files: []