proxy_fetcher 0.15.1 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +8 -0
- data/.github/workflows/ci.yml +58 -0
- data/CHANGELOG.md +9 -0
- data/Gemfile +1 -1
- data/gemfiles/nokogiri.gemfile +1 -1
- data/gemfiles/oga.gemfile +1 -1
- data/lib/proxy_fetcher/providers/free_proxy_list.rb +1 -1
- data/lib/proxy_fetcher/providers/free_proxy_list_socks.rb +1 -1
- data/lib/proxy_fetcher/providers/free_proxy_list_ssl.rb +1 -1
- data/lib/proxy_fetcher/providers/free_proxy_list_us.rb +1 -1
- data/lib/proxy_fetcher/version.rb +2 -2
- data/lib/proxy_fetcher.rb +0 -3
- data/proxy_fetcher.gemspec +1 -1
- data/spec/proxy_fetcher/providers/proxy_classes_spec.rb +0 -3
- metadata +5 -12
- data/lib/proxy_fetcher/providers/proxyscrape_http.rb +0 -65
- data/lib/proxy_fetcher/providers/proxyscrape_socks4.rb +0 -65
- data/lib/proxy_fetcher/providers/proxyscrape_socks5.rb +0 -65
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a35a9ffcd025603a3fe87c281a3d9d19fc68a7c88ae75adb6f9ef63b8b55c121
|
4
|
+
data.tar.gz: 2a9657da7a409c3ae13e5425da5623e351a04a75495546613473698004efe2a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b74bd11f91f0ef06bd754d048fd28705859f6c30b1f4a126a0dfbaa4b697d099efd4c26d4f6a98cbc3c47367baef3a3b5a0a80e099bc3fa5f1bfc3108b51def
|
7
|
+
data.tar.gz: 7b37eddbe892c7ce0f7343d231a18166213a4c9dd2bdd3dbe3720fe1f1c799474a7c2a312adc56134e587d58aebe34bb2b0dad2da51a21a355e846759c1e084b
|
@@ -0,0 +1,58 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
name: >-
|
8
|
+
Ruby ${{ matrix.ruby }} (${{ matrix.gemfile }})
|
9
|
+
env:
|
10
|
+
CI: true
|
11
|
+
runs-on: ${{ matrix.os }}
|
12
|
+
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' || matrix.experimental }}
|
13
|
+
if: |
|
14
|
+
!( contains(github.event.pull_request.title, '[ci skip]')
|
15
|
+
|| contains(github.event.pull_request.title, '[skip ci]'))
|
16
|
+
strategy:
|
17
|
+
fail-fast: true
|
18
|
+
matrix:
|
19
|
+
experimental: [false]
|
20
|
+
os: [ ubuntu-latest ]
|
21
|
+
ruby:
|
22
|
+
- 2.6
|
23
|
+
- 2.7
|
24
|
+
- '3.0'
|
25
|
+
- '3.1'
|
26
|
+
gemfile:
|
27
|
+
- gemfiles/oga.gemfile
|
28
|
+
- gemfiles/nokogiri.gemfile
|
29
|
+
include:
|
30
|
+
- ruby: head
|
31
|
+
os: ubuntu-latest
|
32
|
+
gemfile: gemfiles/nokogiri.gemfile
|
33
|
+
experimental: true
|
34
|
+
- ruby: head
|
35
|
+
os: ubuntu-latest
|
36
|
+
gemfile: gemfiles/oga.gemfile
|
37
|
+
experimental: true
|
38
|
+
- ruby: jruby
|
39
|
+
os: ubuntu-latest
|
40
|
+
gemfile: gemfiles/nokogiri.gemfile
|
41
|
+
experimental: true
|
42
|
+
- ruby: truffleruby
|
43
|
+
os: ubuntu-latest
|
44
|
+
gemfile: gemfiles/nokogiri.gemfile
|
45
|
+
experimental: true
|
46
|
+
steps:
|
47
|
+
- name: Repo checkout
|
48
|
+
uses: actions/checkout@v2
|
49
|
+
|
50
|
+
- name: Setup Ruby
|
51
|
+
uses: ruby/setup-ruby@v1
|
52
|
+
with:
|
53
|
+
ruby-version: ${{ matrix.ruby }}
|
54
|
+
bundler-cache: true
|
55
|
+
|
56
|
+
- name: Run tests
|
57
|
+
timeout-minutes: 10
|
58
|
+
run: bundle exec rake spec
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/gemfiles/nokogiri.gemfile
CHANGED
data/gemfiles/oga.gemfile
CHANGED
@@ -11,7 +11,7 @@ module ProxyFetcher
|
|
11
11
|
|
12
12
|
# [NOTE] Doesn't support filtering
|
13
13
|
def xpath
|
14
|
-
|
14
|
+
"//table[./thead/tr/th[contains(text(), 'IP')]]/tbody/tr"
|
15
15
|
end
|
16
16
|
|
17
17
|
# Converts HTML node (entry of N tags) to <code>ProxyFetcher::Proxy</code>
|
@@ -11,7 +11,7 @@ module ProxyFetcher
|
|
11
11
|
|
12
12
|
# [NOTE] Doesn't support filtering
|
13
13
|
def xpath
|
14
|
-
|
14
|
+
"//table[./thead/tr/th[contains(text(), 'IP')]]/tbody/tr"
|
15
15
|
end
|
16
16
|
|
17
17
|
# Converts HTML node (entry of N tags) to <code>ProxyFetcher::Proxy</code>
|
@@ -11,7 +11,7 @@ module ProxyFetcher
|
|
11
11
|
|
12
12
|
# [NOTE] Doesn't support filtering
|
13
13
|
def xpath
|
14
|
-
|
14
|
+
"//table[./thead/tr/th[contains(text(), 'IP')]]/tbody/tr"
|
15
15
|
end
|
16
16
|
|
17
17
|
# Converts HTML node (entry of N tags) to <code>ProxyFetcher::Proxy</code>
|
@@ -11,7 +11,7 @@ module ProxyFetcher
|
|
11
11
|
|
12
12
|
# [NOTE] Doesn't support filtering
|
13
13
|
def xpath
|
14
|
-
|
14
|
+
"//table[./thead/tr/th[contains(text(), 'IP')]]/tbody/tr"
|
15
15
|
end
|
16
16
|
|
17
17
|
# Converts HTML node (entry of N tags) to <code>ProxyFetcher::Proxy</code>
|
data/lib/proxy_fetcher.rb
CHANGED
@@ -41,9 +41,6 @@ module ProxyFetcher
|
|
41
41
|
require "#{File.dirname(__FILE__)}/proxy_fetcher/providers/mtpro"
|
42
42
|
require "#{File.dirname(__FILE__)}/proxy_fetcher/providers/proxy_list"
|
43
43
|
require "#{File.dirname(__FILE__)}/proxy_fetcher/providers/proxypedia"
|
44
|
-
require "#{File.dirname(__FILE__)}/proxy_fetcher/providers/proxyscrape_http"
|
45
|
-
require "#{File.dirname(__FILE__)}/proxy_fetcher/providers/proxyscrape_socks4"
|
46
|
-
require "#{File.dirname(__FILE__)}/proxy_fetcher/providers/proxyscrape_socks5"
|
47
44
|
require "#{File.dirname(__FILE__)}/proxy_fetcher/providers/xroxy"
|
48
45
|
end
|
49
46
|
|
data/proxy_fetcher.gemspec
CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |gem|
|
|
23
23
|
gem.license = "MIT"
|
24
24
|
gem.required_ruby_version = ">= 2.3.0"
|
25
25
|
|
26
|
-
gem.add_runtime_dependency "http", ">= 3"
|
26
|
+
gem.add_runtime_dependency "http", ">= 3"
|
27
27
|
|
28
28
|
gem.add_development_dependency "rake", ">= 12.0"
|
29
29
|
gem.add_development_dependency "rspec", "~> 3.9"
|
@@ -12,9 +12,6 @@ describe "Proxy classes" do
|
|
12
12
|
[:mtpro, "MTPro"],
|
13
13
|
[:proxy_list, "ProxyList"],
|
14
14
|
[:proxypedia, "Proxypedia"],
|
15
|
-
[:proxyscrape_http, "ProxyscrapeHTTP"],
|
16
|
-
[:proxyscrape_socks4, "ProxyscrapeSOCKS4"],
|
17
|
-
[:proxyscrape_socks5, "ProxyscrapeSOCKS5"],
|
18
15
|
[:xroxy, "XRoxy"]
|
19
16
|
].each do |(provider_name, provider_klass)|
|
20
17
|
describe Object.const_get("ProxyFetcher::Providers::#{provider_klass}") do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: proxy_fetcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nikita Bulai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|
@@ -17,9 +17,6 @@ dependencies:
|
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '3'
|
20
|
-
- - "<"
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: '5'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -27,9 +24,6 @@ dependencies:
|
|
27
24
|
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '3'
|
30
|
-
- - "<"
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '5'
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
28
|
name: rake
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,6 +61,8 @@ executables:
|
|
67
61
|
extensions: []
|
68
62
|
extra_rdoc_files: []
|
69
63
|
files:
|
64
|
+
- ".github/dependabot.yml"
|
65
|
+
- ".github/workflows/ci.yml"
|
70
66
|
- ".gitignore"
|
71
67
|
- CHANGELOG.md
|
72
68
|
- CODE_OF_CONDUCT.md
|
@@ -101,9 +97,6 @@ files:
|
|
101
97
|
- lib/proxy_fetcher/providers/mtpro.rb
|
102
98
|
- lib/proxy_fetcher/providers/proxy_list.rb
|
103
99
|
- lib/proxy_fetcher/providers/proxypedia.rb
|
104
|
-
- lib/proxy_fetcher/providers/proxyscrape_http.rb
|
105
|
-
- lib/proxy_fetcher/providers/proxyscrape_socks4.rb
|
106
|
-
- lib/proxy_fetcher/providers/proxyscrape_socks5.rb
|
107
100
|
- lib/proxy_fetcher/providers/xroxy.rb
|
108
101
|
- lib/proxy_fetcher/proxy.rb
|
109
102
|
- lib/proxy_fetcher/utils/http_client.rb
|
@@ -143,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
136
|
- !ruby/object:Gem::Version
|
144
137
|
version: '0'
|
145
138
|
requirements: []
|
146
|
-
rubygems_version: 3.1.
|
139
|
+
rubygems_version: 3.1.6
|
147
140
|
signing_key:
|
148
141
|
specification_version: 4
|
149
142
|
summary: Ruby gem for dealing with proxy lists from different providers
|
@@ -1,65 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "csv"
|
4
|
-
|
5
|
-
module ProxyFetcher
|
6
|
-
module Providers
|
7
|
-
# FreeProxyList provider class.
|
8
|
-
class ProxyscrapeHTTP < Base
|
9
|
-
# Provider URL to fetch proxy list
|
10
|
-
def provider_url
|
11
|
-
"https://api.proxyscrape.com/v2/?request=getproxies&protocol=http"
|
12
|
-
end
|
13
|
-
|
14
|
-
# Loads provider HTML and parses it with internal document object.
|
15
|
-
#
|
16
|
-
# @param url [String]
|
17
|
-
# URL to fetch
|
18
|
-
#
|
19
|
-
# @param filters [Hash]
|
20
|
-
# filters for proxy provider
|
21
|
-
#
|
22
|
-
# @return [Array]
|
23
|
-
# Collection of extracted proxies with ports
|
24
|
-
#
|
25
|
-
def load_document(url, filters = {})
|
26
|
-
html = load_html(url, filters)
|
27
|
-
|
28
|
-
CSV.parse(html, col_sep: "\t").map(&:first)
|
29
|
-
end
|
30
|
-
|
31
|
-
# Fetches HTML content by sending HTTP request to the provider URL and
|
32
|
-
# parses the txt document to return all the proxy entries (ip addresses
|
33
|
-
# and ports).
|
34
|
-
#
|
35
|
-
# @return [Array]
|
36
|
-
# Collection of extracted proxies with ports
|
37
|
-
#
|
38
|
-
def load_proxy_list(filters = {})
|
39
|
-
load_document(provider_url, filters)
|
40
|
-
end
|
41
|
-
|
42
|
-
# Converts String to <code>ProxyFetcher::Proxy</code> object.
|
43
|
-
#
|
44
|
-
# @param node [String]
|
45
|
-
# String
|
46
|
-
#
|
47
|
-
# @return [ProxyFetcher::Proxy]
|
48
|
-
# Proxy object
|
49
|
-
#
|
50
|
-
def to_proxy(node)
|
51
|
-
addr, port = node.split(":")
|
52
|
-
|
53
|
-
ProxyFetcher::Proxy.new.tap do |proxy|
|
54
|
-
proxy.addr = addr
|
55
|
-
proxy.port = Integer(port)
|
56
|
-
proxy.country = "Unknown"
|
57
|
-
proxy.anonymity = "Unknown"
|
58
|
-
proxy.type = ProxyFetcher::Proxy::HTTP
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
ProxyFetcher::Configuration.register_provider(:proxyscrape_http, ProxyscrapeHTTP)
|
64
|
-
end
|
65
|
-
end
|
@@ -1,65 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "csv"
|
4
|
-
|
5
|
-
module ProxyFetcher
|
6
|
-
module Providers
|
7
|
-
# FreeProxyList provider class.
|
8
|
-
class ProxyscrapeSOCKS4 < Base
|
9
|
-
# Provider URL to fetch proxy list
|
10
|
-
def provider_url
|
11
|
-
"https://api.proxyscrape.com/v2/?request=getproxies&protocol=socks4"
|
12
|
-
end
|
13
|
-
|
14
|
-
# Loads provider HTML and parses it with internal document object.
|
15
|
-
#
|
16
|
-
# @param url [String]
|
17
|
-
# URL to fetch
|
18
|
-
#
|
19
|
-
# @param filters [Hash]
|
20
|
-
# filters for proxy provider
|
21
|
-
#
|
22
|
-
# @return [Array]
|
23
|
-
# Collection of extracted proxies with ports
|
24
|
-
#
|
25
|
-
def load_document(url, filters = {})
|
26
|
-
html = load_html(url, filters)
|
27
|
-
|
28
|
-
CSV.parse(html, col_sep: "\t").map(&:first)
|
29
|
-
end
|
30
|
-
|
31
|
-
# Fetches HTML content by sending HTTP request to the provider URL and
|
32
|
-
# parses the txt document to return all the proxy entries (ip addresses
|
33
|
-
# and ports).
|
34
|
-
#
|
35
|
-
# @return [Array]
|
36
|
-
# Collection of extracted proxies with ports
|
37
|
-
#
|
38
|
-
def load_proxy_list(filters = {})
|
39
|
-
load_document(provider_url, filters)
|
40
|
-
end
|
41
|
-
|
42
|
-
# Converts String to <code>ProxyFetcher::Proxy</code> object.
|
43
|
-
#
|
44
|
-
# @param node [String]
|
45
|
-
# String
|
46
|
-
#
|
47
|
-
# @return [ProxyFetcher::Proxy]
|
48
|
-
# Proxy object
|
49
|
-
#
|
50
|
-
def to_proxy(html_node)
|
51
|
-
addr, port = html_node.split(":")
|
52
|
-
|
53
|
-
ProxyFetcher::Proxy.new.tap do |proxy|
|
54
|
-
proxy.addr = addr
|
55
|
-
proxy.port = Integer(port)
|
56
|
-
proxy.country = "Unknown"
|
57
|
-
proxy.anonymity = "Unknown"
|
58
|
-
proxy.type = ProxyFetcher::Proxy::SOCKS4
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
ProxyFetcher::Configuration.register_provider(:proxyscrape_socks4, ProxyscrapeSOCKS4)
|
64
|
-
end
|
65
|
-
end
|
@@ -1,65 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "csv"
|
4
|
-
|
5
|
-
module ProxyFetcher
|
6
|
-
module Providers
|
7
|
-
# FreeProxyList provider class.
|
8
|
-
class ProxyscrapeSOCKS5 < Base
|
9
|
-
# Provider URL to fetch proxy list
|
10
|
-
def provider_url
|
11
|
-
"https://api.proxyscrape.com/v2/?request=getproxies&protocol=socks5"
|
12
|
-
end
|
13
|
-
|
14
|
-
# Loads provider HTML and parses it with internal document object.
|
15
|
-
#
|
16
|
-
# @param url [String]
|
17
|
-
# URL to fetch
|
18
|
-
#
|
19
|
-
# @param filters [Hash]
|
20
|
-
# filters for proxy provider
|
21
|
-
#
|
22
|
-
# @return [Array]
|
23
|
-
# Collection of extracted proxies with ports
|
24
|
-
#
|
25
|
-
def load_document(url, filters = {})
|
26
|
-
html = load_html(url, filters)
|
27
|
-
|
28
|
-
CSV.parse(html, col_sep: "\t").map(&:first)
|
29
|
-
end
|
30
|
-
|
31
|
-
# Fetches HTML content by sending HTTP request to the provider URL and
|
32
|
-
# parses the txt document to return all the proxy entries (ip addresses
|
33
|
-
# and ports).
|
34
|
-
#
|
35
|
-
# @return [Array]
|
36
|
-
# Collection of extracted proxies with ports
|
37
|
-
#
|
38
|
-
def load_proxy_list(filters = {})
|
39
|
-
load_document(provider_url, filters)
|
40
|
-
end
|
41
|
-
|
42
|
-
# Converts String to <code>ProxyFetcher::Proxy</code> object.
|
43
|
-
#
|
44
|
-
# @param node [String]
|
45
|
-
# String
|
46
|
-
#
|
47
|
-
# @return [ProxyFetcher::Proxy]
|
48
|
-
# Proxy object
|
49
|
-
#
|
50
|
-
def to_proxy(html_node)
|
51
|
-
addr, port = html_node.split(":")
|
52
|
-
|
53
|
-
ProxyFetcher::Proxy.new.tap do |proxy|
|
54
|
-
proxy.addr = addr
|
55
|
-
proxy.port = Integer(port)
|
56
|
-
proxy.country = "Unknown"
|
57
|
-
proxy.anonymity = "Unknown"
|
58
|
-
proxy.type = ProxyFetcher::Proxy::SOCKS5
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
ProxyFetcher::Configuration.register_provider(:proxyscrape_socks5, ProxyscrapeSOCKS5)
|
64
|
-
end
|
65
|
-
end
|