channel-worker 2.5.99 → 2.5.100
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
CHANGED
|
@@ -28,22 +28,17 @@ function parseViews(txt) {
|
|
|
28
28
|
return Math.round(num * mul);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
if (m && !['profile.php', 'reel', 'video', 'videos'].includes(m[1])) return `https://www.facebook.com/${m[1]}/?sk=reels_tab`;
|
|
43
|
-
}
|
|
44
|
-
return null;
|
|
45
|
-
}).catch(() => null);
|
|
46
|
-
}
|
|
31
|
+
// Tìm link tab Reels: DÙNG CHUNG với script đăng (upload_facebook), không giữ
|
|
32
|
+
// bản riêng nữa. Bản riêng cũ chỉ có 3 chiến lược (sk=reels_tab / profile.php
|
|
33
|
+
// / "Dòng thời gian") — trên TRANG CHỦ của Page hiện nay không có anchor nào
|
|
34
|
+
// như thế, chỉ có shortcut /<id số>/ hoặc /<handle>/reels/ (chiến lược 4-5,
|
|
35
|
+
// thêm ở script đăng 09/09). Đo 30h tới 10/09 15:15: 15/21 lượt bám bài hỏng
|
|
36
|
+
// là "không tìm được link tab Reels" — Góc Người Trồng Nấm 6 lượt, Chuyện Nhà
|
|
37
|
+
// Nông 3, Nông Trại Phục Linh 2… — trong khi CÙNG profile đó script đăng đêm
|
|
38
|
+
// 09/09 tìm được tab để so trước/sau. Bản riêng còn thiếu cả bộ lọc "anchor
|
|
39
|
+
// của bài trong bảng tin" (gốc 2 link page lạ sáng 10/09) nên có thể quét
|
|
40
|
+
// nhầm tab Reels của page KHÁC mà không hay.
|
|
41
|
+
const { discoverReelsTabUrl } = require('./upload_facebook').__testables;
|
|
47
42
|
|
|
48
43
|
// Số người theo dõi của page, đọc ngay trên chính trang đang đứng (header hiện
|
|
49
44
|
// ở mọi tab của page/profile) — không tốn thêm lượt mở profile nào. Ô
|
|
@@ -517,7 +512,7 @@ async function run({ page, payload, log }) {
|
|
|
517
512
|
if (!tabUrl) {
|
|
518
513
|
await page.goto(page_url || 'https://www.facebook.com/', { waitUntil: 'domcontentloaded', timeout: 45_000 });
|
|
519
514
|
await page.waitForTimeout(4000);
|
|
520
|
-
tabUrl = await
|
|
515
|
+
tabUrl = await discoverReelsTabUrl(page, log); // có log → in mẫu href khi không khớp
|
|
521
516
|
}
|
|
522
517
|
if (!tabUrl) throw new Error('không tìm được link tab Reels của page');
|
|
523
518
|
log('info', `[fb-stats] ${mode} · reels_tab: ${tabUrl.slice(0, 100)}`);
|
|
@@ -565,4 +560,4 @@ async function run({ page, payload, log }) {
|
|
|
565
560
|
return { ok: true, mode, tiles: tiles.length, written: d?.written || 0, matched: d?.matched || 0, rising: d?.rising || 0, alerts: d?.alerts || 0, followers };
|
|
566
561
|
}
|
|
567
562
|
|
|
568
|
-
module.exports = { run, __testables: { parseViews, scrapeFollowers, parseExact, parseVnPostTime, runInsights, dumpInsightsFailure } };
|
|
563
|
+
module.exports = { run, __testables: { parseViews, scrapeFollowers, parseExact, parseVnPostTime, runInsights, dumpInsightsFailure, discoverReelsTabUrl } };
|