njongto_duo 0.0.51 → 0.0.53
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/njongto_duo.rb +57 -47
- 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: d7d907483d65329f2b37504cf7377de36d0bca820f2789df1f9cebc5f576d0f8
|
4
|
+
data.tar.gz: d15ce8a78dc222c5f999aef264a715dd0d644da2da292fb68e551681d3c7538e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4abd54455b62183a1a2bffa40c132f988ff24994aacbe4ba8c5a6b36bdba7b3e119646f22d19096d3874df7c08fd8a77dec97d83b450a663ff8b9f1972a58a99
|
7
|
+
data.tar.gz: e0e5f545ced100851dc9efca1372ce9ac7e5b8493a817d6359e8c12b1e612b0eeeea90edb48924ab08f666ef44b79c8a2ff3d640d058a2aaa438081f198c48b8
|
data/lib/njongto_duo.rb
CHANGED
@@ -51,9 +51,17 @@ class Naver
|
|
51
51
|
options.add_argument('--disable-gpu')
|
52
52
|
options.add_argument('--remote-debugging-port=9222')
|
53
53
|
options.add_argument('user-data-dir=C:/naver_cookie/' + user_id)
|
54
|
-
|
55
|
-
|
56
|
-
|
54
|
+
# 'capabilities'과 'options' 배열로 설정
|
55
|
+
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome
|
56
|
+
capabilities["goog:chromeOptions"] = options.as_json
|
57
|
+
|
58
|
+
# Selenium 4에서는 'capabilities'만 사용하는 방식
|
59
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: [capabilities, options])
|
60
|
+
|
61
|
+
@driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: function(){ return false; }});") # 셀레니움 감지 방지
|
62
|
+
|
63
|
+
rescue => e
|
64
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: [capabilities, options])
|
57
65
|
end
|
58
66
|
else
|
59
67
|
begin
|
@@ -69,7 +77,14 @@ class Naver
|
|
69
77
|
options.add_argument('--disable-gpu')
|
70
78
|
options.add_argument('--remote-debugging-port=9222')
|
71
79
|
options.add_argument('user-data-dir=C:/naver_cookie/' + user_id)
|
72
|
-
|
80
|
+
# 'capabilities'과 'options' 배열로 설정
|
81
|
+
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome
|
82
|
+
capabilities["goog:chromeOptions"] = options.as_json
|
83
|
+
|
84
|
+
# Selenium 4에서는 'capabilities'만 사용하는 방식
|
85
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: [capabilities, options])
|
86
|
+
|
87
|
+
@driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: function(){ return false; }});") # 셀레니움 감지 방지
|
73
88
|
rescue => e
|
74
89
|
puts e
|
75
90
|
puts 'proxy error...'
|
@@ -85,9 +100,16 @@ class Naver
|
|
85
100
|
options.add_argument('--disable-gpu')
|
86
101
|
options.add_argument('--remote-debugging-port=9222')
|
87
102
|
options.add_argument('user-data-dir=C:/naver_cookie/' + user_id)
|
88
|
-
|
103
|
+
# 'capabilities'과 'options' 배열로 설정
|
104
|
+
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome
|
105
|
+
capabilities["goog:chromeOptions"] = options.as_json
|
106
|
+
|
107
|
+
# Selenium 4에서는 'capabilities'만 사용하는 방식
|
108
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: [capabilities, options])
|
109
|
+
|
110
|
+
@driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: function(){ return false; }});") # 셀레니움 감지 방지
|
89
111
|
rescue
|
90
|
-
@driver = Selenium::WebDriver.for(:chrome,
|
112
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: [capabilities, options])
|
91
113
|
end
|
92
114
|
end
|
93
115
|
end
|
@@ -95,6 +117,7 @@ class Naver
|
|
95
117
|
|
96
118
|
|
97
119
|
|
120
|
+
|
98
121
|
def login(user_id, user_pw, proxy)
|
99
122
|
@user_id = user_id
|
100
123
|
@user_id11 = user_id
|
@@ -554,56 +577,43 @@ class Wordpress
|
|
554
577
|
|
555
578
|
# ADB 서버 초기화
|
556
579
|
puts 'adb kill-server'
|
557
|
-
Open3.capture3('adb kill-server')
|
558
|
-
sleep(
|
580
|
+
Open3.capture3('./adb kill-server')
|
581
|
+
sleep(3)
|
559
582
|
|
560
583
|
# 다시 ADB 서버 실행
|
561
584
|
puts 'adb start-server'
|
562
|
-
Open3.capture3('adb start-server')
|
563
|
-
sleep(
|
585
|
+
Open3.capture3('./adb start-server')
|
586
|
+
sleep(3)
|
564
587
|
|
565
588
|
# 데이터를 끄고 켜기
|
566
589
|
puts 'adb -s ' + device_id + ' shell svc data disable'
|
567
|
-
stdout2, stderr2, status2 = Open3.capture3('./adb -s '
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
@my_ip = new_ip
|
587
|
-
puts "IP 변경됨: #{@my_ip}"
|
588
|
-
break # IP가 변경되었으면 루프 종료
|
589
|
-
else
|
590
|
-
puts 'IP가 변경되지 않음. 재시도...'
|
591
|
-
sleep(3) # 3초 후 재시도
|
592
|
-
end
|
593
|
-
rescue => e
|
594
|
-
puts "IP 확인 중 오류 발생: #{e.message}. 재시도 중..."
|
595
|
-
sleep(3) # 3초 후 재시도
|
596
|
-
end
|
597
|
-
end
|
590
|
+
stdout2, stderr2, status2 = Open3.capture3('./adb -s '+device_id+' shell svc data disable')
|
591
|
+
sleep(3)
|
592
|
+
puts 'adb -s ' + device_id + ' shell svc data enable'
|
593
|
+
Open3.capture3('./adb -s '+device_id+' shell svc data enable')
|
594
|
+
sleep(3)
|
595
|
+
puts 'adb ok'
|
596
|
+
sleep(8)
|
597
|
+
|
598
|
+
robot_ip = lambda do
|
599
|
+
http = HTTP.get('https://www.findip.kr/')
|
600
|
+
noko = Nokogiri::HTML(http.to_s)
|
601
|
+
if noko.xpath('/html/body/header/h2').text != @my_ip
|
602
|
+
@my_ip = noko.xpath('/html/body/header/h2').text
|
603
|
+
puts "IP 변경됨[ #{@my_ip} ]"
|
604
|
+
else
|
605
|
+
puts @my_ip
|
606
|
+
puts '제시도...'
|
607
|
+
sleep(3)
|
608
|
+
robot_ip[]
|
598
609
|
end
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
end
|
610
|
+
end
|
611
|
+
robot_ip[]
|
612
|
+
|
603
613
|
else
|
604
|
-
|
614
|
+
puts 'adb error pass'
|
605
615
|
end
|
606
|
-
|
616
|
+
end
|
607
617
|
|
608
618
|
check_success = 1
|
609
619
|
@data['table'][index][-1] = 0
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: njongto_duo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.53
|
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-12 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: File to Clipboard gem
|
14
14
|
email: mymin26@naver.com
|