servustv.com stream url

get servustv.com stream url to feed into vlc/mpc-hc or ffmpeg etc

  1. // ==UserScript==
  2. // @name servustv.com stream url
  3. // @namespace Violentmonkey Scripts!
  4. // @match https://www.servustv.com/*/v/*/
  5. // @description get servustv.com stream url to feed into vlc/mpc-hc or ffmpeg etc
  6. // @grant none
  7. // @version 0.0.1.20240827172214
  8. // ==/UserScript==
  9.  
  10. window.addEventListener ("load", pageFullyLoaded); // https://stackoverflow.com/questions/26268816/how-to-get-a-greasemonkey-script-to-run-both-at-run-at-document-start-and-at-r
  11.  
  12. function pageFullyLoaded () {
  13. var id = location.href.split("/");
  14. // pretty much hardcoded:
  15. var urlp = "https://dms.redbull.tv/v5/destination/stv/";
  16. var urls = "/personal_computer/chrome/de/de_DE/playlist.m3u8";
  17. var properid = id[id.length - 2].toUpperCase();
  18. if (properid.match(/^AA/) != null) {
  19. var filmtitle = document.querySelector('meta[property="og:title"]').content;
  20. filmtitle = filmtitle.replace(/ /g, "_").replace(/[^a-z0-9%C3%A1%C3%A9%C3%AD%C3%B3%C3%BA%C3%B1%C3%BC \.,_-]/gim, "");
  21. var test = prompt("stream URL (OK for ffmpeg command or cancel)", urlp + properid + urls);
  22. if (test !== null) {
  23. prompt("ffmpeg command", 'ffmpeg -referer "' + location.href + '" -user_agent "%ua%" -i "' + urlp + properid + urls + '" -c copy -bsf:a aac_adtstoasc "' + filmtitle + '.mp4"');
  24. }
  25. } else {
  26. alert("can't detect programme ID")
  27. }
  28. }