posting_zon 3.111.001 → 3.111.003
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/posting_zon.rb +43 -48
- 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: b292f1aa782c927e934070c47d89c90480fecae9b346c259c3cc7e4fb13b8296
|
4
|
+
data.tar.gz: 2657a7e97dfa02ec0d7254ccde92df6cfc6d7856a8704fe3c1becd513c34db67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c24c787c5e22ce059c4b6212e6d2627f53cf117fbb28384503421f4c8c4fa8450ee169c290b666d44a315f504bfdd4eb8520c0c5bde26436c6b41b260367a7c
|
7
|
+
data.tar.gz: 74a1b8b73e7f464b317690655fc5675f62eb153fbb662c1bd005ae1a2dd020dbb31720078cb7e385bf0544775cfd41b84f7a230e4752398cd56f4efa4a24d16d
|
data/lib/posting_zon.rb
CHANGED
@@ -25,44 +25,18 @@ include AutoClickMethods
|
|
25
25
|
using Rainbow
|
26
26
|
|
27
27
|
|
28
|
-
class ChromeKiller
|
29
|
-
def self.kill_selenium_chrome
|
30
|
-
begin
|
31
|
-
wmi = WIN32OLE.connect("winmgmts://")
|
32
|
-
chrome_procs = wmi.ExecQuery("SELECT * FROM Win32_Process WHERE Name = 'chrome.exe'")
|
33
|
-
chrome_procs.each do |proc|
|
34
|
-
begin
|
35
|
-
cmd = proc.CommandLine rescue nil
|
36
|
-
next unless cmd && cmd.include?("user-data-dir=C:/board_cookie")
|
37
28
|
|
38
|
-
puts "→ 크롬 창 초기화: PID #{proc.ProcessId}"
|
39
|
-
proc.Terminate rescue nil
|
40
|
-
rescue => inner_e
|
41
|
-
puts "프로세스 처리 중 오류: #{inner_e.message}"
|
42
|
-
end
|
43
|
-
end
|
44
|
-
sleep(1)
|
45
|
-
rescue => e
|
46
|
-
puts "Chrome 종료 시도 중 오류 발생: #{e.message}"
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
29
|
|
51
30
|
class Naver
|
52
31
|
def initialize
|
53
|
-
|
54
|
-
ChromeKiller.kill_selenium_chrome
|
55
|
-
sleep(1)
|
56
|
-
rescue => e
|
57
|
-
puts "크롬 창 초기화 시도 중 오류 발생: #{e.message} (무시하고 진행)"
|
58
|
-
end
|
32
|
+
|
59
33
|
end
|
60
34
|
|
61
35
|
|
62
36
|
def chrome_setup(proxy, board_cookie_dir = "C:/board_cookie")
|
63
37
|
board_cookie_dir = "C:/board_cookie"
|
64
38
|
FileUtils.mkdir_p(board_cookie_dir) unless File.exist?(board_cookie_dir)
|
65
|
-
|
39
|
+
|
66
40
|
if proxy == ''
|
67
41
|
system(%{"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe" --window-position=0,0 --remote-debugging-port=9222 --user-data-dir=C:/board_cookie --no-first-run --no-default-browser-check --disable-sync https://chromewebstore.google.com/detail/captcha-solver-auto-recog/ifibfemgeogfhoebkmokieepdoobkbpo?hl=ko})
|
68
42
|
else
|
@@ -95,9 +69,8 @@ class Naver
|
|
95
69
|
options.add_argument('--disable-sync') # Chrome 동기화 비활성화
|
96
70
|
options.add_argument('--disable-popup-blocking') # 팝업 방지 (로그인 창이 뜨는 경우 대비)
|
97
71
|
options.add_argument('--no-default-browser-check')
|
98
|
-
options.page_load_strategy =
|
72
|
+
options.page_load_strategy = 'normal'
|
99
73
|
options.timeouts = {page_load: 30_000}
|
100
|
-
options.page_load_strategy = 'none'
|
101
74
|
options.add_argument('--disable-blink-features=AutomationControlled') #자동화된 환경에서 실행되는 것을 감지하는 기능을 비활성화합니다.
|
102
75
|
options.add_argument('--disable-gpu')
|
103
76
|
options.add_argument('--remote-debugging-port=9222')
|
@@ -146,9 +119,8 @@ class Naver
|
|
146
119
|
options.add_argument('--disable-popup-blocking') # 팝업 방지 (로그인 창이 뜨는 경우 대비)
|
147
120
|
options.add_argument('--no-default-browser-check')
|
148
121
|
options.add_argument '--proxy-server='+proxy.to_s.force_encoding('utf-8').to_s
|
149
|
-
options.page_load_strategy =
|
122
|
+
options.page_load_strategy = 'normal'
|
150
123
|
options.timeouts = {page_load: 30_000}
|
151
|
-
options.page_load_strategy = 'none'
|
152
124
|
options.add_argument('--disable-blink-features=AutomationControlled') #자동화된 환경에서 실행되는 것을 감지하는 기능을 비활성화합니다.
|
153
125
|
options.add_argument('--disable-gpu')
|
154
126
|
options.add_argument('--remote-debugging-port=9222')
|
@@ -195,9 +167,8 @@ class Naver
|
|
195
167
|
options.add_argument('--disable-sync') # Chrome 동기화 비활성화
|
196
168
|
options.add_argument('--disable-popup-blocking') # 팝업 방지 (로그인 창이 뜨는 경우 대비)
|
197
169
|
options.add_argument('--no-default-browser-check')
|
198
|
-
options.page_load_strategy =
|
170
|
+
options.page_load_strategy = 'normal'
|
199
171
|
options.timeouts = {page_load: 30_000}
|
200
|
-
options.page_load_strategy = 'none'
|
201
172
|
options.add_argument('--disable-blink-features=AutomationControlled') #자동화된 환경에서 실행되는 것을 감지하는 기능을 비활성화합니다.
|
202
173
|
options.add_argument('--disable-gpu')
|
203
174
|
options.add_argument('--remote-debugging-port=9222')
|
@@ -228,8 +199,34 @@ class Naver
|
|
228
199
|
end
|
229
200
|
end
|
230
201
|
end
|
202
|
+
|
203
|
+
class ChromeKiller
|
204
|
+
def self.kill_selenium_chrome
|
205
|
+
begin
|
206
|
+
wmi = WIN32OLE.connect("winmgmts://")
|
207
|
+
chrome_procs = wmi.ExecQuery("SELECT * FROM Win32_Process WHERE Name = 'chrome.exe'")
|
208
|
+
chrome_procs.each do |proc|
|
209
|
+
begin
|
210
|
+
cmd = proc.CommandLine rescue nil
|
211
|
+
next unless cmd && cmd.include?("user-data-dir=C:/board_cookie")
|
212
|
+
proc.Terminate rescue nil
|
213
|
+
rescue
|
214
|
+
end
|
215
|
+
end
|
216
|
+
sleep(1)
|
217
|
+
rescue
|
218
|
+
end
|
219
|
+
end
|
220
|
+
end
|
221
|
+
|
222
|
+
def wait_for_page_load(timeout: 30)
|
223
|
+
wait = Selenium::WebDriver::Wait.new(timeout: timeout)
|
224
|
+
wait.until { @driver.execute_script("return document.readyState") == "complete" }
|
225
|
+
rescue Selenium::WebDriver::Error::TimeoutError
|
226
|
+
puts "[!] 페이지 로딩이 30초 내 완료되지 않았습니다."
|
227
|
+
end
|
231
228
|
|
232
|
-
|
229
|
+
def login(proxy, captcha_key, board_cookie_dir = "C:/board_cookie")
|
233
230
|
@captcha_key = captcha_key
|
234
231
|
@board_cookie_dir = "C:/board_cookie"
|
235
232
|
current_dir = File.dirname(__FILE__)
|
@@ -243,14 +240,23 @@ class Naver
|
|
243
240
|
end
|
244
241
|
end
|
245
242
|
|
243
|
+
|
244
|
+
begin
|
245
|
+
ChromeKiller.kill_selenium_chrome
|
246
|
+
sleep(2)
|
247
|
+
rescue
|
248
|
+
end
|
249
|
+
|
246
250
|
# 새로운 스레드 생성 및 실행
|
247
|
-
Thread.new { chrome_setup(proxy, board_cookie_dir)
|
251
|
+
Thread.new { chrome_setup(proxy, board_cookie_dir)}
|
248
252
|
|
249
253
|
# 충분한 대기 시간을 두고 실행
|
250
254
|
sleep(1)
|
251
255
|
|
252
|
-
chrome_start(proxy, board_cookie_dir)
|
253
256
|
|
257
|
+
|
258
|
+
chrome_start(proxy, board_cookie_dir)
|
259
|
+
wait_for_page_load(timeout: 30)
|
254
260
|
|
255
261
|
target_url = "https://chromewebstore.google.com/detail/captcha-solver-auto-recog/ifibfemgeogfhoebkmokieepdoobkbpo?hl=ko"
|
256
262
|
|
@@ -7936,17 +7942,6 @@ rescue
|
|
7936
7942
|
puts '-[√] 제목 입력 항목 코드 탐색 실패!!.......'.red
|
7937
7943
|
puts '-[√] 다음 작업 준비 중으로 1~60 초 정도 기다려주세요.......'.red
|
7938
7944
|
|
7939
|
-
@driver.window_handles.each do |handle|
|
7940
|
-
@driver.switch_to.window(handle)
|
7941
|
-
begin
|
7942
|
-
# 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
|
7943
|
-
@driver.close
|
7944
|
-
|
7945
|
-
rescue Selenium::WebDriver::Error::WebDriverError => e
|
7946
|
-
puts "크롬 브라우저 종료: #{e.message}"
|
7947
|
-
end
|
7948
|
-
end
|
7949
|
-
#return 0
|
7950
7945
|
@driver.quit
|
7951
7946
|
sleep(1)
|
7952
7947
|
return 0
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: posting_zon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.111.
|
4
|
+
version: 3.111.003
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zon
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-06-
|
10
|
+
date: 2025-06-25 00:00:00.000000000 Z
|
11
11
|
dependencies: []
|
12
12
|
description: posting app
|
13
13
|
email: mymin26@naver.com
|