pulse-downloader 0.1.27 → 0.1.28

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: ed736b97e09aaec1104ac4e817b981c2ebb88fbac583abe0ebf44e721143b087
4
- data.tar.gz: a81646945f24e428738e8a514e671f2f14682f5824faee1e63e07bd498fe519c
3
+ metadata.gz: 2a9e6c9185000eb45fe03fcf5ec6739aa0b4df48cd9733654cc2f312ca156b54
4
+ data.tar.gz: f03dfbbbecbd75ffe795b194c0ac19689021e1a74a4668ffb6573b6193eb0627
5
5
  SHA512:
6
- metadata.gz: b684940cab23055ec977672dd8472fcb38ebf8e70e59d18f2a76270a3234f5873c7a6bee47877760c54733af2c073bbaa7a05eec33266a33df316482baa6d836
7
- data.tar.gz: 9b1737bc6607585c6fb6081d9c1b3031bd53ffccc5cce72a0650b163792742dde2b7dffa6ed663775a7cd1cad50f1fb964c07bc555ceee7a2ca66637af25b41a
6
+ metadata.gz: 706da41a31ad0fda7b4a17b748f8271f758973510039d2e3eac79115761ef71e970eee042d3ef30ed2a080ae7e64f49584d8110c249022a4bca3029c48cc1024
7
+ data.tar.gz: 97c3c92845700c69343eba19fb93a9b9de71fe44ceca0ff986e25df8cc69ffb71a48c778eaa145df4ae802295b148feaee768814c52124e4ca74079e8ca9e807
@@ -10,8 +10,7 @@ module Pulse
10
10
 
11
11
  file_data = HTTParty.get(
12
12
  escape(compute_file_link(file_path)),
13
- verify: verify_ssl,
14
- headers: headers
13
+ verify: verify_ssl
15
14
  )
16
15
 
17
16
  @end_time = get_micro_second_time
@@ -1,5 +1,5 @@
1
1
  module Pulse
2
2
  module Downloader
3
- VERSION = "0.1.27"
3
+ VERSION = "0.1.28"
4
4
  end
5
5
  end
@@ -4,7 +4,7 @@ module Pulse
4
4
  def fetch_file_paths(custom_path_root=nil)
5
5
  @start_time = get_micro_second_time
6
6
 
7
- response = HTTParty.get(url, verify: verify_ssl)
7
+ response = HTTParty.get(url, verify: verify_ssl, headers: headers)
8
8
 
9
9
  @end_time = get_micro_second_time
10
10
 
@@ -25,10 +25,11 @@ module Pulse
25
25
 
26
26
  def extract_file_urls(response, custom_path_root, type)
27
27
  return [] if response.body.nil? || response.body.empty?
28
+
28
29
  remove_base64(
29
30
  extract_all_urls(response, custom_path_root, type) +
30
- extract_download_links(response, custom_path_root, type) +
31
- extract_embedded_images(response, custom_path_root, type)
31
+ extract_download_links(response, type) +
32
+ extract_embedded_images(response, type)
32
33
  ).uniq
33
34
  end
34
35
 
@@ -42,17 +43,17 @@ module Pulse
42
43
  .map { |link| add_base_url(link) }
43
44
  end
44
45
 
45
- def extract_download_links(response, custom_path_root, type)
46
+ def extract_download_links(response, type)
46
47
  parse_html(response.body)
47
48
  .css('a')
48
49
  .to_a
49
50
  .map { |link| link['href'] }
50
51
  .compact
51
- .select { |link| (link.include? type || link.include?(custom_path_root)) }
52
+ .select { |link| (link.include? type) }
52
53
  .map { |link| add_base_url(link) }
53
54
  end
54
55
 
55
- def extract_embedded_images(response, custom_path_root, type)
56
+ def extract_embedded_images(response, type)
56
57
  return [] unless scrape_images
57
58
 
58
59
  parse_html(response.body)
@@ -60,7 +61,7 @@ module Pulse
60
61
  .to_a
61
62
  .map { |e| e["src"] }
62
63
  .compact
63
- .select { |link| (link.include? type || link.include?(custom_path_root)) }
64
+ .select { |link| (link.include? type) }
64
65
  .map { |link| add_base_url(link) }
65
66
  end
66
67
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pulse-downloader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.27
4
+ version: 0.1.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - trex22