njongto_duo 0.0.73 → 0.0.77

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/njongto_duo.rb +36 -34
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1c1a360bbb6958d1cdf7abcf979f845d150295fdcabd585e3bb1bc0decdb2c2e
4
- data.tar.gz: 3de2e9ca7c53a064d9e44e799e9b11441c9f18eb4834d97c7745f0006cba0b67
3
+ metadata.gz: 46911fe2ade93b5ee8fee31f6e478f2436dfa0d43f14622401a44e7de77d0ac0
4
+ data.tar.gz: 73ce7a2290640ab7f7fbc366363b4e9c0c881f96a689d0611362ae9c540ed2b3
5
5
  SHA512:
6
- metadata.gz: 1aed359a0e435be1a41c1d114d60a88f79aedba98235e9629e863a2bbad19b490cdb2daf1afbb42c94805490b49b13f09847e2b3afc5fff4d5f25a659eb26e3f
7
- data.tar.gz: 1d1158da493d4bfcd69a6ad75a7f4c90a81f8b8428221367d60a15d88681fc147653b8e55fb235e08822c55bebbd07afc939a891c38b68c0240e03c6d9b14962
6
+ metadata.gz: 2c41ea3d2524642b06dfaeb17b121b29815caaee7e43912122a6676785856e0b8168b0550d40f90daff4db74ed3867040d25de4a49ba4faee7ab44ffff0b44de
7
+ data.tar.gz: 497827bf3924570ca8e7b408aae16dfd0885c6e851f2bfa7bbe96ca9502033b052a24c1c31d27a26d9747412ea56e4c8ad9f0a66c86fcce0b3b42394ade3e382
data/lib/njongto_duo.rb CHANGED
@@ -30,11 +30,11 @@ class Naver
30
30
  FileUtils.mkdir_p(naver_cookie_dir) unless File.exist?(naver_cookie_dir)
31
31
  if proxy == ''
32
32
 
