Skip to content

Instantly share code, notes, and snippets.

View snuffyDev's full-sized avatar
😮‍💨
nice

snuffy snuffyDev

😮‍💨
nice
View GitHub Profile
const request = await fetch(
"https://www.youtube.com/youtubei/v1/search?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8&prettyPrint=false",
{
body: JSON.stringify({
context: {
client: {
hl: "en",
gl: "US",
userAgent:
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.33,gzip(gfe)",
<?xml version="1.0" encoding="utf-8"?><MPD xmlns="urn:mpeg:dash:schema:mpd:2011" profiles="urn:mpeg:dash:profile:full:2011" xmlns:yt="http://youtube.com/yt/2012/10/10" minBufferTime="PT1.5S" type="static" mediaPresentationDuration="PT256S"><Period><AdaptationSet id="0" mimeType="audio/mp4" startWithSAP="1" subsegmentAlignment="true"><Representation id="139" codecs="mp4a.40.5" bandwidth="50496"><AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/><BaseURL>https://yt-hls-rewriter.onrender.com/videoplayback?expire=1662660868&amp;ei=pNwZY7ikAciE8wTdyIJI&amp;ip=172.70.38.227&amp;id=o-AJJ5Fo3z_dZJ1gHUMmL8Km4LyupvKh1_F6zEcnSCEYcn&amp;itag=139&amp;source=youtube&amp;requiressl=yes&amp;mh=7b&amp;mm=31%2C26&amp;mn=sn-p5qs7nsk%2Csn-ab5l6nrl&amp;ms=au%2Conr&amp;mv=m&amp;mvi=3&amp;pl=24&amp;gcr=us&amp;initcwndbps=5268750&amp;vprv=1&amp;svpuc=1&amp;mime=audio%2Fmp4&amp;gir=yes&amp;clen=1564240&amp;dur=256.093&amp;lmt=1592491685743958&amp;mt=1662638947&amp;fvip=1&amp;kee
<?xml version="1.0" encoding="utf-8"?><MPD xmlns="urn:mpeg:dash:schema:mpd:2011" profiles="urn:mpeg:dash:profile:full:2011" xmlns:yt="http://youtube.com/yt/2012/10/10" minBufferTime="PT1.5S" type="static" mediaPresentationDuration="PT391S"><Period><AdaptationSet id="0" mimeType="audio/mp4" startWithSAP="1" subsegmentAlignment="true"><Representation id="139" codecs="mp4a.40.5" bandwidth="50826"><AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/><BaseURL>https://yt-hls-rewriter.onrender.com/videoplayback?expire=1662660440&amp;ei=-NoZY8C_Nq2U2LYPqdyzgA8&amp;ip=172.70.38.227&amp;id=o-AO2Why3h3FhTSNil5jyPeGhzLKgYxktZABCyqljT1Vdf&amp;itag=139&amp;source=youtube&amp;requiressl=yes&amp;mh=Hn&amp;mm=31%2C26&amp;mn=sn-p5qlsnd6%2Csn-ab5l6nrk&amp;ms=au%2Conr&amp;mv=m&amp;mvi=2&amp;pl=24&amp;gcr=us&amp;initcwndbps=4368750&amp;vprv=1&amp;svpuc=1&amp;mime=audio%2Fmp4&amp;gir=yes&amp;clen=2388793&amp;dur=391.376&amp;lmt=1659118408303211&amp;mt=1662638466&amp;fvip=2&amp;
This file has been truncated, but you can view the full file.
// node_modules/hls.js/dist/hls.js
var require_hls = __commonJS({
"node_modules/hls.js/dist/hls.js"(exports, module) {
typeof window !== "undefined" && function webpackUniversalModuleDefinition(root, factory) {
if (typeof exports === "object" && typeof module === "object")
module.exports = factory();
else if (typeof define === "function" && define.amd)
define([], factory);
else if (typeof exports === "object")
exports["Hls"] = factory();
import { serve } from "https://deno.land/std@0.123.0/http/server.ts";
const port = 3001;
const handler = async (request: Request): Promise<Response> => {
const { pathname, searchParams, origin } = new URL(request.url);
const host = searchParams.get("host") || "";
try {
if (pathname.startsWith("/api")) {
const _api = "manifest.googlevideo.com";
#!/usr/bin/env node
import{readdirSync as pt,writeFileSync as lt}from"fs";import{homedir as mt}from"os";import{join as ut,resolve as A}from"path";import dt from"readline";var G=(...t)=>process.stdout.hasColors()?"\x1B[92m"+t[0]+"\x1B[39m":t[0];var D=(...t)=>process.stdout.hasColors()?"\x1B[104m"+t[0]+"\x1B[49m":t[0];var F=(...t)=>process.stdout.hasColors()?"\x1B[97m"+t[0]+"\x1B[39m":t[0];var x=(...t)=>process.stdout.hasColors()?"\x1B[1m"+t[0]+"\x1B[22m":t[0],l=(...t)=>process.stdout.hasColors()?"\x1B[2m"+t[0]+"\x1B[22m":t[0];var U=(...t)=>process.stdout.hasColors()?"\x1B[4m"+t[0]+"\x1B[24m":t[0],J=(...t)=>process.stdout.hasColors()?"\x1B[7m"+t[0]+"\x1B[27m":t[0];async function H(t){let o=process.stdout,n=process.stdin,s=dt.createInterface({input:n,output:o,completer:p=>{let d=p.lastIndexOf("/"),B=p.indexOf("/")?p.substring(0,d+1):"",it=p.substr(d+1),ct=A(B),I=pt(ct),y=I.filter(at=>at.indexOf(it)===0),S=[];return y.length===1&&S.push(B+y[0]+"/"),S.length?[S,p]:[y.length?y:I,p]}});s.write(`
`+(t?l("[GLOBAL] "):
mod hls;
use futures::Future;
use hls::modify_hls_body;
use async_recursion::async_recursion;
use futures::future::{BoxFuture, FutureExt};
use hyper::body::{self};
use hyper::server::conn::Http;
{"page":"Account","header":{"title":"My Account","subtitle":"Some subtitle"},"items":{"sections":[{"title":"Identity","type":1,"content":[{"text":"John Doe","label":"Name"},{"label":"Email","text":"john.doe@notarealemail.com"}]},{"title":"Contact","type":0,"content":[{"label":"Phone Number","text":"+1 (999) 555-5555"}]}]}}
mod hls;
use futures::Future;
use hls::modify_hls_body;
use futures::future::{BoxFuture, FutureExt};
use hyper::body::{self};
use hyper::server::conn::Http;
use hyper::service::service_fn;
use hyper::{Body, Request};