posting_duo 0.0.13 → 0.0.17

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/posting_duo.rb +73 -82
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0e9aac868e76854f511676f7baf7b12e515b0d0a827568cefe70ddeca76db1ee
4
- data.tar.gz: 372415f9f141c6cecd74ce005aa93dbce43b837d2704781fc488a63ff100a464
3
+ metadata.gz: 9b9e411e548464a850454e02440fccb5a2d7f67b866bffbbdc46a1ac3f20f9bc
4
+ data.tar.gz: 5ba9da662720c4d9da54cab9d4220943777f5971aa0b89fa5721aea9cddbe14c
5
5
  SHA512:
6
- metadata.gz: d4a438e1d87a1f39c77e13965ba5e99e332860c1be946c9b48d24733a5f73e29dd77f6e6c309b009077caeb238a0db60f849b417370e2f4dbe93448281ebb339
7
- data.tar.gz: b2a63d4e39a6d8dc20e6676147e3456ea7b4cd7c67f307ec67913a4e6b7843396abfd4f7b28a00035a97145651ba7dcbe0a6675a3e6afa9b3d2a4d16bc1b8398
6
+ metadata.gz: '09c2b6285ddc744a9292fd48e5dd60af83828d643e4874d671872bda19018bdf1729958b9a73c77880fd58187282688c6069bbb1c2dc014a5583fe3b31149f93'
7
+ data.tar.gz: ce594d9bf2ca3890e9a6dae713ac39528e400e05d57e59692a5d8e77e5182e07939b08d98c727e03a1eab1af204189aafe42b5790b5610356d2a3c9aa9108ac6
data/lib/posting_duo.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'glimmer-dsl-libui'
2
2
  require 'selenium-webdriver'
3
- # require 'webdrivers'
3
+ require 'webdrivers'
4
4
  require 'iconv'
5
5
  require 'nokogiri'
6
6
  require 'open-uri'
@@ -34,122 +34,108 @@ class Naver
34
34
  def chrome_start(proxy)
35
35
  if proxy == ''
36
36
  begin
37
- Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
37
+ #Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
38
+
38
39
  options = Selenium::WebDriver::Chrome::Options.new #(options: {"excludeSwitches" => ["enable-automation"]}) #자동화된 테스트...제거(options: {"excludeSwitches" => ["enable-automation"]})
39
40
  options.add_extension('./crx/free.crx')
40
41
  options.add_extension('./crx/app.crx')
41
- options.page_load_strategy = :normal
42
- options.timeouts = {page_load: 20_000}
42
+
43
43
  options.add_argument('--start-maximized')
44
44
  options.add_argument('user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.6723.59 Safari/537.36') # user-agent 위조
45
+ options.add_argument('--disable-blink-features=AutomationControlled') #자동화된 환경에서 실행되는 것을 감지하는 기능을 비활성화합니다.
46
+ options.add_argument('--ignore-certificate-errors') #SSL 인증서 오류를 무시하도록 설정합니다
47
+ options.add_argument('--disable-web-security') #웹 보안을 비활성화합니다
48
+ options.add_argument('--allow-running-insecure-content') #HTTPS 사이트에서 HTTP 컨텐츠를 실행할 수 있도록 허용합니다.
49
+ options.add_argument('--no-sandbox') #Chrome에서 샌드박스 모드를 비활성화합니다.
50
+
51
+ # 자동화된 테스트 제거
52
+ options.exclude_switches = ['enable-automation']
53
+
54
+ options.add_preference("profile.password_manager_enabled", false) # 비밀번호 관리자 비활성화
55
+ options.add_preference("credentials_enable_service", false) # 비밀번호 저장 기능 비활성화
56
+ #options.add_preference("profile.managed_default_content_settings.cookies", 2) # 쿠키 관련 팝업 차단
57
+ options.add_preference("profile.default_content_setting_values.notifications", 2) # 알림 차단
58
+ options.add_argument("--disable-save-password-bubble") # 비밀번호 저장 팝업 차단
45
59
  # `capabilities` 사용
46
60
  capabilities = [options]
47
61
 
48
62
  # 드라이버 초기화 (capabilities 사용)
49
63
  @driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
50
- #options.add_argument('--disable-blink-features=AutomationControlled')
51
- #options.add_argument('--disable-popup-blocking')
52
- #options.add_argument('--dns-prefetch-disable')
53
- #options.add_argument('--disable-dev-shm-usage')
54
- #options.add_argument('--disable-software-rasterizer')
55
- #options.add_argument('--ignore-certificate-errors')
56
- #options.add_argument('--disable-gpu') # GPU가속 끄기
57
- #options.excludeSwitches('--enable-automation') #자동화된 테스트...제거
58
- #options.add_argument('--disable-web-security')
59
- #options.add_argument('--allow-running-insecure-content')
60
- #options.add_argument('--ignore-certificate-errors')
61
- #options.add_argument('--allow-insecure-localhost')
62
- #options.add_argument('--no-sandbox')
63
- #options.add_argument('--disable-translate')
64
- #options.add_argument('--disable-extensions-file-access-check')
65
- #options.add_argument('--disable-impl-side-painting')
66
- #@driver = Selenium::WebDriver.for(:chrome, capabilities: options)
64
+
67
65
  rescue
68
- #@driver = Selenium::WebDriver.for(:chrome, capabilities: options)
69
- # `capabilities` 사용
70
- capabilities = [options]
66
+ # `capabilities` 사용
67
+ capabilities = [options]
71
68
 
72
- # 드라이버 초기화 (capabilities 사용)
73
- @driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
69
+ # 드라이버 초기화 (capabilities 사용)
70
+ @driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
74
71
  end
75
72
  else
76
73
  begin
77
74
  puts '프록시 연결합니다.......'.magenta
78
75
  puts '프록시 연결시 프록시 서버에 의해 인터넷속도가 낮아질수있어.......'.magenta
79
76
  puts '원활한 작업이 되지않을수있습니다.......'.magenta
80
- Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
77
+ #Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
81
78
  options = Selenium::WebDriver::Chrome::Options.new
82
79
  options.add_argument '--proxy-server='+proxy.to_s.force_encoding('utf-8').to_s
83
80
  options.add_extension('./crx/free.crx')
84
81
  options.add_extension('./crx/app.crx')
85
- options.page_load_strategy = :normal
86
- options.timeouts = {page_load: 20_000}
82
+
87
83
  options.add_argument('--start-maximized')
88
84
  options.add_argument('user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.6723.59 Safari/537.36') # user-agent 위조
89
-
90
- #options.add_argument('--disable-blink-features=AutomationControlled')
91
- #options.add_argument('--disable-popup-blocking')
92
- #options.add_argument('--dns-prefetch-disable')
93
- #options.add_argument('--disable-dev-shm-usage')
94
- #options.add_argument('--disable-software-rasterizer')
95
- #options.add_argument('--ignore-certificate-errors')
96
- #options.add_argument('--disable-gpu') # GPU가속 끄기
97
- #options.excludeSwitches('enable-automation') #자동화된 테스트...제거
98
- #options.add_argument('--disable-web-security')
99
- #options.add_argument('--allow-running-insecure-content')
100
- #options.add_argument('--ignore-certificate-errors')
101
- #options.add_argument('--allow-insecure-localhost')
102
- #options.add_argument('--no-sandbox')
103
- #options.add_argument('--disable-translate')
104
- #options.add_argument('--disable-extensions-file-access-check')
105
- #options.add_argument('--disable-impl-side-painting')
106
- #@driver = Selenium::WebDriver.for(:chrome, capabilities: options)
107
- # `capabilities` 사용
108
- capabilities = [options]
109
-
110
- # 드라이버 초기화 (capabilities 사용)
111
- @driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
85
+ options.add_argument('--disable-blink-features=AutomationControlled') #자동화된 환경에서 실행되는 것을 감지하는 기능을 비활성화합니다.
86
+ options.add_argument('--ignore-certificate-errors') #SSL 인증서 오류를 무시하도록 설정합니다
87
+ options.add_argument('--disable-web-security') #웹 보안을 비활성화합니다
88
+ options.add_argument('--allow-running-insecure-content') #HTTPS 사이트에서 HTTP 컨텐츠를 실행할 수 있도록 허용합니다.
89
+ options.add_argument('--no-sandbox') #Chrome에서 샌드박스 모드를 비활성화합니다.
90
+
91
+ # 자동화된 테스트 제거
92
+ options.exclude_switches = ['enable-automation']
93
+
94
+ options.add_preference("profile.password_manager_enabled", false) # 비밀번호 관리자 비활성화
95
+ options.add_preference("credentials_enable_service", false) # 비밀번호 저장 기능 비활성화
96
+ #options.add_preference("profile.managed_default_content_settings.cookies", 2) # 쿠키 관련 팝업 차단
97
+ options.add_preference("profile.default_content_setting_values.notifications", 2) # 알림 차단
98
+ options.add_argument("--disable-save-password-bubble") # 비밀번호 저장 팝업 차단
99
+ # `capabilities` 사용
100
+ capabilities = [options]
101
+
102
+ # 드라이버 초기화 (capabilities 사용)
103
+ @driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
112
104
  rescue => e
