sns-auto-builder 1.0.6 → 1.0.7
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.
- package/package.json +1 -1
- package/scripts/chatgpt-image-gen.js +14 -5
package/package.json
CHANGED
|
@@ -161,13 +161,22 @@ async function waitForComposer(page) {
|
|
|
161
161
|
// 조용히 틀리느니 시끄럽게 멈추는 게 낫다.
|
|
162
162
|
async function attachRef(page, refPaths) {
|
|
163
163
|
const want = refPaths.length;
|
|
164
|
-
//
|
|
164
|
+
// 화면에 input[type=file] 이 네 개쯤 있다. **accept 로 고른다.**
|
|
165
|
+
//
|
|
166
|
+
// 예전에는 "form 안에 있는 것"을 골랐는데, ChatGPT 가 이미지 업로드 input 을
|
|
167
|
+
// form 밖으로 옮기면서 form 안에는 accept 없는 다른 input 만 남았다. 거기에
|
|
168
|
+
// 파일을 넣으면 아무 일도 안 일어나고, 썸네일을 2분 기다리다 실패한다
|
|
169
|
+
// (증상: "크롬은 떴는데 프롬프트를 입력하지 않는다").
|
|
165
170
|
const pickInput = async () => {
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
|
|
171
|
+
for (const sel of [
|
|
172
|
+
'input[type="file"][data-testid="upload-photos-input"]', // 현재 ChatGPT
|
|
173
|
+
'input[type="file"][accept*="image"]', // testid 가 바뀌어도 살아남는 조건
|
|
174
|
+
'input[type="file"]',
|
|
175
|
+
]) {
|
|
176
|
+
const h = await page.$(sel);
|
|
177
|
+
if (h) return h;
|
|
169
178
|
}
|
|
170
|
-
return
|
|
179
|
+
return null;
|
|
171
180
|
};
|
|
172
181
|
|
|
173
182
|
for (let attempt = 1; attempt <= 2; attempt++) {
|