adspower-client 1.0.16 → 1.0.17
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/adspower-client.gemspec +1 -1
- data/lib/adspower-client.rb +11 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0fa9af194c360323a9ddb4533f0be4df21414e2a3645fdebb03a9a13eb315183
|
4
|
+
data.tar.gz: 474d47d140310200db7919c293e260761e90f33bbeef72ad923b27cfdbb180e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e39840a574b00918fc9365be4ee9ffde97c8d9bdbcc4017184a2b4589dd99de31c6c6cc0e7a4eb14f6506b0e8e686ffe96f256d69dd7688dd379de9bab61b0d
|
7
|
+
data.tar.gz: 93957f83998d804fe74a423337fb13afa8bff70ed1eddb74a4da0f7cd9722b857eed3870797670ce71c8387e3f7cab745752c48df7f6c5b9520e9f3d8b21c152
|
data/adspower-client.gemspec
CHANGED
data/lib/adspower-client.rb
CHANGED
@@ -199,6 +199,7 @@ class AdsPowerClient
|
|
199
199
|
# @param proxy_config [Hash] keys: :ip, :port, :user, :password, :proxy_soft (default 'other'), :proxy_type (default 'http')
|
200
200
|
# @param group_id [String] which AdsPower group to assign (default '0')
|
201
201
|
# @param browser_version [String] optional Chrome version to use (must match Chromedriver). Only applies if `fingerprint` is nil, as custom fingerprints override kernel settings.
|
202
|
+
# @param os [String] target OS for Chrome binary (one of 'linux64', 'mac-x64', 'mac-arm64', 'win32', 'win64'; default 'linux64'); used to filter the known-good versions JSON so we pick a build that actually ships for that platform
|
202
203
|
# @param fingerprint [Hash, nil] optional fingerprint configuration. If not provided, a stealth-ready default is applied with DNS-over-HTTPS, spoofed WebGL/Canvas/audio, consistent User-Agent and locale, and hardening flags to minimize detection risks from tools like BrowserScan, Cloudflare, and Arkose Labs.
|
203
204
|
# @param platform [String] (optional) target site domain, e.g. 'linkedin.com'
|
204
205
|
# @param tabs [Array<String>] (optional) array of URLs to open on launch
|
@@ -211,7 +212,8 @@ class AdsPowerClient
|
|
211
212
|
proxy_config:,
|
212
213
|
group_id: '0',
|
213
214
|
browser_version: nil,
|
214
|
-
|
215
|
+
os: 'linux64',# new: one of linux64, mac-x64, mac-arm64, win32, win64
|
216
|
+
fingerprint: nil,
|
215
217
|
platform: '', # default: no platform
|
216
218
|
tabs: [], # default: no tabs to open
|
217
219
|
username: '', # default: no login
|
@@ -228,10 +230,14 @@ class AdsPowerClient
|
|
228
230
|
raise "Error fetching Chrome versions: HTTP #{resp.code}"
|
229
231
|
end
|
230
232
|
listing = JSON.parse(resp.body)
|
231
|
-
|
232
|
-
#
|
233
|
-
matches =
|
234
|
-
|
233
|
+
entries = listing['versions'] || []
|
234
|
+
# keep only those entries whose version matches prefix *and* has a download for our OS
|
235
|
+
matches = entries.
|
236
|
+
select { |e|
|
237
|
+
e['version'].start_with?("#{browser_version}.") &&
|
238
|
+
e.dig('downloads','chrome').any? { |d| d['platform'] == os }
|
239
|
+
}.
|
240
|
+
map { |e| e['version'] }
|
235
241
|
if matches.empty?
|
236
242
|
raise "Chrome version '#{browser_version}' not found in known-good versions list"
|
237
243
|
end
|