cafe_buy_duo 0.0.27 → 0.0.30
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/cafe_buy_duo.rb +99 -28
- 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: d37517fd508c49bd33668a0ce813633977d3be6467d770e238494d9b5670d994
|
4
|
+
data.tar.gz: b5763248e31abd6a057f3ce2cc97e0b5750acce7de4becab049b74afe98f9cf8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '049715bb5670839a4ce25dad8f2502e64db4647115389dec4f1c990ee56ce5ccaa5a864816c603d7982c31189aa88e91259c2a31dfc39438fc884cc9e4e10419'
|
7
|
+
data.tar.gz: a1ba60b598f197f890f4f4aecb4393bb2668843dcd233304224d90752bce553d8fde295d8dd925faaaead83a26737f3c58262d98c4491c6329cb11be6040a9c0
|
data/lib/cafe_buy_duo.rb
CHANGED
@@ -1049,10 +1049,18 @@ end
|
|
1049
1049
|
if i2.to_s.include?('<img')
|
1050
1050
|
path = i2.to_s.split('src="')[1].split('"')[0]
|
1051
1051
|
path = URI.decode_www_form(path)[0][0]
|
1052
|
+
|
1053
|
+
@driver.execute_script(<<~JS)
|
1054
|
+
window.URL.createObjectURL = function() {};
|
1055
|
+
HTMLInputElement.prototype.click = function() {
|
1056
|
+
console.log("File dialog suppressed");
|
1057
|
+
};
|
1058
|
+
JS
|
1059
|
+
sleep(1)
|
1052
1060
|
# 이미지 등록 버튼 클릭
|
1053
1061
|
@driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[1]/ul/li[1]/button').click
|
1054
1062
|
sleep(3)
|
1055
|
-
key_stroke('escape')
|
1063
|
+
#key_stroke('escape')
|
1056
1064
|
|
1057
1065
|
# 파일 경로 변환 (슬래시 -> 백슬래시)
|
1058
1066
|
file_path = path.split('/').join("\\") # 윈도우 스타일 경로로 변환
|
@@ -1063,9 +1071,43 @@ end
|
|
1063
1071
|
# send_keys로 파일 경로를 직접 입력하여 파일 업로드
|
1064
1072
|
file_input.send_keys(file_path)
|
1065
1073
|
sleep(3)
|
1066
|
-
|
1067
1074
|
|
1068
|
-
|
1075
|
+
@driver.action.key_down(:up).key_up(:up).perform
|
1076
|
+
sleep(1)
|
1077
|
+
|
1078
|
+
begin
|
1079
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 3)
|
1080
|
+
#요소가 나타날 때까지 60초 동안 기다립니다.
|
1081
|
+
wait.until { @driver.find_element(:xpath, '//li[@class="se-toolbar-item se-toolbar-item-resizing"]//button[@data-name="image-resizing"]') }
|
1082
|
+
sleep(1)
|
1083
|
+
@driver.find_element(:xpath, '//li[@class="se-toolbar-item se-toolbar-item-resizing"]//button[@data-name="image-resizing"]').click
|
1084
|
+
|
1085
|
+
sleep(1)
|
1086
|
+
begin
|
1087
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 3)
|
1088
|
+
#요소가 나타날 때까지 60초 동안 기다립니다.
|
1089
|
+
wait.until { @driver.find_element(:xpath, '//li[@class="se-toolbar-item se-toolbar-item-resizing"]//div[@class="se-custom-layer-option se-custom-layer-option-resizing"]//div[@class="se-custom-layer-resizing-option-group"]//button[@class="se-custom-layer-resizing-reset-button"]') }
|
1090
|
+
sleep(1)
|
1091
|
+
@driver.find_element(:xpath, '//li[@class="se-toolbar-item se-toolbar-item-resizing"]//div[@class="se-custom-layer-option se-custom-layer-option-resizing"]//div[@class="se-custom-layer-resizing-option-group"]//button[@class="se-custom-layer-resizing-reset-button"]').click
|
1092
|
+
sleep(1)
|
1093
|
+
@driver.action.key_down(:enter).key_up(:enter).perform #엔터
|
1094
|
+
sleep(1)
|
1095
|
+
rescue
|
1096
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 3)
|
1097
|
+
#요소가 나타날 때까지 60초 동안 기다립니다.
|
1098
|
+
wait.until { @driver.find_element(:xpath, '//li[@class="se-toolbar-item se-toolbar-item-resizing"]//div[@class="se-custom-layer-option se-custom-layer-option-resizing"]//div[@class="se-custom-layer-resizing-option-group"]//button[@class="se-custom-layer-resizing-reset-button"]//span[@class="se-custom-layer-resizing-reset-label" and text()="초기화"]') }
|
1099
|
+
sleep(1)
|
1100
|
+
@driver.find_element(:xpath, '//li[@class="se-toolbar-item se-toolbar-item-resizing"]//div[@class="se-custom-layer-option se-custom-layer-option-resizing"]//div[@class="se-custom-layer-resizing-option-group"]//button[@class="se-custom-layer-resizing-reset-button"]//span[@class="se-custom-layer-resizing-reset-label" and text()="초기화"]').click
|
1101
|
+
sleep(1)
|
1102
|
+
@driver.action.key_down(:enter).key_up(:enter).perform #엔터
|
1103
|
+
sleep(1)
|
1104
|
+
end
|
1105
|
+
rescue
|
1106
|
+
@driver.action.key_down(:down).key_up(:down).perform
|
1107
|
+
|
1108
|
+
end
|
1109
|
+
|
1110
|
+
|
1069
1111
|
if option['사진타이틀'] == 'true'
|
1070
1112
|
begin
|
1071
1113
|
@driver.action.key_down(:up).key_up(:up).perform
|
@@ -1082,7 +1124,7 @@ end
|
|
1082
1124
|
rescue
|
1083
1125
|
@driver.action.key_down(:down).key_up(:down).perform
|
1084
1126
|
end
|
1085
|
-
end
|
1127
|
+
end
|
1086
1128
|
|
1087
1129
|
|
1088
1130
|
if i2.to_s.split('href="')[1] != nil
|
@@ -1103,38 +1145,67 @@ end
|
|
1103
1145
|
elsif i2.to_s.include?('<video')
|
1104
1146
|
path = i2.to_s.split('src="')[1].split('"')[0]
|
1105
1147
|
path = URI.decode_www_form(path)[0][0]
|
1106
|
-
|
1148
|
+
|
1107
1149
|
@driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[1]/ul/li[3]/button').click
|
1108
1150
|
sleep(3)
|
1151
|
+
|
1152
|
+
|
1153
|
+
@driver.execute_script(<<~JS)
|
1154
|
+
window.URL.createObjectURL = function() {};
|
1155
|
+
HTMLInputElement.prototype.click = function() {
|
1156
|
+
console.log("File dialog suppressed");
|
1157
|
+
};
|
1158
|
+
JS
|
1159
|
+
sleep(1)
|
1160
|
+
# 파일 업로드 버튼 클릭 (이제 파일 선택 창이 뜨지 않음)
|
1109
1161
|
@driver.find_element(:xpath, '//*[@id="video-uploader-wrap"]/div/div/div[2]/fieldset/div[1]/button[1]').click
|
1110
1162
|
sleep(3)
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1163
|
+
|
1164
|
+
file_path = path.split('/').join("\\") # 윈도우 스타일 경로로 변환
|
1165
|
+
# 파일 입력 필드 찾기 (input[type="file"])
|
1166
|
+
file_input = @driver.find_element(:id, "hidden-input")
|
1167
|
+
|
1168
|
+
# send_keys로 파일 경로를 직접 입력하여 파일 업로드
|
1169
|
+
file_input.send_keys(file_path)
|
1170
|
+
|
1116
1171
|
sleep(3)
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1172
|
+
begin
|
1173
|
+
@driver.find_element(:xpath, '//*[@id="nvu_inp_box_title"]').send_keys(title)
|
1174
|
+
sleep(1)
|
1175
|
+
rescue
|
1176
|
+
end
|
1177
|
+
|
1178
|
+
begin
|
1179
|
+
@driver.find_element(:xpath, '//*[@id="nvu_inp_box_description"]').send_keys(title)
|
1180
|
+
sleep(1)
|
1181
|
+
rescue
|
1182
|
+
end
|
1183
|
+
|
1184
|
+
begin
|
1124
1185
|
@driver.find_element(:xpath, '//*[@id="nvu_inp_box_tag"]').send_keys(title)
|
1125
|
-
|
1186
|
+
sleep(1)
|
1187
|
+
rescue
|
1188
|
+
end
|
1126
1189
|
|
1127
1190
|
for n in 1..10
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1191
|
+
begin
|
1192
|
+
puts @driver.find_element(:xpath, '//*[@id="video-uploader-wrap"]/div/div/div[2]/div[1]/ul/li/div/button[1]/div[2]/em').text
|
1193
|
+
if @driver.find_element(:xpath, '//*[@id="video-uploader-wrap"]/div/div/div[2]/div[1]/ul/li/div/button[1]/div[2]/em').text == '업로드 완료'
|
1194
|
+
break
|
1195
|
+
end
|
1196
|
+
sleep(10)
|
1197
|
+
rescue
|
1198
|
+
end
|
1133
1199
|
end
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1200
|
+
|
1201
|
+
begin
|
1202
|
+
@driver.find_element(:xpath, '//*[@id="video-uploader-wrap"]/div/div/div[3]/button/span').click
|
1203
|
+
sleep(3)
|
1204
|
+
@driver.action.key_down(:up).key_up(:up).perform #x탭
|
1205
|
+
sleep(1)
|
1206
|
+
rescue
|
1207
|
+
end
|
1208
|
+
|
1138
1209
|
begin
|
1139
1210
|
wait = Selenium::WebDriver::Wait.new(:timeout => 3)
|
1140
1211
|
#요소가 나타날 때까지 60초 동안 기다립니다.
|
@@ -1149,7 +1220,7 @@ end
|
|
1149
1220
|
rescue
|
1150
1221
|
@driver.action.key_down(:down).key_up(:down).perform
|
1151
1222
|
end
|
1152
|
-
|
1223
|
+
|
1153
1224
|
elsif i2.to_s.include?('<inyonggoo')
|
1154
1225
|
if i2.text == ''
|
1155
1226
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cafe_buy_duo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.30
|
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-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: File to Clipboard gem
|
14
14
|
email: mymin26@naver.com
|