| … | … | @@ -55,7 +55,12 @@ ctx.on('page', p => setTimeout(() => { |
| 55 | 55 | ctx.on('request', r => { |
| 56 | 56 | const u = r.url(); |
| 57 | 57 | if (NOISE.test(u)) return; |
| 58 | | if (MEDIA.test(u)) media.set(u, (r.headers() || {}).referer || null); |
| 58 | // FULL headers, not just the referer. vidlink's proxy returns 428/429/403 to |
| 59 | // curl for a URL the browser fetches fine, so the difference IS the header |
| 60 | // set (or the TLS fingerprint) -- and you cannot replay what you did not |
| 61 | // record. This is the artefact that decides whether a source is usable by |
| 62 | // ffmpeg at all, which is the only thing that matters for ingest. |
| 63 | if (MEDIA.test(u)) media.set(u, r.headers() || {}); |
| 59 | 64 | }); |
| 60 | 65 | |
| 61 | 66 | ctx.on('response', async resp => { |
| … | … | @@ -112,6 +117,6 @@ await ctx.close(); |
| 112 | 117 | fs.rmSync(PROFILE, { recursive: true, force: true }); |
| 113 | 118 | |
| 114 | 119 | console.log(JSON.stringify({ |
| 115 | | media: [...media.entries()].map(([url, referer]) => ({ url, referer })), |
| 120 | media: [...media.entries()].map(([url, headers]) => ({ url, headers })), |
| 116 | 121 | api, cookies, title, bodyText, |
| 117 | 122 | })); |