pulse-downloader 0.1.28 → 0.1.29

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: 2a9e6c9185000eb45fe03fcf5ec6739aa0b4df48cd9733654cc2f312ca156b54
4
- data.tar.gz: f03dfbbbecbd75ffe795b194c0ac19689021e1a74a4668ffb6573b6193eb0627
3
+ metadata.gz: ccce085a74c0c4f7710a6e3c7431b191e77bf313a4219ec08e8cd34e78e3340b
4
+ data.tar.gz: ad2307a1ed1d368fd53a9fa965d7e864a90a263dac689656c49e8a5f62484d9f
5
5
  SHA512:
6
- metadata.gz: 706da41a31ad0fda7b4a17b748f8271f758973510039d2e3eac79115761ef71e970eee042d3ef30ed2a080ae7e64f49584d8110c249022a4bca3029c48cc1024
7
- data.tar.gz: 97c3c92845700c69343eba19fb93a9b9de71fe44ceca0ff986e25df8cc69ffb71a48c778eaa145df4ae802295b148feaee768814c52124e4ca74079e8ca9e807
6
+ metadata.gz: 654608db5cd95af6aafde8741864bda84dda783348d0d85baf675418b51c65def47c2ce671910f4313a91c0899784ae92e0d4c6da8e43926fafeaf2053ee2c02
7
+ data.tar.gz: 520111b61ec241a70321f40707659c09317df3d2b950702be65758bb0a29e6c3bf7880fd7c61e57dafb4450ea2c05b51f834dcb3a2c9ad98ca06f3d61d5c327d
@@ -1,5 +1,5 @@
1
1
  module Pulse
2
2
  module Downloader
3
- VERSION = "0.1.28"
3
+ VERSION = "0.1.29"
4
4
  end
5
5
  end
@@ -40,7 +40,7 @@ module Pulse
40
40
  .find_all { |u| u =~ /^https?:/ }
41
41
  .compact
42
42
  .select { |link| (link.include? type || link.include?(custom_path_root)) }
43
- .map { |link| add_base_url(link) }
43
+ .map { |link| add_base_url(link, custom_path_root) }
44
44
  end
45
45
 
46
46
  def extract_download_links(response, type)
@@ -65,6 +65,17 @@ module Pulse
65
65
  .map { |link| add_base_url(link) }
66
66
  end
67
67
 
68
+ def remove_artefacts(urls)
69
+ urls = remove_extra_escape_characters(urls)
70
+ remove_base64(urls)
71
+ end
72
+
73
+ def remove_extra_escape_characters(urls)
74
+ urls.map do |url|
75
+ url.gsub("\">", '')
76
+ end
77
+ end
78
+
68
79
  def remove_base64(urls)
69
80
  urls.reject do |url|
70
81
  url.include?(':image/') || url.include?('base64')
@@ -75,7 +86,9 @@ module Pulse
75
86
  Nokogiri::HTML(raw_html)
76
87
  end
77
88
 
78
- def add_base_url(str)
89
+ def add_base_url(str, custom_path_root=nil)
90
+ return str if custom_path_root
91
+
79
92
  if !str.include?('https://') && !str.include?(base_url)
80
93
  "https://#{base_url}#{str}"
81
94
  else
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.28
4
+ version: 0.1.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - trex22