I found another way to get the stream url:
When a src tag is set on a media element, that element triggers a "durationchange" event, and that line of code changes the video src attribute:
$('#videooverlay').click();
So instead of parsing the dom to find the div that contains a part of the url, you can just wait for the video src to be changed.
To do so you can replace your onready function by that:
function onready(fn){
if(typeof fn === "function"){
var timer = setInterval(function(){
if(typeof jQuery === "function" && jQuery.isReady === true){
//clear first to prevent repeat on script error inside callback
clearInterval(timer);
fn();
}
},10);
}
}
and your timer:
var streamurl_tmr = setInterval(function(){
//...
},100);
by:
$('video.vjs-tech').one('durationchange', function(e){
//you get the full url
var streamurl_url = e.target.src;
$('#realdl a').attr('href', streamurl_url);
$('#steamcopy').text( streamurl_url );
});
//does all the work
$('#videooverlay').click();
$('div[style*="z-index"]:not(#realdl)').each(function(){this.remove();});
Another way to detect the stream url
I found another way to get the stream url: When a src tag is set on a media element, that element triggers a "durationchange" event, and that line of code changes the video src attribute:
So instead of parsing the dom to find the div that contains a part of the url, you can just wait for the video src to be changed. To do so you can replace your onready function by that:
and your timer:
by: