Skip to content

Instantly share code, notes, and snippets.

@uahim
Created March 12, 2020 20:30
Show Gist options
  • Save uahim/1f5bcf77df531f83804bb946d2db0006 to your computer and use it in GitHub Desktop.
Save uahim/1f5bcf77df531f83804bb946d2db0006 to your computer and use it in GitHub Desktop.
@echo off
set curl=curl -s -A "%ua%"
set spde=%temp%\spiegelde.tmp
for /f "delims=" %%x in ('getclip') do set userchoice=%%x
REM set /p userchoice="url: "
for /f "delims=" %%x in ('%curl% %userchoice% ^| .\grep.exe ""JWPlayer"" ^|.\sed.exe -f spiegelde.sed ^|jq -r "[.apiUrl,.mediaId]|join(\"/v2/media/\")"') do set jsonfl=%%x
for /f "delims=" %%x in ('%curl% %jsonfl% ^|jq -r ".playlist[0].sources[0].file"') do set stream=%%x
FOR /f "usebackq" %%x IN (`%curl% %stream% ^| .\grep.exe -A 1 1280x720 ^|tail --lines=1`) DO SET stream_="%%x"
start "" "C:\Program Files\VideoLAN\VLC\vlc.exe" %stream_%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment