epub_book 0.1.29 → 0.1.30

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 10adea71e28883b5d5f9b6ca8f552637610583879338cc9258cfcfc087d41c1a
4
- data.tar.gz: f241723275f5d139f4e202f025cd4ed37701c0268cf9a2f030368824472585d7
3
+ metadata.gz: b033ca4e17804742f14f6e1acfe56a76af3bc90525bfc19a521e31c86bbbf3b4
4
+ data.tar.gz: 0ed53b49843e6ac92122f26d9362fe55ca141a39e6b190e378ae14363de7a9b1
5
5
  SHA512:
6
- metadata.gz: 1ed9b98961ce16f0db4f0fc9a54ff389e8a31a578dc2988f48f9b793f4109fb219471c793b6a4ca38256f592ffb72e9428fc023b52308cc39346201e7c51d89e
7
- data.tar.gz: df711aff69ea22f47c25171eeb49e268dde5ac22a380cd92fdcd9fa8deab4e627bee19f86343015bb16d381ad72149067d2506126de8136cf036bee73abb1ffa
6
+ metadata.gz: 76c1d96de6b8df5af9dee5181bd8bd4bcea4ea8a69d96ad0cce16ea3ff525f25ee37b44722c8bbd3dbfd79fb01bce521bbc9ddb2065b0aad5a4a5b1d1f350b8b
7
+ data.tar.gz: 5f0818cd97cfbc3971a46adcc50f871a033a4d008f38a3bbef3ef4f7b5a11c7c5d0098e91c46f7e9b29ff5e81c65309d6040d973c2df246e33126f6b0be62458
data/epub_book.gemspec CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.require_paths = ["lib"]
29
29
 
30
30
  spec.add_dependency 'http','~> 5.0', '>= 5.0.4'
31
- spec.add_runtime_dependency 'nokogiri', '~> 1.11', '>= 1.11.4'
31
+ spec.add_runtime_dependency 'nokogiri', '~> 1.12', '>= 1.12.4'
32
32
  spec.add_dependency 'eeepub', '~> 0.8.1'
33
33
  spec.add_dependency 'zip-zip', '~> 0.3'
34
34
  spec.add_dependency 'mail', '~>2.7.0'
@@ -126,7 +126,8 @@ module EpubBook
126
126
  def fetch_index(url=nil)
127
127
  book[:files] = []
128
128
  url ||= @index_url
129
- doc = Nokogiri::HTML(judge_encoding(HTTP.headers("User-Agent" => @user_agent ,'Referer'=> @referer).get(url).to_s))
129
+ #doc = Nokogiri::HTML(judge_encoding(HTTP.headers("User-Agent" => @user_agent ,'Referer'=> @referer).get(url).to_s))
130
+ doc = Nokogiri::HTML(HTTP.headers("User-Agent" => @user_agent ,'Referer'=> @referer).get(url).to_s)
130
131
  #generate index.yml
131
132
  EpubBook.logger.info "------Fetch index--#{url}---------------"
132
133
 
@@ -134,18 +135,24 @@ module EpubBook
134
135
  doc1 = if @des_url.nil?
135
136
  doc
136
137
  else
137
- Nokogiri::HTML(judge_encoding(HTTP.headers("User-Agent" => @user_agent ,'Referer'=> @referer).get(generate_abs_url(doc.css(@des_url).attr("href").to_s)).to_s))
138
+ #Nokogiri::HTML(judge_encoding(HTTP.headers("User-Agent" => @user_agent ,'Referer'=> @referer).get(generate_abs_url(doc.css(@des_url).attr("href").to_s)).to_s))
139
+ Nokogiri::HTML(HTTP.headers("User-Agent" => @user_agent ,'Referer'=> @referer).get(generate_abs_url(doc.css(@des_url).attr("href").to_s)).to_s)
138
140
  end
139
141
  get_des(doc1)
140
142
  end
141
143
 
142
- #binding.pry
144
+ binding.pry
145
+ EpubBook.logger.info @index_item_css
146
+
143
147
  doc.css(@index_item_css).each do |item|
144
148
  _href = item.attr(@item_attr).to_s
145
149
  next if _href.start_with?('javascript') || _href.start_with?('#')
146
150
 
147
151
  _href = generate_abs_url(_href)
148
152
 
153
+ EpubBook.logger.info item.inspect
154
+ EpubBook.logger.info item.text
155
+
149
156
  book[:files] << {label: item.text, url: _href}
150
157
  end
151
158
 
@@ -186,7 +193,7 @@ module EpubBook
186
193
  next if test(?s,content_path)
187
194
 
188
195
  begin
189
- doc_file = Nokogiri::HTML(judge_encoding(HTTP.headers("User-Agent" => @user_agent,'Referer'=> @referer).get(item[:url]).to_s))
196
+ doc_file = Nokogiri::HTML(HTTP.headers("User-Agent" => @user_agent,'Referer'=> @referer).get(item[:url]).to_s)
190
197
 
191
198
  EpubBook.logger.info item[:label]
192
199
  #binding.pry
@@ -1,3 +1,3 @@
1
1
  module EpubBook
2
- VERSION = "0.1.29"
2
+ VERSION = "0.1.30"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epub_book
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.29
4
+ version: 0.1.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - qmliu
@@ -36,20 +36,20 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '1.11'
39
+ version: '1.12'
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
- version: 1.11.4
42
+ version: 1.12.4
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - "~>"
48
48
  - !ruby/object:Gem::Version
49
- version: '1.11'
49
+ version: '1.12'
50
50
  - - ">="
51
51
  - !ruby/object:Gem::Version
52
- version: 1.11.4
52
+ version: 1.12.4
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: eeepub
55
55
  requirement: !ruby/object:Gem::Requirement