tg_send_zon 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.
- checksums.yaml +4 -4
- data/lib/tg_send_zon.rb +34 -6
- 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: 5087f9aed9d32f72f30e715e4f4fadca4457222d6be43b2ed292884e32c1686a
|
4
|
+
data.tar.gz: c3b14b765251f336a2e6db8022171e87b0841d1c04bf290c1fceca7aa7466e79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 571a4d49d63af1d7cff92c45f6c139e63dd891233ade948b38dc2be0b80c98a7a7cbf1cb6cb723a1bb2505990446cf2c32e305356f5e6b2d7cd1aa5de88c8cd1
|
7
|
+
data.tar.gz: '0395c930ab4ae5710ba595081b6d4f24143442190595cdfb78a348f8cc8c9a8eca9e542acb91dea1a74b242cf6e6c4e085846db1e6e1fbce46d227a515e8ade7'
|
data/lib/tg_send_zon.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
|
-
|
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
|
-
|
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
|
-
|
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_zon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
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-
|
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
|