tt-help-cli-ycl 1.4.168 → 1.4.169

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tt-help-cli-ycl",
3
- "version": "1.4.168",
3
+ "version": "1.4.169",
4
4
  "description": "TikTok user & video data scraper - extract ttSeller, verified, locationCreated from HTML source",
5
5
  "type": "module",
6
6
  "bin": {
@@ -893,11 +893,32 @@ async function rollbackConfig(content, { index = 1, apiPort, secret } = {}) {
893
893
  } catch {}
894
894
  }
895
895
 
896
- /** 等待并校验 provider 上线(热应用/接管共用) */
896
+ /**
897
+ * 强制刷新 provider(绕过 interval 缓存),让新订阅立即生效。
898
+ * 热加载/接管不会触发 provider 重新拉取:URL 已变但同名缓存未过期(interval 1h 内)时,
899
+ * 内核沿用旧订阅节点,节点数校验会把旧缓存误判为新订阅上线
900
+ * (2026-01-11 生产实锤:i3 换订阅后报应用成功,实际最长 1h 仍是旧机场节点)。
901
+ * 尽力而为:单条失败不报错(机场 URL 暂时不可达等),由后续节点数校验兜底。
902
+ */
903
+ async function refreshProviders(subs, { apiPort, secret }) {
904
+ const headers = {};
905
+ if (secret) headers.Authorization = `Bearer ${secret}`;
906
+ await Promise.all(
907
+ subs.map((s) =>
908
+ fetch(
909
+ `http://127.0.0.1:${apiPort}/providers/proxies/${encodeURIComponent(s.name)}`,
910
+ { method: "PUT", headers, signal: AbortSignal.timeout(20_000) },
911
+ ).catch(() => {}),
912
+ ),
913
+ );
914
+ }
915
+
916
+ /** 等待并校验 provider 上线(热应用/接管共用):先强刷 provider 再校验,确保校验的是新订阅 */
897
917
  export async function verifyProviders(
898
918
  subs,
899
919
  { apiPort = DISCOVER_DEFAULTS.port, secret = DISCOVER_DEFAULTS.secret, log = () => {}, waitMs = 3000 } = {},
900
920
  ) {
921
+ await refreshProviders(subs, { apiPort, secret });
901
922
  await delay(waitMs);
902
923
  try {
903
924
  const headers = {};