tg_send_duo 0.0.39 → 0.0.50

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/tg_send_duo.rb +34 -6
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3591b8da281bef54a2d1ce06bdf06896bc49025c695c51e77adea46d294aabeb
4
- data.tar.gz: b30f1f04496c50e8e11d6cb035724ed77394c10c970b67252eb0a510579d9195
3
+ metadata.gz: 22d0e018da798d6137cece99213b25fdce3c42464e55bd14a325a6dd049cce61
4
+ data.tar.gz: 2286a3cb9f34852e8c6c92c7da10786457bfc9d671357d83039f2ea6da824d80
5
5
  SHA512:
6
- metadata.gz: 97e7f903a7a9b03100fcf898f533eb1b3da7f592766636714831d5ca3fe9a39cdac5cc524aa0c5c88e081bab0502c409a19bf6dfd54dad8dca7bc1a20733c43a
7
- data.tar.gz: 75375026942cc738da6b6f2bd65b015440e53bca1cf33d57ac4cf473360b2d5b8e67b3a7c26067650ae58ed8f06c15580c9e925aaca7dc8cc037853d931ffb58
6
+ metadata.gz: 6ff49a03026eee5f9dfb5f6122f377df8f23ff23a471fc60e8b7b82aa4388913cde66f964f32b61aaf721367944803f3b34112b52d9c0a04c4cf7c2cc5d9ec13
7
+ data.tar.gz: 2ad9b50bab5923c3917d8a4653a2d5cbe76531c105539681c7121dec1eff01f7c0d19f8b115c562e48028609fa0597a3226e1e1ed0960305f08bb77d0122467e
data/lib/tg_send_duo.rb CHANGED
@@ -35,7 +35,8 @@ class Naver
35
35
  begin
36
36
  Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
37
37
  options = Selenium::WebDriver::Chrome::Options.new
38
-
38
+ options.add_argument('--no-first-run') # 자동 실행 시 나타나는 "첫 실행" 화면 방지
39
+ options.add_argument('--disable-extensions') # 확장 프로그램 초기화 화면 방지
39
40
  options.add_argument('--headless') # 브라우저 UI 없이 실행
40
41
  options.add_argument('--disable-gpu') # GPU 가속을 비활성화 (헤드리스에서 필요할 수 있음)
41
42
  options.add_argument('--no-sandbox')
@@ -49,7 +50,14 @@ class Naver
49
50
  options.add_argument('user-data-dir=C:/telegram_cookie/' + telegram_number)
50
51
 
51
52
 
52
- @driver = Selenium::WebDriver.for(:chrome, capabilities: options)
53
+ # 'capabilities'과 'options' 배열로 설정
54
+ capabilities = Selenium::WebDriver::Remote::Capabilities.chrome
55
+ capabilities["goog:chromeOptions"] = options.as_json
56
+
57
+ # Selenium 4에서는 'capabilities'만 사용하는 방식
58
+ @driver = Selenium::WebDriver.for(:chrome, capabilities: [capabilities, options])
59
+
60
+ @driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: function(){ return false; }});") # 셀레니움 감지 방지
53
61
 
54
62
 
55
63
 
@@ -71,12 +79,14 @@ class Naver
71
79
  @driver.switch_to.window(first_window)
72
80
 
73
81
  rescue
74
- @driver = Selenium::WebDriver.for(:chrome, capabilities: options)
82
+ @driver = Selenium::WebDriver.for(:chrome, capabilities: [capabilities, options])
75
83
  end
76
84
  else
77
85
  begin
78
86
  Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
79
87
  options = Selenium::WebDriver::Chrome::Options.new
88
+ options.add_argument('--no-first-run') # 자동 실행 시 나타나는 "첫 실행" 화면 방지
89
+ options.add_argument('--disable-extensions') # 확장 프로그램 초기화 화면 방지
80
90
  options.add_argument('--headless') # 브라우저 UI 없이 실행
81
91
  options.add_argument('--disable-gpu') # GPU 가속을 비활성화 (헤드리스에서 필요할 수 있음)
82
92
  options.add_argument('--no-sandbox')
@@ -88,7 +98,15 @@ class Naver
88
98
  options.add_argument('--disable-notifications')
89
99
  options.add_argument('--remote-debugging-port=9222')
90
100
  options.add_argument('user-data-dir=C:/telegram_cookie/' + telegram_number)
91
- @driver = Selenium::WebDriver.for(:chrome, capabilities: options)
101
+ # 'capabilities'과 'options' 배열로 설정
102
+ capabilities = Selenium::WebDriver::Remote::Capabilities.chrome
103
+ capabilities["goog:chromeOptions"] = options.as_json
104
+
105
+ # Selenium 4에서는 'capabilities'만 사용하는 방식
106
+ @driver = Selenium::WebDriver.for(:chrome, capabilities: [capabilities, options])
107
+
108
+ @driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: function(){ return false; }});") # 셀레니움 감지 방지
109
+
92
110
  rescue => e
93
111
  puts e
94
112
  puts 'proxy error...'
@@ -99,15 +117,25 @@ class Naver
99
117
  options.timeouts = {page_load: 20_000}
100
118
  options.page_load_strategy = 'none'
101
119
  options.add_argument('--disable-notifications')
120
+ options.add_argument('--no-first-run') # 자동 실행 시 나타나는 "첫 실행" 화면 방지
121
+ options.add_argument('--disable-extensions') # 확장 프로그램 초기화 화면 방지
102
122
  options.add_argument('--headless') # 브라우저 UI 없이 실행
103
123
  options.add_argument('--disable-gpu') # GPU 가속을 비활성화 (헤드리스에서 필요할 수 있음)
104
124
  options.add_argument('--no-sandbox')
105
125
  options.add_argument('--disable-popup-blocking')
106
126
  options.add_argument('--remote-debugging-port=9222')
107
127
  options.add_argument('user-data-dir=C:/telegram_cookie/' + telegram_number)
108
- @driver = Selenium::WebDriver.for(:chrome, capabilities: options)
128
+ # 'capabilities'과 'options' 배열로 설정
129
+ capabilities = Selenium::WebDriver::Remote::Capabilities.chrome
130
+ capabilities["goog:chromeOptions"] = options.as_json
131
+
132
+ # Selenium 4에서는 'capabilities'만 사용하는 방식
133
+ @driver = Selenium::WebDriver.for(:chrome, capabilities: [capabilities, options])
134
+
135
+ @driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: function(){ return false; }});") # 셀레니움 감지 방지
136
+
109
137
  rescue
110
- @driver = Selenium::WebDriver.for(:chrome, capabilities: options)
138
+ @driver = Selenium::WebDriver.for(:chrome, capabilities: [capabilities, options])
111
139
  end
112
140
  end
113
141
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tg_send_duo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.39
4
+ version: 0.0.50
5
5
  platform: ruby
6
6
  authors:
7
7
  - zon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-01-24 00:00:00.000000000 Z
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