channel-worker 2.5.16 → 2.5.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.
- package/package.json +1 -1
- package/scripts/upload_facebook.js +15 -3
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.18a-fb-caption');
|
|
287
287
|
|
|
288
288
|
page.on('dialog', (d) => { d.accept().catch(() => {}); });
|
|
289
289
|
|
|
@@ -525,7 +525,19 @@ async function run({ page, payload, log }) {
|
|
|
525
525
|
// (some FB builds only show them on the final Chia sẻ step). The
|
|
526
526
|
// helper is idempotent: it tracks per-field "done" so we don't
|
|
527
527
|
// re-fill on subsequent steps.
|
|
528
|
-
|
|
528
|
+
// FB Reels page-wall composer has ONLY one caption field ("Mô tả thước
|
|
529
|
+
// phim") — no separate Title or Tags input (those were BS-composer fields,
|
|
530
|
+
// now gone). Per product decision the reel caption = title + hashtags
|
|
531
|
+
// (the description is dropped). Hashtags are collapsed to single #tokens
|
|
532
|
+
// since FB caption hashtags can't contain spaces ("gia dung" → "#giadung").
|
|
533
|
+
const fbHashtags = (tags || [])
|
|
534
|
+
.map(t => '#' + String(t || '').trim().replace(/[#\s]+/g, ''))
|
|
535
|
+
.filter(h => h.length > 1);
|
|
536
|
+
const fbCaption = [String(title || '').trim(), fbHashtags.join(' ')]
|
|
537
|
+
.filter(Boolean).join('\n\n');
|
|
538
|
+
// Pre-mark title+tags "done" so the legacy BS title/tags probes are skipped;
|
|
539
|
+
// only the description field is filled — with fbCaption (title + hashtags).
|
|
540
|
+
const fillState = { title: true, description: false, tags: true };
|
|
529
541
|
const fillMetadata = async () => {
|
|
530
542
|
// Title (Tiêu đề thước phim). Variant-A input is shown by default in the
|
|
531
543
|
// BS composer — NO reveal click needed. Earlier `revealCandidates` clicks
|
|
@@ -677,7 +689,7 @@ async function run({ page, payload, log }) {
|
|
|
677
689
|
if (!f) continue;
|
|
678
690
|
try {
|
|
679
691
|
await f.click({ timeout: 3000 });
|
|
680
|
-
const descText = (description || title || '').toString().slice(0, 2100);
|
|
692
|
+
const descText = (fbCaption || description || title || '').toString().slice(0, 2100);
|
|
681
693
|
if (!descText) break;
|
|
682
694
|
await f.type(descText, { delay: 12 });
|
|
683
695
|
fillState.description = true;
|