33
- system(%{"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe" https://naver.com/ --remote-debugging-port=9222 --user-data-dir=C:/naver_cookie/#{user_id} --no-first-run --no-default-browser-check --disable-sync})
33
+ system(%{"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe" https://my.naver.com/ --remote-debugging-port=9222 --user-data-dir=C:/naver_cookie/#{user_id} --no-first-run --no-default-browser-check --disable-sync})
34
34
 
35
35
  else
36
36
 
37
- system(%{"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe" https://naver.com/ --remote-debugging-port=9222 --user-data-dir=C:/naver_cookie/#{user_id} --proxy-server=#{proxy.to_s.force_encoding('utf-8').to_s} --no-first-run --no-default-browser-check --disable-sync})
37
+ system(%{"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe" https://my.naver.com/ --remote-debugging-port=9222 --user-data-dir=C:/naver_cookie/#{user_id} --proxy-server=#{proxy.to_s.force_encoding('utf-8').to_s} --no-first-run --no-default-browser-check --disable-sync})
38
38
 
39
39
  end
40
40
  end
@@ -186,61 +186,64 @@ class Naver
186
186
 
187
187
 
188
188
  chrome_start(proxy, user_id)
189
- @driver.get('https://www.naver.com')
190
- puts'[Step.01] 계정 로그인 및 세션 확인.......'.yellow
191
-
189
+
192
190
 
193
191
  sleep(1)
194
192
 
195
193
  begin
196
- wait = Selenium::WebDriver::Wait.new(:timeout => 7)
194
+ wait = Selenium::WebDriver::Wait.new(:timeout => 5)
197
195
  #요소가 나타날 때까지 3초 동안 기다립니다.
198
- wait.until { @driver.find_element(:xpath, '//*[@class="MyView-module__btn_logout___bsTOJ"]') }
196
+ wait.until { @driver.find_element(:xpath, '//*[@class="HeaderView_email__beGsy"]') }
199
197
  sleep(1.5)
200
198
  check_cookie_login = 1
201
- puts'[Step.02] 계정 세션 확인!! 로그인 skip.......'.yellow
199
+ puts' 계정 세션 확인!! 로그인 skip.......'.yellow
202
200
  sleep(2.5)
203
201
  rescue
204
- wait = Selenium::WebDriver::Wait.new(:timeout => 7)
205
- #요소가 나타날 때까지 3초 동안 기다립니다.
206
- wait.until { @driver.find_element(:xpath, '//*[@class="MyView-module__link_login___HpHMW"]') }
207
- sleep(1.5)
208
- @driver.find_element(:xpath, '//*[@class="MyView-module__link_login___HpHMW"]').click
209
- check_cookie_login = 0
210
- sleep(1)
202
+ begin
203
+ wait = Selenium::WebDriver::Wait.new(:timeout => 3)
204
+ wait.until { @driver.find_element(:xpath, '//*[@class="HeaderView_login_text__pFpJ_"]') }
205
+ sleep(1.5)
206
+ @driver.find_element(:xpath, '//*[@class="HeaderView_login_text__pFpJ_"]').click
207
+ check_cookie_login = 0
208
+ sleep(1)
209
+ rescue
210
+ @driver.quit
211
+ return 0
212
+ end
211
213
  end
212
214
 
213
215
  if check_cookie_login == 0
214
- puts'[Step.02] 계정 세션이 없거나 기간 만료로 인해 로그인 시도.......'.yellow
216
+ puts' 계정 세션이 없거나 기간 만료로 인해 로그인 시도.......'.yellow
215
217
  # @driver.find_element(:xpath, '//*[@id="right-content-area"]/div[1]/div[1]/div/a').click
216
218
  sleep(3)
217
219
  begin
218
220
  wait = Selenium::WebDriver::Wait.new(:timeout => 7)
219
221
  #요소가 나타날 때까지 3초 동안 기다립니다.
220
- wait.until { @driver.find_element(:xpath, '//*[@id="id" and @name="id"]') }
221
- @driver.find_element(:xpath, '//*[@id="id" and @name="id"]').click
222
+ wait.until { @driver.find_element(:xpath, '//*[@id="id"]') }
223
+ sleep(1.5)
224
+
225
+ @driver.find_element(:xpath, '//*[@id="id"]').click
222
226
  Clipboard.copy(user_id)
223
227
  @driver.action.key_down(:control).send_keys('v').key_up(:control).perform
224
228
  sleep(1.5)
225
- @driver.find_element(:xpath, '//*[@id="pw" and @name="pw"]').click
229
+ @driver.find_element(:xpath, '//*[@id="pw"]').click
226
230
  Clipboard.copy(user_pw)
227
231
  @driver.action.key_down(:control).send_keys('v').key_up(:control).perform
228
232
  sleep(1.5)
229
-
233
+ @driver.find_element(:xpath, '//*[@type="submit" and @class="btn_check next_step" and @id="submit_btn"]').click
234
+ sleep(2.5)
230
235
  begin
231
- smart_level_value = @driver.find_element(id: 'smart_LEVEL').attribute('value')
232
- if smart_level_value == '1'
233
- @driver.find_element(xpath: '//label[@for="switch" and @class="switch_btn"]').click
236
+ wait = Selenium::WebDriver::Wait.new(:timeout => 3)
237
+ #요소가 나타날 때까지 3초 동안 기다립니다.
238
+ wait.until { @driver.find_element(:xpath, '//button[@ype="button" and @id="new.save" and @class="btn_check nlog-click"]') } #기기 확인 버튼 확인
239
+ #wait.until { @driver.find_element(:xpath, '//button[@ype="button" and @id="new.dontsave" and @class="btn_white nlog-click"]') } #기기 취소 버튼 확인
234
240
  sleep(1.5)
235
- end
236
- rescue
237
- end
241
+ @driver.find_element(:xpath, '//button[@ype="button" and @id="new.save" and @class="btn_check nlog-click"]').click
242
+ #@driver.find_element(:xpath, '//button[@ype="button" and @id="new.dontsave" and @class="btn_white nlog-click"]') #기기 취소 버튼 클릭
243
+ rescue
244
+ end
245
+
238
246
 
239
- wait = Selenium::WebDriver::Wait.new(:timeout => 3)
240
- #요소가 나타날 때까지 3초 동안 기다립니다.
241
- wait.until { @driver.find_element(xpath: '//button[@type="submit" and @id="log.login"]') }
242
- @driver.find_element(xpath: '//button[@type="submit" and @id="log.login"]').click
243
- sleep(2.5)
244
247
  rescue => e
245
248
  puts '-[√] 로딩 지연 접속 실패.......'.red
246
249
  @driver.window_handles.each do |handle|
@@ -254,7 +257,7 @@ class Naver
254
257
  end
255
258
  return 0
256
259
  @driver.quit
257
- end
260
+ end
258
261
 
259
262
  else
260
263
  # @driver.switch_to.default_content
@@ -263,8 +266,7 @@ class Naver
263
266
  begin
264
267
  wait = Selenium::WebDriver::Wait.new(:timeout => 5)
265
268
  #요소가 나타날 때까지 3초 동안 기다립니다.
266
- wait.until { @driver.find_element(:xpath, '//*[@type="button" and @class="MyView-module__btn_logout___bsTOJ"]') }
267
-
269
+ wait.until { @driver.find_element(:xpath, '//*[@class="HeaderView_email__beGsy"]') }
268
270
  rescue => e
269
271
  puts '-[√] 로그인 실패.......'.red
270
272
  @driver.window_handles.each do |handle|
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: njongto_duo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.73
4
+ version: 0.0.77
5
5
  platform: ruby
6
6
  authors:
7
7
  - zon
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-07-08 00:00:00.000000000 Z
10
+ date: 2025-07-16 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: File to Clipboard gem
13
13
  email: mymin26@naver.com