hyperframes 0.9.47 → 0.9.49
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/dist/{add-QNGZD4DD.js → add-PALFYN7F.js} +5 -5
- package/dist/{agentPromptGenerator-62YBRRWR.js → agentPromptGenerator-W7YECUWC.js} +3 -2
- package/dist/{animatedGifPrep-MOMPPYA2.js → animatedGifPrep-RGTZSKE4.js} +3 -2
- package/dist/api.js +20 -19
- package/dist/{asset-UCSTQD4V.js → asset-JI35ENTB.js} +2 -2
- package/dist/{assetCataloger-CB55JIVV.js → assetCataloger-A3T63E76.js} +5 -4
- package/dist/{audio-L6RHV5YR.js → audio-PWT3Y4ER.js} +8 -7
- package/dist/{auth-26I37JOQ.js → auth-HVB4YRTT.js} +2 -2
- package/dist/{autoUpdate-IKM2WKSQ.js → autoUpdate-6DLBJZZW.js} +2 -2
- package/dist/{avatars-PZPL5EG2.js → avatars-VKB5R2JP.js} +7 -6
- package/dist/{backgroundChecks-GISZGTXC.js → backgroundChecks-XCMKJT4Z.js} +3 -3
- package/dist/backgroundChecksWorker.js +3 -3
- package/dist/{beats-EKU5XXBV.js → beats-C2HOZUAS.js} +4 -4
- package/dist/{benchmark-TPGYG6JW.js → benchmark-TWKPWI27.js} +6 -6
- package/dist/{billing-PECZH526.js → billing-74IFJYAX.js} +4 -4
- package/dist/{browser-W26LDR2J.js → browser-GG3NMOT2.js} +3 -3
- package/dist/{bundleWithLocalizedFonts-OI3E22MQ.js → bundleWithLocalizedFonts-HBFTQBPU.js} +1 -1
- package/dist/{capture-QHWQ2PB2.js → capture-S76Z24SZ.js} +81 -262
- package/dist/{capture-OPWIRIZC.js → capture-ZGZPBEA3.js} +4 -4
- package/dist/{captureCompositionFrame-EYB6LTAG.js → captureCompositionFrame-GX7OQSDA.js} +6 -5
- package/dist/{catalog-D6PL6DN3.js → catalog-U5IHPRJZ.js} +5 -5
- package/dist/{catch-up-SKLAQOCM.js → catch-up-XCQZZDVD.js} +4 -4
- package/dist/{check-QHDE55TC.js → check-ZEG6CTIC.js} +21 -20
- package/dist/{checkAudio-EENVIQJA.js → checkAudio-SAEK5LIU.js} +5 -4
- package/dist/{checkBrowser-SERJXBXN.js → checkBrowser-UDT2ROZ3.js} +15 -14
- package/dist/{chunk-HUMMHYLF.js → chunk-23PJ2IA5.js} +1 -1
- package/dist/{chunk-4KC5DS6S.js → chunk-26UWY6Y7.js} +1 -1
- package/dist/{chunk-E57FGXI2.js → chunk-2HNZSVMA.js} +8 -8
- package/dist/{chunk-YVWL2VBO.js → chunk-2IIKGFO3.js} +1 -1
- package/dist/{chunk-ZOCKADVZ.js → chunk-2KPNFTOV.js} +1 -1
- package/dist/{chunk-BQKVAQLE.js → chunk-2PZSUSHI.js} +2 -2
- package/dist/{chunk-LX4KUCDF.js → chunk-2RNRAB6U.js} +1 -1
- package/dist/{chunk-Y6FRUECL.js → chunk-5TJRJXFQ.js} +1 -1
- package/dist/{chunk-SHNSD75H.js → chunk-6D2TEACV.js} +1 -1
- package/dist/{chunk-GCL4GZVF.js → chunk-6LDIZ4GJ.js} +1 -1
- package/dist/{chunk-3GF2F27E.js → chunk-6OPBJLMM.js} +1 -1
- package/dist/{chunk-RAWVDZVU.js → chunk-6RHYYH7J.js} +2 -2
- package/dist/{chunk-MGDDKISL.js → chunk-6TKGMCMZ.js} +1 -1
- package/dist/{chunk-5PE6556N.js → chunk-7IQ4S5B3.js} +18 -18
- package/dist/{chunk-3FSMDR37.js → chunk-ADY66LYZ.js} +5 -5
- package/dist/{chunk-X3ZA4UCJ.js → chunk-ARKLBIF5.js} +1 -1
- package/dist/{chunk-7LO34MHD.js → chunk-AVND7IBZ.js} +2 -2
- package/dist/{chunk-N4FY2HKI.js → chunk-B2DE7LZ6.js} +2 -2
- package/dist/{chunk-3JFTAIKA.js → chunk-BIFCKMA2.js} +7 -7
- package/dist/{chunk-OBCJMZCW.js → chunk-BLZS4ZNW.js} +1 -1
- package/dist/{chunk-OGCP6FB2.js → chunk-C4YBN5X6.js} +1 -1
- package/dist/{chunk-JLJINOXS.js → chunk-CPKLZATK.js} +2 -2
- package/dist/{chunk-HKXQXP7W.js → chunk-CYWEBM2Q.js} +1 -1
- package/dist/{chunk-P63B2XHE.js → chunk-D6YNLDSQ.js} +2 -2
- package/dist/{chunk-TQGFY4NR.js → chunk-DLRGADJX.js} +1 -1
- package/dist/{chunk-IHRUU5WH.js → chunk-DOFY4D3Q.js} +2 -2
- package/dist/{chunk-T3QQB5EX.js → chunk-DS3IJC74.js} +1 -1
- package/dist/{chunk-FHDIU5ZS.js → chunk-ESO4PNZJ.js} +2 -2
- package/dist/{chunk-XEGFC2UX.js → chunk-FOIT542N.js} +1 -1
- package/dist/{chunk-B7BYBS7G.js → chunk-G5NF5RYM.js} +4 -4
- package/dist/{chunk-ZPRNVEOF.js → chunk-GJUX6ELV.js} +9 -9
- package/dist/{chunk-B4LOHIIR.js → chunk-IDX4AAHE.js} +2 -2
- package/dist/{chunk-IPKKY42Q.js → chunk-IHD5UW2O.js} +1 -1
- package/dist/{chunk-RYBLJK44.js → chunk-IML2Z4HA.js} +31 -11
- package/dist/{chunk-J7XEUHMI.js → chunk-INKZ3QC6.js} +9 -9
- package/dist/{chunk-PLXD7DE2.js → chunk-IS6FYK3E.js} +1 -1
- package/dist/{chunk-2NDIECXH.js → chunk-ISMKLYU5.js} +1 -1
- package/dist/{chunk-6FMUE7ZO.js → chunk-IWZDLLVZ.js} +1 -1
- package/dist/{chunk-3YBNVXEU.js → chunk-IXJNKHSW.js} +2 -2
- package/dist/{chunk-TE3W2M5C.js → chunk-JQPR3J5V.js} +4 -274
- package/dist/{chunk-HDHFXHUG.js → chunk-JZ7MGLDY.js} +1 -1
- package/dist/{chunk-KWFYSZCH.js → chunk-KZYOTTKM.js} +1 -1
- package/dist/{chunk-XG64CLX7.js → chunk-L3IF3ICK.js} +1 -1
- package/dist/{chunk-HZE3LKBA.js → chunk-L4XB67KR.js} +2 -2
- package/dist/{chunk-57LBTIIT.js → chunk-LGXOIEXD.js} +1 -1
- package/dist/chunk-LS2FSESG.js +731 -0
- package/dist/{chunk-DTA5WWXO.js → chunk-MYEVOW4Z.js} +2 -2
- package/dist/{chunk-37AEW3GR.js → chunk-NQW4IK5U.js} +2 -2
- package/dist/{chunk-FWNIFHN5.js → chunk-OT4X3UJO.js} +1 -1
- package/dist/{chunk-YXYRPI4X.js → chunk-PGY4WFKL.js} +1 -1
- package/dist/{chunk-KHK4M5ZI.js → chunk-PKIQ4ZR3.js} +1 -1
- package/dist/{chunk-IJOIZLYK.js → chunk-PNHLR7UQ.js} +4 -4
- package/dist/{chunk-WMHMIMFW.js → chunk-PQFUF5XD.js} +1 -1
- package/dist/{chunk-KWZSUULG.js → chunk-PWMGT73E.js} +2 -2
- package/dist/{chunk-TQIH2UOD.js → chunk-PXYO7CSG.js} +4 -4
- package/dist/{upstreamProxy-W5FWAT5Z.js → chunk-QCAKISPA.js} +0 -11
- package/dist/{chunk-U7W6SW3X.js → chunk-RAIAWYV6.js} +1 -1
- package/dist/{chunk-2KVC32Y3.js → chunk-RWCYIF4C.js} +2 -2
- package/dist/{chunk-PE4MPXIE.js → chunk-S6TSXBWT.js} +3 -3
- package/dist/{chunk-XGHZO74X.js → chunk-SC2UNTNA.js} +2 -2
- package/dist/{chunk-P4CZXQU5.js → chunk-SJLVYPVA.js} +8 -8
- package/dist/{chunk-ZKVC5V7U.js → chunk-SWNYAKJZ.js} +1 -1
- package/dist/{chunk-J25LQS5W.js → chunk-TCNUA5RK.js} +4 -4
- package/dist/{chunk-WOJPS7PK.js → chunk-UDFMNCZR.js} +1 -1
- package/dist/{chunk-WEP7PDVB.js → chunk-UETMAXZF.js} +1 -1
- package/dist/{chunk-VXT4EGLU.js → chunk-UL2P4PMR.js} +1 -1
- package/dist/{chunk-PO3OQ2FP.js → chunk-VC77JQWW.js} +61 -242
- package/dist/{chunk-BVAN2Q5W.js → chunk-W5LEGKUI.js} +3 -3
- package/dist/{chunk-LE3XMWQX.js → chunk-XHLWZTCQ.js} +4 -4
- package/dist/{chunk-SUZQXGUS.js → chunk-Y4CPI5F6.js} +2 -2
- package/dist/{chunk-YLX7EX7Z.js → chunk-YZFBMMY2.js} +1 -1
- package/dist/{chunk-3GSERPDG.js → chunk-YZJSU2XH.js} +4 -4
- package/dist/{clean-ZJIHNP2V.js → clean-XXEL3ZBK.js} +8 -7
- package/dist/cli.js +61 -61
- package/dist/{cloud-7I6NRBUH.js → cloud-XXMDGEMK.js} +4 -4
- package/dist/{compare-3LJ7SO5I.js → compare-JUVSFZRQ.js} +11 -10
- package/dist/{component-MDRAU2EL.js → component-KEJ34SM2.js} +3 -3
- package/dist/{compositions-7WWVFUKL.js → compositions-BF3NDKKG.js} +7 -6
- package/dist/{curve-CV2TEGZL.js → curve-QHLJ452Y.js} +7 -6
- package/dist/{cuts-UUAWNDQJ.js → cuts-VKKXIQPW.js} +8 -7
- package/dist/{delete-FFGW2LXY.js → delete-GEZVZPWY.js} +2 -2
- package/dist/{deploy-CWTKDXLS.js → deploy-ORQ7QDRG.js} +2 -2
- package/dist/{describeProject-EDKWLCSL.js → describeProject-LEBOC6CL.js} +3 -2
- package/dist/{destroy-NOYFGGDD.js → destroy-ANCSST2S.js} +2 -2
- package/dist/{diff-YSHVMJC7.js → diff-5X65JPB2.js} +20 -19
- package/dist/{doctor-4FEE457C.js → doctor-WUL4VESK.js} +7 -6
- package/dist/{energy-POEWTT6O.js → energy-L2VWHVVA.js} +8 -7
- package/dist/{events-FULDXHAM.js → events-3SKWRLOR.js} +2 -2
- package/dist/{events-I4LQF5YH.js → events-5EEASGJC.js} +3 -3
- package/dist/{events-XQQBVMQT.js → events-7FFAOKAE.js} +9 -8
- package/dist/{execute-PM46UN5B.js → execute-6VLBSJWW.js} +13 -12
- package/dist/{extract-RB6GUKDH.js → extract-NW3KYNN4.js} +8 -7
- package/dist/{face-CTNMUSZJ.js → face-4S5NWVNA.js} +8 -7
- package/dist/{feedback-JHSCPZAH.js → feedback-3OW5JVE4.js} +5 -5
- package/dist/{ffmpeg-ZDD7X4NY.js → ffmpeg-64HDYTRA.js} +3 -2
- package/dist/{figma-DOTGYJR2.js → figma-SN5Z2GUZ.js} +3 -3
- package/dist/fontLocalizeCli.js +6 -5
- package/dist/{frames-BA2O2YJD.js → frames-NZNNVA3R.js} +9 -8
- package/dist/{generate-UVYECX6G.js → generate-22O776FD.js} +13 -12
- package/dist/{get-THXXCSQ6.js → get-O6YCY5BU.js} +2 -2
- package/dist/{gpuPolicy-SXWEHK7V.js → gpuPolicy-26UL7BND.js} +3 -2
- package/dist/{grade-compare-H3VNRJQD.js → grade-compare-6JGG6AUM.js} +12 -11
- package/dist/{heifImagePrep-OLZTCTGK.js → heifImagePrep-6ZP77OL4.js} +4 -3
- package/dist/{help-LKHACFHV.js → help-4IHXYFYU.js} +1 -1
- package/dist/{history-6ABMJPFQ.js → history-ACOL6DPJ.js} +6 -6
- package/dist/hyperframes-player.global.js +1 -1
- package/dist/{info-6ID5AKTQ.js → info-MVEC7EO5.js} +9 -8
- package/dist/{init-DMFKWS6X.js → init-YQRSQKD2.js} +19 -18
- package/dist/{ink-TGKWBWHT.js → ink-A63OPAUS.js} +8 -7
- package/dist/{inspect-YV6LZCC5.js → inspect-5FWI42ZE.js} +13 -12
- package/dist/{keyframes-ZAEKCOXL.js → keyframes-4ANCPAXZ.js} +6 -6
- package/dist/{lambda-44XW4CWE.js → lambda-A7UY44ZG.js} +5 -4
- package/dist/{layout-C5ZLVGVK.js → layout-7GGOEVCP.js} +13 -12
- package/dist/{lint-II2XYWFT.js → lint-AYAPUYJA.js} +6 -6
- package/dist/{list-VR64W4L2.js → list-TGPJOBFL.js} +2 -2
- package/dist/{localPage-7ANEOK7B.js → localPage-YJNVGFUR.js} +3 -2
- package/dist/{login-IXGTJPST.js → login-UFEGKTWJ.js} +4 -4
- package/dist/{look-CJTTSIFD.js → look-TS4DMBJZ.js} +8 -7
- package/dist/{manager-W5HFI6EI.js → manager-RN3IP5UM.js} +4 -3
- package/dist/{measure-FSFVXCQ5.js → measure-L2FJMFZQ.js} +11 -11
- package/dist/{media-treatment-2NRQQJKN.js → media-treatment-JB5W5JI4.js} +8 -7
- package/dist/{media-use-IKIIV7TQ.js → media-use-TMR5E5WJ.js} +3 -3
- package/dist/{models-XDVZN6B2.js → models-R5L2ZQFX.js} +7 -6
- package/dist/{motionShot-PJU7NV2G.js → motionShot-FXPW7WFS.js} +8 -7
- package/dist/{normalize-audio-6G5VU5XM.js → normalize-audio-IWEUGFKJ.js} +4 -4
- package/dist/{open-22OQII2X.js → open-YKOIAP7J.js} +4 -4
- package/dist/{parakeetRunner-YOQACWZQ.js → parakeetRunner-BMBL6UGF.js} +8 -7
- package/dist/{pipeline-DFPGGGHW.js → pipeline-HRJ3VN5Z.js} +6 -5
- package/dist/{plan-7IH2XDWA.js → plan-IIQ7SXWV.js} +9 -8
- package/dist/{play-YDY6IZZH.js → play-FPIHIX3E.js} +4 -4
- package/dist/{preflight-EPJE4LO7.js → preflight-4AV5WOGU.js} +4 -3
- package/dist/{present-FFNDXDPP.js → present-4K3VJUM7.js} +4 -4
- package/dist/{preview-KBV5YTCC.js → preview-2NIQ2EBG.js} +9 -8
- package/dist/{probe-ZN5VLXRP.js → probe-O42OCKVH.js} +8 -7
- package/dist/{producer-JIJV6EUA.js → producer-MTQYIIGW.js} +1 -1
- package/dist/publicNetwork-CWKAKZXP.js +38 -0
- package/dist/{publish-P5WEMSFM.js → publish-QU6NA5UG.js} +3 -3
- package/dist/{remove-background-TUJDKW2H.js → remove-background-55RUOFXG.js} +7 -6
- package/dist/{render-IS5W2MXU.js → render-UWWZFXK5.js} +13 -12
- package/dist/{render-KICKIUBU.js → render-WRCZGKUW.js} +21 -20
- package/dist/{reverse-AUPP7FPD.js → reverse-HIJSN6T6.js} +1 -1
- package/dist/{screenshotCapture-WLPWWM4U.js → screenshotCapture-F2G3ASF3.js} +3 -2
- package/dist/{service-WJTJEB5D.js → service-DLHBDMEI.js} +7 -6
- package/dist/{share-62SZB3ZC.js → share-GS3Z4J2Z.js} +10 -9
- package/dist/{sherpa-MCYJFFXG.js → sherpa-VL2QSAMK.js} +7 -6
- package/dist/{skills-WJWBMXTF.js → skills-LXKJRUCF.js} +6 -6
- package/dist/{skillsUpdateCheck-UF27YQL3.js → skillsUpdateCheck-XMFKI3F2.js} +3 -3
- package/dist/{snapshot-EXHFVNL2.js → snapshot-6BVWACEB.js} +19 -18
- package/dist/{src-JYBAAFEQ.js → src-5DALALRV.js} +5 -4
- package/dist/{src-2IOZPMJR.js → src-K6EIKBHK.js} +9 -5
- package/dist/{start-XSG7DSQ2.js → start-GSVOQ7VY.js} +11 -10
- package/dist/{staticProjectServer-FIGDMMOC.js → staticProjectServer-PXZAGXPM.js} +3 -2
- package/dist/{status-PQ2WYRMY.js → status-U532HK6C.js} +4 -4
- package/dist/studio/assets/{hyperframes-player-DTdMXCCs.js → hyperframes-player-DhaQoeHg.js} +1 -1
- package/dist/studio/assets/{index-CdtV6F8j.js → index-DPeGppVA.js} +5 -5
- package/dist/studio/assets/{index-DA5GM2Mj.js → index-qILK-NRY.js} +1 -1
- package/dist/studio/assets/{pausedVideoDecoder-B4OsoiOL.js → pausedVideoDecoder-DqCJ5lI8.js} +1 -1
- package/dist/studio/index.html +1 -1
- package/dist/{studioServer-R5OHWANQ.js → studioServer-ZDIVHU5Q.js} +27 -26
- package/dist/{sync-LD3KRR6A.js → sync-KXUIN2XW.js} +8 -7
- package/dist/{telemetry-QZ6KSMD7.js → telemetry-BE6NYAAP.js} +3 -3
- package/dist/{templates-LMVSSS6P.js → templates-6DXDZKQT.js} +4 -4
- package/dist/{timeline-RFMWAREC.js → timeline-DYU2RWSB.js} +8 -7
- package/dist/{tokens-5G463QQT.js → tokens-SSWEYFOF.js} +2 -2
- package/dist/{transcribe-7DCWYRRP.js → transcribe-7E653TIR.js} +15 -14
- package/dist/{transcribe-N3NT7EMS.js → transcribe-EHMQS2JF.js} +6 -5
- package/dist/{update-44NG62J2.js → update-5PNT24HU.js} +7 -7
- package/dist/{updateCheck-PEVRHYT2.js → updateCheck-DS6TTOUW.js} +2 -2
- package/dist/{upgrade-YGBOB2HE.js → upgrade-EHJ32IGT.js} +3 -3
- package/dist/{urlDownloader-NBGMT536.js → urlDownloader-6ZROXAQ7.js} +4 -1
- package/dist/{validate-V65Y26SO.js → validate-OPKF4E6C.js} +12 -11
- package/dist/{video-RYUMW6QV.js → video-BRGYDCC2.js} +5 -4
- package/dist/{voices-OBIFVMMB.js → voices-CYPYVEAI.js} +11 -10
- package/dist/warmCheck.js +21 -20
- package/package.json +1 -1
- package/dist/chunk-TSYRN646.js +0 -84
|
@@ -4,14 +4,9 @@ import { dirname as __hf_dirname } from "node:path";
|
|
|
4
4
|
var require = __hf_createRequire(import.meta.url);
|
|
5
5
|
var __filename = __hf_fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __hf_dirname(__filename);
|
|
7
|
-
import {
|
|
8
|
-
captureUpstreamProxy,
|
|
9
|
-
connectAuthority,
|
|
10
|
-
openUpstreamTunnel
|
|
11
|
-
} from "./chunk-TSYRN646.js";
|
|
12
7
|
import {
|
|
13
8
|
fetchLocalPageUrl
|
|
14
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-PGY4WFKL.js";
|
|
15
10
|
import {
|
|
16
11
|
ensureCaptureDirSync,
|
|
17
12
|
writeCaptureFileSync
|
|
@@ -24,8 +19,9 @@ import {
|
|
|
24
19
|
readBoundedResponse
|
|
25
20
|
} from "./chunk-AWDFDFI3.js";
|
|
26
21
|
import {
|
|
27
|
-
isBlockedNetworkHost
|
|
28
|
-
|
|
22
|
+
isBlockedNetworkHost,
|
|
23
|
+
publicRequest
|
|
24
|
+
} from "./chunk-LS2FSESG.js";
|
|
29
25
|
import {
|
|
30
26
|
DOMParser,
|
|
31
27
|
parseHTML
|
|
@@ -34,270 +30,6 @@ import {
|
|
|
34
30
|
// src/capture/userAgent.ts
|
|
35
31
|
var CAPTURE_USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36";
|
|
36
32
|
|
|
37
|
-
// src/capture/publicNetwork.ts
|
|
38
|
-
import { execFile } from "child_process";
|
|
39
|
-
import { promises as dns } from "dns";
|
|
40
|
-
import { readFile } from "fs/promises";
|
|
41
|
-
import { isIP } from "net";
|
|
42
|
-
import { request as httpRequest } from "http";
|
|
43
|
-
import { request as httpsRequest } from "https";
|
|
44
|
-
import { connect as tlsConnect } from "tls";
|
|
45
|
-
var DNS_TIMEOUT_MS = 1e4;
|
|
46
|
-
var CARES_TIMEOUT_MS = 5e3;
|
|
47
|
-
function isPublicIPv4(address) {
|
|
48
|
-
return isIP(address) === 4 && !isBlockedNetworkHost(address);
|
|
49
|
-
}
|
|
50
|
-
function assertPublicHostname(hostname) {
|
|
51
|
-
const host = hostname.toLowerCase().replace(/\.$/, "");
|
|
52
|
-
if (isIP(host) === 4) {
|
|
53
|
-
if (!isPublicIPv4(host)) throw new Error("Capture requires a public IPv4 address");
|
|
54
|
-
return host;
|
|
55
|
-
}
|
|
56
|
-
if (!host.includes(".") || !/^[a-z0-9.-]+$/.test(host) || /(?:^|\.)(?:localhost|local|internal|home|lan|test|invalid|example)$/.test(host) || host.split(".").some((label) => !label || label.startsWith("-") || label.endsWith("-"))) {
|
|
57
|
-
throw new Error("Capture requires a public hostname");
|
|
58
|
-
}
|
|
59
|
-
return host;
|
|
60
|
-
}
|
|
61
|
-
async function resolvePublicAddress(hostname) {
|
|
62
|
-
const host = assertPublicHostname(hostname);
|
|
63
|
-
if (isIP(host) === 4) return host;
|
|
64
|
-
const answers = await resolveIPv4(host);
|
|
65
|
-
const first = answers[0];
|
|
66
|
-
if (!first || !answers.every(isPublicIPv4)) {
|
|
67
|
-
throw new Error("Capture DNS returned a non-public address");
|
|
68
|
-
}
|
|
69
|
-
return first;
|
|
70
|
-
}
|
|
71
|
-
async function resolveIPv4(host) {
|
|
72
|
-
const fromHostsFile = (await hostsFileAnswers()).get(host);
|
|
73
|
-
if (fromHostsFile) return fromHostsFile;
|
|
74
|
-
const deadline = Date.now() + DNS_TIMEOUT_MS;
|
|
75
|
-
const fromSystem = systemAnswers.get(host);
|
|
76
|
-
if (fromSystem) return beforeDeadline(fromSystem, deadline);
|
|
77
|
-
return resolveWithCares(host).catch(
|
|
78
|
-
() => beforeDeadline(systemLookupInKillableChild(host, deadline - Date.now()), deadline)
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
var hostsFile;
|
|
82
|
-
function hostsFileAnswers() {
|
|
83
|
-
const path = process.platform === "win32" ? `${process.env.SystemRoot ?? "C:\\Windows"}\\System32\\drivers\\etc\\hosts` : "/etc/hosts";
|
|
84
|
-
hostsFile ??= readFile(path, "utf8").then(parseHostsFile, () => /* @__PURE__ */ new Map());
|
|
85
|
-
return hostsFile;
|
|
86
|
-
}
|
|
87
|
-
function parseHostsFile(text) {
|
|
88
|
-
const answers = /* @__PURE__ */ new Map();
|
|
89
|
-
for (const line of text.split(/\r?\n/)) {
|
|
90
|
-
const [address, ...names] = line.replace(/#.*/, "").trim().split(/\s+/);
|
|
91
|
-
if (!address || isIP(address) !== 4) continue;
|
|
92
|
-
for (const name of names) {
|
|
93
|
-
const key = name.toLowerCase().replace(/\.$/, "");
|
|
94
|
-
answers.set(key, [...answers.get(key) ?? [], address]);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
return answers;
|
|
98
|
-
}
|
|
99
|
-
function beforeDeadline(work, deadline) {
|
|
100
|
-
let timer;
|
|
101
|
-
const late = new Promise((_resolve, reject) => {
|
|
102
|
-
timer = setTimeout(
|
|
103
|
-
() => reject(new Error("Capture DNS timed out")),
|
|
104
|
-
Math.max(0, deadline - Date.now())
|
|
105
|
-
);
|
|
106
|
-
});
|
|
107
|
-
return Promise.race([work, late]).finally(() => clearTimeout(timer));
|
|
108
|
-
}
|
|
109
|
-
async function resolveWithCares(host) {
|
|
110
|
-
const cancellableResolver = new dns.Resolver();
|
|
111
|
-
const timer = setTimeout(() => cancellableResolver.cancel(), CARES_TIMEOUT_MS);
|
|
112
|
-
try {
|
|
113
|
-
return await cancellableResolver.resolve4(host);
|
|
114
|
-
} finally {
|
|
115
|
-
clearTimeout(timer);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
var systemAnswers = /* @__PURE__ */ new Map();
|
|
119
|
-
var SYSTEM_LOOKUP = `require("node:dns").lookup(process.argv[1], { all: true, family: 4 }, (error, answers) =>
|
|
120
|
-
error ? process.stderr.write(String(error.code)) : process.stdout.write(JSON.stringify(answers.map((a) => a.address))))`;
|
|
121
|
-
var liveLookups = /* @__PURE__ */ new Set();
|
|
122
|
-
function helperEnded(error) {
|
|
123
|
-
if (!error) return "the lookup helper printed no answer";
|
|
124
|
-
return error.signal ? `the lookup helper was ended by ${error.signal}` : `the lookup helper exited with code ${error.code}`;
|
|
125
|
-
}
|
|
126
|
-
function systemLookupInKillableChild(host, timeoutMs) {
|
|
127
|
-
if (!process.listeners("exit").includes(killLiveLookups)) process.on("exit", killLiveLookups);
|
|
128
|
-
const answers = new Promise((resolve, reject) => {
|
|
129
|
-
const child = execFile(
|
|
130
|
-
process.execPath,
|
|
131
|
-
["-e", SYSTEM_LOOKUP, host],
|
|
132
|
-
{
|
|
133
|
-
timeout: Math.max(1, timeoutMs),
|
|
134
|
-
killSignal: "SIGKILL",
|
|
135
|
-
windowsHide: true,
|
|
136
|
-
env: { ...process.env, NODE_OPTIONS: "" }
|
|
137
|
-
},
|
|
138
|
-
(error, stdout, stderr) => {
|
|
139
|
-
if (error?.killed) reject(new Error("Capture DNS timed out"));
|
|
140
|
-
else if (!stdout) reject(new Error(`Capture DNS failed: ${stderr || helperEnded(error)}`));
|
|
141
|
-
else {
|
|
142
|
-
try {
|
|
143
|
-
resolve(JSON.parse(stdout));
|
|
144
|
-
} catch (parseError) {
|
|
145
|
-
reject(parseError);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
);
|
|
150
|
-
liveLookups.add(child);
|
|
151
|
-
child.once("exit", () => liveLookups.delete(child));
|
|
152
|
-
});
|
|
153
|
-
systemAnswers.set(host, answers);
|
|
154
|
-
answers.catch(() => systemAnswers.delete(host));
|
|
155
|
-
return answers;
|
|
156
|
-
}
|
|
157
|
-
function killLiveLookups() {
|
|
158
|
-
for (const child of liveLookups) child.kill("SIGKILL");
|
|
159
|
-
}
|
|
160
|
-
async function pinnedRoute(target, signal) {
|
|
161
|
-
const address = await new Promise((resolve, reject) => {
|
|
162
|
-
const onAbort = () => reject(signal.reason);
|
|
163
|
-
signal.addEventListener("abort", onAbort, { once: true });
|
|
164
|
-
resolvePublicAddress(target.hostname).then(resolve, reject).finally(() => signal.removeEventListener("abort", onAbort));
|
|
165
|
-
});
|
|
166
|
-
signal.throwIfAborted();
|
|
167
|
-
return {
|
|
168
|
-
options: {
|
|
169
|
-
hostname: address,
|
|
170
|
-
port: target.port || void 0,
|
|
171
|
-
agent: false,
|
|
172
|
-
servername: target.hostname,
|
|
173
|
-
rejectUnauthorized: true
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
async function upstreamRoute(target, proxy, headers, signal) {
|
|
178
|
-
assertPublicHostname(target.hostname);
|
|
179
|
-
if (target.protocol === "http:") {
|
|
180
|
-
if (proxy.authorization) headers.set("proxy-authorization", proxy.authorization);
|
|
181
|
-
const path = `${target.origin}${target.pathname}${target.search}`;
|
|
182
|
-
return { options: { hostname: proxy.host, port: proxy.port, agent: false, path } };
|
|
183
|
-
}
|
|
184
|
-
const tunnel = await openUpstreamTunnel(proxy, connectAuthority(target), { signal });
|
|
185
|
-
return {
|
|
186
|
-
tunnel,
|
|
187
|
-
options: {
|
|
188
|
-
createConnection: () => tlsConnect({ socket: tunnel, servername: target.hostname, rejectUnauthorized: true })
|
|
189
|
-
}
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
async function publicRequest(url, init = {}) {
|
|
193
|
-
const target = new URL(url);
|
|
194
|
-
if (!["http:", "https:"].includes(target.protocol) || target.username || target.password) {
|
|
195
|
-
throw new Error("Capture requires an HTTP(S) URL without credentials");
|
|
196
|
-
}
|
|
197
|
-
const method = (init.method ?? "GET").toUpperCase();
|
|
198
|
-
if (!["GET", "HEAD"].includes(method) || init.body != null) {
|
|
199
|
-
throw new Error("Capture asset requests support only GET and HEAD without a body");
|
|
200
|
-
}
|
|
201
|
-
const signal = init.signal ?? AbortSignal.timeout(3e4);
|
|
202
|
-
signal.throwIfAborted();
|
|
203
|
-
const headers = new Headers(init.headers);
|
|
204
|
-
for (const name of [
|
|
205
|
-
"connection",
|
|
206
|
-
"proxy-authorization",
|
|
207
|
-
"proxy-connection",
|
|
208
|
-
"transfer-encoding",
|
|
209
|
-
"upgrade",
|
|
210
|
-
"content-length"
|
|
211
|
-
])
|
|
212
|
-
headers.delete(name);
|
|
213
|
-
headers.set("host", target.host);
|
|
214
|
-
headers.set("accept-encoding", "identity");
|
|
215
|
-
const proxy = captureUpstreamProxy();
|
|
216
|
-
const { options, tunnel } = proxy ? await upstreamRoute(target, proxy, headers, signal) : await pinnedRoute(target, signal);
|
|
217
|
-
return new Promise((resolve, reject) => {
|
|
218
|
-
const request = target.protocol === "https:" ? httpsRequest : httpRequest;
|
|
219
|
-
const req = request(
|
|
220
|
-
{
|
|
221
|
-
protocol: target.protocol,
|
|
222
|
-
path: `${target.pathname}${target.search}`,
|
|
223
|
-
...options,
|
|
224
|
-
method,
|
|
225
|
-
headers: Object.fromEntries(headers),
|
|
226
|
-
signal
|
|
227
|
-
},
|
|
228
|
-
(incoming) => {
|
|
229
|
-
try {
|
|
230
|
-
resolve(assetResponse(incoming, req, method));
|
|
231
|
-
} catch (error) {
|
|
232
|
-
incoming.destroy();
|
|
233
|
-
reject(error);
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
);
|
|
237
|
-
req.once("error", (error) => {
|
|
238
|
-
tunnel?.destroy();
|
|
239
|
-
reject(error);
|
|
240
|
-
});
|
|
241
|
-
req.end();
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
function responseHeaders(incoming) {
|
|
245
|
-
const headers = new Headers();
|
|
246
|
-
for (const [name, value] of Object.entries(incoming.headers)) {
|
|
247
|
-
if (value === void 0) continue;
|
|
248
|
-
for (const item of Array.isArray(value) ? value : [value]) headers.append(name, item);
|
|
249
|
-
}
|
|
250
|
-
return headers;
|
|
251
|
-
}
|
|
252
|
-
function assetResponse(incoming, req, method) {
|
|
253
|
-
incoming.on("error", () => {
|
|
254
|
-
});
|
|
255
|
-
const headers = responseHeaders(incoming);
|
|
256
|
-
const encoding = headers.get("content-encoding")?.toLowerCase();
|
|
257
|
-
if (encoding && encoding !== "identity") {
|
|
258
|
-
throw new Error("Capture server ignored identity content encoding");
|
|
259
|
-
}
|
|
260
|
-
const status = incoming.statusCode ?? 502;
|
|
261
|
-
if (method === "HEAD" || [204, 205, 304].includes(status)) {
|
|
262
|
-
incoming.resume();
|
|
263
|
-
return new Response(null, { status, headers });
|
|
264
|
-
}
|
|
265
|
-
return new Response(responseBody(incoming, req), { status, headers });
|
|
266
|
-
}
|
|
267
|
-
function responseBody(incoming, req) {
|
|
268
|
-
let finished = false;
|
|
269
|
-
return new ReadableStream({
|
|
270
|
-
start(controller) {
|
|
271
|
-
incoming.on("data", (chunk) => {
|
|
272
|
-
if (finished) return;
|
|
273
|
-
controller.enqueue(chunk);
|
|
274
|
-
incoming.pause();
|
|
275
|
-
});
|
|
276
|
-
incoming.once("end", () => {
|
|
277
|
-
if (finished) return;
|
|
278
|
-
finished = true;
|
|
279
|
-
controller.close();
|
|
280
|
-
});
|
|
281
|
-
const fail = (error) => {
|
|
282
|
-
if (finished) return;
|
|
283
|
-
finished = true;
|
|
284
|
-
controller.error(error);
|
|
285
|
-
};
|
|
286
|
-
incoming.once("error", fail);
|
|
287
|
-
incoming.once("aborted", () => fail(new Error("Capture response aborted")));
|
|
288
|
-
incoming.pause();
|
|
289
|
-
},
|
|
290
|
-
pull() {
|
|
291
|
-
incoming.resume();
|
|
292
|
-
},
|
|
293
|
-
cancel() {
|
|
294
|
-
finished = true;
|
|
295
|
-
incoming.destroy();
|
|
296
|
-
req.destroy();
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
|
-
}
|
|
300
|
-
|
|
301
33
|
// src/capture/assetDownloader.ts
|
|
302
34
|
import { join, extname } from "path";
|
|
303
35
|
import { createHash as createHash2 } from "crypto";
|
|
@@ -1138,8 +870,6 @@ function deriveAssetName(parsedUrl, catalog, isPoster, idx, usedNames) {
|
|
|
1138
870
|
}
|
|
1139
871
|
|
|
1140
872
|
export {
|
|
1141
|
-
assertPublicHostname,
|
|
1142
|
-
resolvePublicAddress,
|
|
1143
873
|
CAPTURE_USER_AGENT,
|
|
1144
874
|
noDrops,
|
|
1145
875
|
mergeDrops,
|
|
@@ -7,10 +7,10 @@ var __dirname = __hf_dirname(__filename);
|
|
|
7
7
|
import {
|
|
8
8
|
cliCheckoutLink,
|
|
9
9
|
pageUrl
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-RAIAWYV6.js";
|
|
11
11
|
import {
|
|
12
12
|
Fix
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ISMKLYU5.js";
|
|
14
14
|
import {
|
|
15
15
|
refreshIfNeeded,
|
|
16
16
|
resolveCloudAuthHeaders,
|