dmanga 1.1.2 → 1.2.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.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/dmanga/site_parser_base.rb +16 -11
- data/lib/dmanga/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f296292e51e0ff033bbbbf7a10a49c9c33310c1ad6b408b2467a1bd12003ca60
|
|
4
|
+
data.tar.gz: 4548e21b2201b1f8aa13d8cca3a1ce689e6dbc4445e2d3fbd19c24f9b6cc5eb5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b235d5a3b8ad496f0abcf874c343423394f02c9c0b41919f6b5c4bae18ae0d4bb7f46d8ca8f82d2f91ba8e190f9ce193dfd14c2ce9667d6144324527cb958512
|
|
7
|
+
data.tar.gz: bdfd6b75df9343495bd4e987ac6637143d481753dcf0771a92a457ab8ab2f8dc4c6732d0e107acbe611314804a4a46b7b2179a7026b160ef1fbefd8b0e9bb1ac
|
data/README.md
CHANGED
|
@@ -9,7 +9,7 @@ e pronto o script fará os downloads do capítulos selecionados.
|
|
|
9
9
|
|
|
10
10
|
#### Atualização
|
|
11
11
|
|
|
12
|
-
> - (
|
|
12
|
+
> - (2023) agora é possível selecionar o manga pelo número igual a seleção de capítulos, graças ao Gustavo
|
|
13
13
|
<!-- > **Se acontecer qualquer erro atualize o script/programa (esse erro provalvemente já foi corrigido)**. -->
|
|
14
14
|
|
|
15
15
|
> Para atualizar:
|
|
@@ -4,6 +4,8 @@ require 'ruby-progressbar'
|
|
|
4
4
|
require 'open-uri'
|
|
5
5
|
require 'addressable/uri'
|
|
6
6
|
|
|
7
|
+
# todo: if downloading returns an error, skip to next chapter
|
|
8
|
+
|
|
7
9
|
module DManga
|
|
8
10
|
class SiteParserBase
|
|
9
11
|
USER_AGENT = "Mozilla/5.0 (X11; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
|
|
@@ -52,18 +54,21 @@ module DManga
|
|
|
52
54
|
def select_manga(mangas)
|
|
53
55
|
puts # just a new line for better output
|
|
54
56
|
unless mangas.empty?
|
|
55
|
-
mangas.
|
|
56
|
-
DManga::
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
57
|
+
mangas.each_with_index do |manga, index|
|
|
58
|
+
DManga::display_feedback "(#{index + 1}) #{manga[1]}"
|
|
59
|
+
end
|
|
60
|
+
DManga::display_prompt "Selecionar manga: "
|
|
61
|
+
res = $stdin.gets.chomp
|
|
62
|
+
if res =~ /^\d+$/
|
|
63
|
+
res = res.to_i
|
|
64
|
+
if res > 0 && res <= mangas.length
|
|
65
|
+
@manga_name = mangas[res - 1][1]
|
|
66
|
+
@manga_url = mangas[res - 1][0]
|
|
67
|
+
else
|
|
68
|
+
DManga::display_warn("ERRO: Opção inválida")
|
|
66
69
|
end
|
|
70
|
+
else
|
|
71
|
+
DManga::display_warn("ERRO: Opção inválida")
|
|
67
72
|
end
|
|
68
73
|
else
|
|
69
74
|
raise MangaNotFoundError, "manga não encontrado"
|
data/lib/dmanga/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dmanga
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Endrew
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2023-04-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: ruby-progressbar
|