113
105
  puts e
114
106
  puts 'proxy error...'
115
107
  begin
116
- Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
108
+ #Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
117
109
  options.add_extension('./crx/free.crx')
118
110
  options.add_extension('./crx/app.crx')
119
- options.page_load_strategy = :normal
120
- options.timeouts = {page_load: 20_000}
111
+
121
112
  options.add_argument('--start-maximized')
122
113
  options.add_argument('user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.6723.59 Safari/537.36') # user-agent 위조
123
-
124
- #options.add_argument('--disable-blink-features=AutomationControlled')
125
- #options.add_argument('--disable-popup-blocking')
126
- #options.add_argument('--dns-prefetch-disable')
127
- #options.add_argument('--disable-dev-shm-usage')
128
- #options.add_argument('--disable-software-rasterizer')
129
- #options.add_argument('--ignore-certificate-errors')
130
- #options.add_argument('--disable-gpu') # GPU가속 끄기
131
- #options.excludeSwitches('enable-automation') #자동화된 테스트...제거
132
- #options.add_argument('--disable-web-security')
133
- #options.add_argument('--allow-running-insecure-content')
134
- #options.add_argument('--ignore-certificate-errors')
135
- #options.add_argument('--allow-insecure-localhost')
136
- #options.add_argument('--no-sandbox')
137
- #options.add_argument('--disable-translate')
138
- #options.add_argument('--disable-extensions-file-access-check')
139
- #options.add_argument('--disable-impl-side-painting')
140
- #@driver = Selenium::WebDriver.for(:chrome, capabilities: options)
141
- # `capabilities` 사용
114
+ options.add_argument('--disable-blink-features=AutomationControlled') #자동화된 환경에서 실행되는 것을 감지하는 기능을 비활성화합니다.
115
+ options.add_argument('--ignore-certificate-errors') #SSL 인증서 오류를 무시하도록 설정합니다
116
+ options.add_argument('--disable-web-security') #웹 보안을 비활성화합니다
117
+ options.add_argument('--allow-running-insecure-content') #HTTPS 사이트에서 HTTP 컨텐츠를 실행할 수 있도록 허용합니다.
118
+ options.add_argument('--no-sandbox') #Chrome에서 샌드박스 모드를 비활성화합니다.
119
+
120
+ # 자동화된 테스트 제거
121
+ options.exclude_switches = ['enable-automation']
122
+
123
+ options.add_preference("profile.password_manager_enabled", false) # 비밀번호 관리자 비활성화
124
+ options.add_preference("credentials_enable_service", false) # 비밀번호 저장 기능 비활성화
125
+ #options.add_preference("profile.managed_default_content_settings.cookies", 2) # 쿠키 관련 팝업 차단
126
+ options.add_preference("profile.default_content_setting_values.notifications", 2) # 알림 차단
127
+ options.add_argument("--disable-save-password-bubble") # 비밀번호 저장 팝업 차단
128
+ # `capabilities` 사용
142
129
  capabilities = [options]
143
130
 
144
131
  # 드라이버 초기화 (capabilities 사용)
145
132
  @driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
146
133
  rescue
147
- #@driver = Selenium::WebDriver.for(:chrome, capabilities: options)
148
- # `capabilities` 사용
149
- capabilities = [options]
134
+ # `capabilities` 사용
135
+ capabilities = [options]
150
136
 
151
- # 드라이버 초기화 (capabilities 사용)
152
- @driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
137
+ # 드라이버 초기화 (capabilities 사용)
138
+ @driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
153
139
  end
154
140
  end
155
141
  end
@@ -8733,10 +8719,15 @@ class Wordpress
8733
8719
 
8734
8720
  @captcha_key = captcha_key
8735
8721
  begin
8736
- Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
8737
- @driver = Selenium::WebDriver.for :chrome
8722
+ capabilities = [options]
8723
+
8724
+ # 드라이버 초기화 (capabilities 사용)
8725
+ @driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
8738
8726
  rescue
8739
- @driver = Selenium::WebDriver.for :chrome
8727
+ capabilities = [options]
8728
+
8729
+ # 드라이버 초기화 (capabilities 사용)
8730
+ @driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
8740
8731
  end
8741
8732
  end
8742
8733
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: posting_duo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - zon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-03 00:00:00.000000000 Z
11
+ date: 2025-01-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: File to Clipboard gem
14
14
  email: mymin26@naver.com