cafe_buy_duo 0.0.39 → 0.0.51
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/lib/cafe_buy_duo.rb +99 -57
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5190146a15ac1b0efb060a051aaed921593c9cb7b40a131f3316ecd15c994bd4
|
4
|
+
data.tar.gz: 6923fea1091b14ad9e728be5269ac4b317283913069e01e31ad72556a0160552
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef0b0967d98c3b9c0123ed516bd19a72e4e9ece8e1ca003a3b5fc6d7af1d4a4968e6a11efff3167fcc4795f24a8de7f04ae3bacd3aae94fb3b2d08323ebd0f15
|
7
|
+
data.tar.gz: 42e034f833d5f14dc4a2aea963bd84128ef933488d24df5af5564c146d3e4a5c01cabe3a932cd0db51bd4d68293d8e236c10f420726afc8c485044acb2d93e8d
|
data/lib/cafe_buy_duo.rb
CHANGED
@@ -235,9 +235,19 @@ class Naver
|
|
235
235
|
options.add_argument('--disable-gpu')
|
236
236
|
options.add_argument('--remote-debugging-port=9222')
|
237
237
|
options.add_argument('user-data-dir=C:/naver_cookie/' + user_id)
|
238
|
-
|
239
|
-
|
240
|
-
|
238
|
+
options.add_argument('--disable-blink-features=AutomationControlled') # JavaScript로 navigator.webdriver 숨기기
|
239
|
+
|
240
|
+
# 'capabilities'과 'options' 배열로 설정
|
241
|
+
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome
|
242
|
+
capabilities["goog:chromeOptions"] = options.as_json
|
243
|
+
|
244
|
+
# Selenium 4에서는 'capabilities'만 사용하는 방식
|
245
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: [capabilities, options])
|
246
|
+
|
247
|
+
@driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: function(){ return false; }});") # 셀레니움 감지 방지
|
248
|
+
|
249
|
+
rescue => e
|
250
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: [capabilities, options])
|
241
251
|
end
|
242
252
|
else
|
243
253
|
begin
|
@@ -253,7 +263,17 @@ class Naver
|
|
253
263
|
options.add_argument('--disable-gpu')
|
254
264
|
options.add_argument('--remote-debugging-port=9222')
|
255
265
|
options.add_argument('user-data-dir=C:/naver_cookie/' + user_id)
|
256
|
-
|
266
|
+
|
267
|
+
options.add_argument('--disable-blink-features=AutomationControlled') # JavaScript로 navigator.webdriver 숨기기
|
268
|
+
|
269
|
+
# 'capabilities'과 'options' 배열로 설정
|
270
|
+
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome
|
271
|
+
capabilities["goog:chromeOptions"] = options.as_json
|
272
|
+
|
273
|
+
# Selenium 4에서는 'capabilities'만 사용하는 방식
|
274
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: [capabilities, options])
|
275
|
+
|
276
|
+
@driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: function(){ return false; }});") # 셀레니움 감지 방지
|
257
277
|
rescue => e
|
258
278
|
puts e
|
259
279
|
puts 'proxy error...'
|
@@ -269,9 +289,18 @@ class Naver
|
|
269
289
|
options.add_argument('--disable-gpu')
|
270
290
|
options.add_argument('--remote-debugging-port=9222')
|
271
291
|
options.add_argument('user-data-dir=C:/naver_cookie/' + user_id)
|
272
|
-
|
292
|
+
options.add_argument('--disable-blink-features=AutomationControlled') # JavaScript로 navigator.webdriver 숨기기
|
293
|
+
|
294
|
+
# 'capabilities'과 'options' 배열로 설정
|
295
|
+
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome
|
296
|
+
capabilities["goog:chromeOptions"] = options.as_json
|
297
|
+
|
298
|
+
# Selenium 4에서는 'capabilities'만 사용하는 방식
|
299
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: [capabilities, options])
|
300
|
+
|
301
|
+
@driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: function(){ return false; }});") # 셀레니움 감지 방지
|
273
302
|
rescue
|
274
|
-
@driver = Selenium::WebDriver.for(:chrome,
|
303
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: [capabilities, options])
|
275
304
|
end
|
276
305
|
end
|
277
306
|
end
|
@@ -279,6 +308,7 @@ class Naver
|
|
279
308
|
|
280
309
|
|
281
310
|
|
311
|
+
|
282
312
|
def login(user_id, user_pw, proxy)
|
283
313
|
@user_id = user_id
|
284
314
|
@user_id11 = user_id
|
@@ -2520,65 +2550,77 @@ class Wordpress
|
|
2520
2550
|
puts table[10]
|
2521
2551
|
if table[7].to_i > table[10].to_i
|
2522
2552
|
if @data['포스트설정']['테더링'].checked?
|
2523
|
-
|
2524
|
-
|
2525
|
-
|
2526
|
-
|
2527
|
-
|
2528
|
-
|
2529
|
-
|
2530
|
-
|
2531
|
-
|
2532
|
-
|
2533
|
-
|
2534
|
-
sleep(
|
2535
|
-
|
2536
|
-
|
2537
|
-
|
2538
|
-
|
2539
|
-
sleep(
|
2540
|
-
|
2541
|
-
#
|
2542
|
-
|
2543
|
-
|
2544
|
-
|
2545
|
-
|
2546
|
-
|
2547
|
-
|
2548
|
-
|
2549
|
-
|
2550
|
-
|
2551
|
-
|
2552
|
-
|
2553
|
-
|
2554
|
-
|
2555
|
-
|
2556
|
-
|
2557
|
-
|
2558
|
-
|
2559
|
-
|
2560
|
-
|
2561
|
-
|
2553
|
+
puts 'tethering ip change...'
|
2554
|
+
|
2555
|
+
# ADB devices 확인
|
2556
|
+
stdout, stderr, status = Open3.capture3('./adb devices')
|
2557
|
+
if status.success?
|
2558
|
+
device_id = stdout.split("\n")[1].split("\t")[0]
|
2559
|
+
puts device_id
|
2560
|
+
|
2561
|
+
# ADB 서버 초기화
|
2562
|
+
puts 'adb kill-server'
|
2563
|
+
Open3.capture3('adb kill-server')
|
2564
|
+
sleep(2)
|
2565
|
+
|
2566
|
+
# 다시 ADB 서버 실행
|
2567
|
+
puts 'adb start-server'
|
2568
|
+
Open3.capture3('adb start-server')
|
2569
|
+
sleep(2)
|
2570
|
+
|
2571
|
+
# 데이터를 끄고 켜기
|
2572
|
+
puts 'adb -s ' + device_id + ' shell svc data disable'
|
2573
|
+
stdout2, stderr2, status2 = Open3.capture3('./adb -s ' + device_id + ' shell svc data disable')
|
2574
|
+
|
2575
|
+
if status2.success?
|
2576
|
+
sleep(3)
|
2577
|
+
puts 'adb -s ' + device_id + ' shell svc data enable'
|
2578
|
+
Open3.capture3('./adb -s ' + device_id + ' shell svc data enable')
|
2579
|
+
sleep(3)
|
2580
|
+
puts 'adb ok'
|
2581
|
+
sleep(8)
|
2582
|
+
|
2583
|
+
# IP 확인 및 재시도 (반복문 사용)
|
2584
|
+
retry_count = 0
|
2585
|
+
max_retries = 5
|
2586
|
+
current_ip = nil
|
2587
|
+
|
2588
|
+
# 무한 루프 방지
|
2589
|
+
while retry_count < max_retries
|
2590
|
+
begin
|
2591
|
+
http = HTTP.get('https://www.findip.kr/')
|
2592
|
+
noko = Nokogiri::HTML(http.to_s)
|
2593
|
+
new_ip = noko.xpath('/html/body/header/h2').text.strip
|
2594
|
+
|
2595
|
+
puts "Current IP: #{@my_ip}, New IP: #{new_ip}"
|
2596
|
+
|
2597
|
+
# IP가 변경되었으면 @my_ip를 갱신하고 종료
|
2598
|
+
if new_ip != @my_ip
|
2599
|
+
@my_ip = new_ip
|
2600
|
+
puts "IP 변경됨: #{@my_ip}"
|
2601
|
+
break
|
2602
|
+
else
|
2603
|
+
puts 'IP가 변경되지 않음. 재시도...'
|
2604
|
+
retry_count += 1
|
2605
|
+
sleep(3) # 3초 후 재시도
|
2606
|
+
end
|
2607
|
+
rescue => e
|
2562
2608
|
retry_count += 1
|
2563
2609
|
sleep(3) # 3초 후 재시도
|
2564
2610
|
end
|
2565
|
-
|
2566
|
-
|
2567
|
-
|
2568
|
-
|
2569
|
-
|
2570
|
-
# 최대 재시도 횟수를 초과하면 예외 발생시키기
|
2571
|
-
if retry_count >= max_retries
|
2572
|
-
raise "최대 재시도 횟수 초과. IP 변경 실패."
|
2611
|
+
|
2612
|
+
# 최대 재시도 횟수를 초과하면 예외 발생시키기
|
2613
|
+
if retry_count >= max_retries
|
2614
|
+
raise "최대 재시도 횟수 초과. IP 변경 실패."
|
2615
|
+
end
|
2573
2616
|
end
|
2617
|
+
else
|
2618
|
+
puts 'Failed to disable data. Error: ' + stderr2
|
2574
2619
|
end
|
2575
2620
|
else
|
2576
|
-
puts '
|
2621
|
+
puts 'adb error, unable to get devices. Error: ' + stderr
|
2577
2622
|
end
|
2578
|
-
else
|
2579
|
-
puts 'adb error, unable to get devices. Error: ' + stderr
|
2580
2623
|
end
|
2581
|
-
end
|
2582
2624
|
|
2583
2625
|
|
2584
2626
|
check_success = 1
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cafe_buy_duo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.51
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-02-
|
11
|
+
date: 2025-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: File to Clipboard gem
|
14
14
|
email: mymin26@naver.com
|