Skip to content

Instantly share code, notes, and snippets.

@uahim
Last active December 17, 2022 14:15
Show Gist options
  • Save uahim/b0c4b43101440b1f1525ef647025a9f2 to your computer and use it in GitHub Desktop.
Save uahim/b0c4b43101440b1f1525ef647025a9f2 to your computer and use it in GitHub Desktop.
shows the stream url to watch in VLC or to feed into ffmpeg, youtube-dl or its various forks; fix to match non-fictional content
// stream url to watch in VLC or to feed into ffmpeg, youtube-dl or its various forks
// displayed line-by-line for better readability
javascript:
var id = location.href.split("/");
var urlp = "https://dms.redbull.tv/v5/destination/stv/";
var urls = "/personal_computer/chrome/de/de_DE/playlist.m3u8";
var properid = id[id.length - 2].toUpperCase();
if (properid.match(/^AA/) != null) {
var filmtitle = document.querySelector('meta[property="og:title"]').content;
filmtitle = filmtitle.replace(/ /g, "_").replace(/[^a-z0-9%C3%A1%C3%A9%C3%AD%C3%B3%C3%BA%C3%B1%C3%BC \.,_-]/gim, "");
var test = prompt("stream URL (OK for ffmpeg command or cancel)", urlp + properid + urls);
if (test !== null) {
prompt("ffmpeg command", 'ffmpeg -referer "' + location.href + '" -user_agent "%ua%" -i "' + urlp + properid + urls + '" -c copy -bsf:a aac_adtstoasc "' + filmtitle + '.mp4"');
}
} else {
alert("can't detect programme ID")
}
void(0);
// the same code in one line - just copy & paste it
javascript: var id = location.href.split("/"); var urlp = "https://dms.redbull.tv/v5/destination/stv/"; var urls = "/personal_computer/chrome/de/de_DE/playlist.m3u8"; var properid = id[id.length - 2].toUpperCase(); if (properid.match(/^AA/) != null) { var filmtitle = document.querySelector('meta[property="og:title"]').content; filmtitle = filmtitle.replace(/ /g, "_").replace(/[^a-z0-9%C3%A1%C3%A9%C3%AD%C3%B3%C3%BA%C3%B1%C3%BC \.,_-]/gim, ""); var test = prompt("stream URL (OK for ffmpeg command or cancel)", urlp + properid + urls); if (test !== null) { prompt("ffmpeg command", 'ffmpeg -referer "' + location.href + '" -user_agent "%ua%" -i "' + urlp + properid + urls + '" -c copy -bsf:a aac_adtstoasc "' + filmtitle + '.mp4"'); } } else { alert("can't detect programme ID") } void(0);
@uahim
Copy link
Author

uahim commented Jul 22, 2022

@MuenchenSued ah yes, the old code was not always working, I just removed it to avoid confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment