channel-worker 2.5.20 → 2.5.21
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/upload_facebook.js +25 -2
package/package.json
CHANGED
|
@@ -283,7 +283,7 @@ async function run({ page, payload, log }) {
|
|
|
283
283
|
} = payload || {};
|
|
284
284
|
if (!video_url) throw new Error('No video_url provided');
|
|
285
285
|
|
|
286
|
-
log('info', '[fb-pw] selectors version=2026.06.
|
|
286
|
+
log('info', '[fb-pw] selectors version=2026.06.19b-thumb-diag');
|
|
287
287
|
|
|
288
288
|
page.on('dialog', (d) => { d.accept().catch(() => {}); });
|
|
289
289
|
|
|
@@ -968,7 +968,9 @@ async function run({ page, payload, log }) {
|
|
|
968
968
|
const dlgs = [];
|
|
969
969
|
for (const d of allDlgs) {
|
|
970
970
|
const txt = (d.innerText || '').slice(0, 400);
|
|
971
|
-
|
|
971
|
+
// Match ALL reel-composer steps: "Tạo thước phim" (video step),
|
|
972
|
+
// the caption/cover step, and "Cài đặt thước phim" (settings step).
|
|
973
|
+
if (/thước phim|create reel|create a reel|reel settings/i.test(txt)) dlgs.push(d);
|
|
972
974
|
}
|
|
973
975
|
if (dlgs.length === 0) return null;
|
|
974
976
|
for (const dlg of dlgs) {
|
|
@@ -1165,6 +1167,27 @@ async function run({ page, payload, log }) {
|
|
|
1165
1167
|
// applied across ANY step, so nothing ships with FB's auto-thumb and a
|
|
1166
1168
|
// retry can't double-post.
|
|
1167
1169
|
if (!customThumbDone) {
|
|
1170
|
+
// DIAG: dump the reel-dialog buttons on this step so we can locate the
|
|
1171
|
+
// cover/thumbnail control when detection misses it (different UI variant).
|
|
1172
|
+
try {
|
|
1173
|
+
const diag = await page.evaluate(() => {
|
|
1174
|
+
const dlgs = [...document.querySelectorAll("[role='dialog']")]
|
|
1175
|
+
.filter(d => /thước phim|create reel|reel settings/i.test((d.innerText || '').slice(0, 400)));
|
|
1176
|
+
const out = [];
|
|
1177
|
+
for (const d of dlgs) {
|
|
1178
|
+
const hdr = (d.innerText || '').split('\n')[0].slice(0, 40);
|
|
1179
|
+
for (const el of d.querySelectorAll("[role='button'],button,[aria-label],img")) {
|
|
1180
|
+
const t = (el.innerText || '').trim().slice(0, 28);
|
|
1181
|
+
const al = (el.getAttribute('aria-label') || '').trim().slice(0, 40);
|
|
1182
|
+
const r = el.getBoundingClientRect();
|
|
1183
|
+
if (r.width < 10 || r.height < 10) continue;
|
|
1184
|
+
if (t || al) out.push(`[${hdr}] <${el.tagName.toLowerCase()}> t="${t}" al="${al}" ${Math.round(r.width)}x${Math.round(r.height)}`);
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
return out.slice(0, 45);
|
|
1188
|
+
}).catch(() => []);
|
|
1189
|
+
log('info', `[fb-pw] thumb-diag step ${step + 1}: ${JSON.stringify(diag)}`);
|
|
1190
|
+
} catch { /* diag best-effort */ }
|
|
1168
1191
|
log('info', '[fb-pw] thumb-edit pill not on this step yet — advancing via "Tiếp" to retry on the next step');
|
|
1169
1192
|
}
|
|
1170
1193
|
}
|