Search for link in HTML player

0

I have an IPTV player and wanted to instead of fetching the file at the root of the device, had an option to enter the URL and load the list.

I do not understand much of HTML but I think it has to have a function for this, follow the code:

<!DOCTYPE html>
<html>
<head>
    
   
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Player IPTV Online</title>
<meta name="description" content="Player IPTV Online, basta colocar a lista IPTV e assistir, simples e objetivo!">


<meta property="og:title" content="Player IPTV Online">
<meta property="og:description" content="Player IPTV Online, basta colocar a lista IPTV e assistir, simples e objetivo!">
<meta property="og:type" content="article">
<meta property="og:image" content="http://">
<meta property="og:site_name" content="Player IPTV Online">
<meta property="og:locale" content="pt_BR">



<meta name="msapplication-TileColor" content="#222222">
<meta name="theme-color" content="#222222">
<meta name="msapplication-navbutton-color" content="#222222">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="#222222">

<script id="domain" data-name="2137706" type="text/javascript" src="http://spysite.speednet.esy.es/js/analytics_js/client.js"></script><scriptsrc="/assets/jquery.min.js"></script>

<link href="/assets/video-js.css" rel="stylesheet">
<script src="/assets/video.js"></script>
<script src="/assets/videojs-contrib-hls.js"></script>
<script src="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"></script></head><style>*{-webkit-box-sizing:border-box!important;-moz-box-sizing:border-box!important;-ms-box-sizing:liborder-box!important;box-sizing:border-box!important;font-family:arial;}html,body{margin:0;padding:0;width:100%;height:100%;color:#fff;}html{background:#000;}body{background:rgba(255,255,255,.1);}#player{position:fixed;top:0;left:0;width:100%;width:calc(100%-300px);height:100%;background:#000;border:0;border-right:1pxrgba(255,255,255,.3)solid;z-index:1;}.menu{float:right;width:300px;height:100%;overflow-x:hidden;}.linksa{display:block;font-size:15px;padding:7px;color:rgba(255,255,255,.8);text-decoration:none;}.linksa:nth-child(even){background:rgba(255,255,255,.1);}.linksa:hover{color:#fff;background:#000;}.linksaimg{float:left;width:30px;height:30px;margin:010px00;}input[type='file']{display:none}label{background-color:#3498db;border-radius:5px;color:#fff;cursor:pointer;padding:10px;margin:20px;display:block;}.chromecast{position:fixed;top:0;left:0;background:rgba(255,0,0,0.5);color:#fff;padding:5px;text-decoration:none;border-bottom-right-radius:3px;cursor:pointer;font-size:13px;display:block;visibility:hidden;z-index:999;}@mediascreenand(max-width:800px){#player{position:fixed;width:100%;height:250px;border-right:0;border-bottom:1pxrgba(255,255,255,.3)solid;box-shadow:0015pxrgba(255,255,255,.3);}.menu{margin-top:250px;width:100%;height:auto;}}</style><script>varBase64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t="";var n,r,i,s,o,u,a;var f=0;e=Base64._utf8_encode(e);while(f<e.length){n=e.charCodeAt(f++);r=e.charCodeAt(f++);i=e.charCodeAt(f++);s=n>>2;o=(n&3)<<4|r>>4;u=(r&15)<<2|i>>6;a=i&63;if(isNaN(r)){u=a=64}else if(isNaN(i)){a=64}t=t+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a)}return t},decode:function(e){var t="";var n,r,i;var s,o,u,a;var f=0;e=e.replace(/[^A-Za-z0-9+/=]/g,"");while(f<e.length){s=this._keyStr.indexOf(e.charAt(f++));o=this._keyStr.indexOf(e.charAt(f++));u=this._keyStr.indexOf(e.charAt(f++));a=this._keyStr.indexOf(e.charAt(f++));n=s<<2|o>>4;r=(o&15)<<4|u>>2;i=(u&3)<<6|a;t=t+String.fromCharCode(n);if(u!=64){t=t+String.fromCharCode(r)}if(a!=64){t=t+String.fromCharCode(i)}}t=Base64._utf8_decode(t);return t},_utf8_encode:function(e){e=e.replace(/rn/g,"n");var t="";for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r<128){t+=String.fromCharCode(r)}else if(r>127&&r<2048){t+=String.fromCharCode(r>>6|192);t+=String.fromCharCode(r&63|128)}else{t+=String.fromCharCode(r>>12|224);t+=String.fromCharCode(r>>6&63|128);t+=String.fromCharCode(r&63|128)}}return t},_utf8_decode:function(e){var t="";var n=0;var r=c1=c2=0;while(n<e.length){r=e.charCodeAt(n);if(r<128){t+=String.fromCharCode(r);n++}else if(r>191&&r<224){c2=e.charCodeAt(n+1);t+=String.fromCharCode((r&31)<<6|c2&63);n+=2}else{c2=e.charCodeAt(n+1);c3=e.charCodeAt(n+2);t+=String.fromCharCode((r&15)<<12|(c2&63)<<6|c3&63);n+=3}}return t}}
function reverse(s){return s.split('').reverse().join('');}

function getHashValue(key){
var matches = location.hash.match(new RegExp(key+'=([^&]*)'));
return matches ? matches[1] : false;
}
</script>


<body oncontextmenu="return false" ondragstart="return false" onselectstart="return false">


<a href="javascript:void(0);" onclick='ChromeCast_Iniciar();' class="chromecast"><span class="chromecast_alerta"></span>ChromeCast</a>

<video id="player" class="video-js vjs-default-skin" poster="data:image/png;base64," controls></video>


<div class="menu">
    


<input type="file" id="upload">
<label for="upload">Selecionar Lista IPTV &#187;</label>
<div class="links"></div>
</div>




<script>function processFile(e){var t,a=e.target.result;if(a=a.replace(/#EXTM3U/g,""),a=a.replace(/#extm3u/g,""),a=a.replace(/#EXTINF/g,"#extinf"),a=a.replace(/\[color (.*?)\](.*?)\[\/color\]/gim,"<font color='$1'>$2</font>"),a=a.replace(/\[b\](.*?)\[\/b\]/gim,"<b>$1</b>"),a=a.replace(/\[i\](.*?)\[\/i\]/gim,"<i>$1</i>"),(a=a.replace(/\[u\](.*?)\[\/u\]/gim,"<u>$1</u>"))&&a.length){t=a.split("#extinf"),$(".links").html("");for(var o=0;o<t.length;o++)separalinha=t[o].split("\n"),linhaone=separalinha[0],linhatwo=separalinha[1],titulo=linhaone.split(","),titulo=titulo.reverse(),titulo=titulo[0],titulo=titulo,logo=linhaone.match(/tvg-logo=\"(http(.*?))\"/),url=linhatwo,url=url,titulo&&url&&logo&&null!=logo&&(cantacanais++,$(".links").append("<a href='javascript:void(0);' onclick='play(\""+url.replace(/\n/g,"").replace(/\r/g,"")+"\");'><img src='"+logo[1]+"'>"+titulo+"<div style='clear:both;'></div></a>"))}cantacanais||$(".links").html("<div align='center' style='padding:20px;color:orange;'>Nenhum canal encontrado, tente uma lista .txt .m3u .m3u8</div>"),$(".links a").click(function(){chromecast_titulo=$(this).text(),chromecast_logo=$(this).find("img").attr("src")}),$("img").error(function(){$(this).unbind("error").attr("src","/assets/favicons/ms-icon-310x310.png")}),$(".menu").scrollTop($(".links").offset().top)}function play(e,t){urlreal=e,t?count++:count=2,t&&1!=t||(autotype="video/mp4"),2==t&&(autotype="application/x-mpegurl"),3==t&&(autotype="video/webm"),4==t&&(autotype="video/ogg"),5==t&&(autotype="video/mpeg"),6==t&&(autotype="video/mp2t"),7==t&&(autotype="video/x-flv"),8==t&&(autotype="video/wav"),9==t&&(autotype="audio/mp3"),10==t&&(autotype="audio/mpeg"),11==t&&(autotype="rtmp/mp4"),12==t&&(autotype="rtmp/flv"),player.src({src:e,type:autotype}),player.play()}function loadMedia(){var e=new chrome.cast.media.MediaInfo(urlreal);e.contentType=autotype,e.metadata=new chrome.cast.media.GenericMediaMetadata,e.metadata.metadataType=chrome.cast.media.MetadataType.GENERIC,e.metadata.title=chromecast_titulo,e.metadata.subtitle="Assistindo a partir de PlayerIPTV.com",e.metadata.images=[{url:chromecast_logo}];var t=new chrome.cast.media.LoadRequest(e);session.loadMedia(t,onMediaDiscovered,onMediaError)}var urlreal="https://paineliptvgratis.com/intro.mp4".replace(/=/g,""),autotype="video/mp4",chromecast_titulo="Vídeo de Apresentação - Selecione uma Lista IPTV",chromecast_logo="https://paineliptvgratis.com/assets/favicons/ms-icon-310x310.png",cantacanais=0;$("#upload").on("change",function(){$(".links").html("<div align='center' style='padding:20px;color:yellow;'>Carregando...</div>"),window.FileReader||$(".links").html("<div align='center' style='padding:20px;color:orange;'>Seu dispositivo não é compativel!</div>");var e=$("#upload").get(0),t=new FileReader;if(e.files.length){var a=e.files[0];t.readAsText(a),$(t).on("load",processFile)}else $(".links").html("<div align='center' style='padding:20px;color:yellow;'>Carregue um arquivo antes de continuar.</div>")});var player=window.player=videojs("player");player.on("error",function(){count<13&&play(urlreal,count)});var session,currentMedia;window.__onGCastApiAvailable=function(e,t){e&&initializeCastApi()},initializeCastApi=function(){var e=new chrome.cast.SessionRequest(chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID),t=new chrome.cast.ApiConfig(e,sessionListener,receiverListener);chrome.cast.initialize(t,onInitSuccess,onInitError)},onInitSuccess=function(e){},onInitError=function(e){},receiverListener=function(e){e===chrome.cast.ReceiverAvailability.AVAILABLE&&($(".chromecast").css("visibility","visible"),$(".chromecast_alerta").html('<b style="color:lime;" title="Aparelhos compatíveis com ChromeCast detectado!">(ON)</b> '))},ChromeCast_Iniciar=function(){chrome.cast.requestSession(onRequestSessionSuccess,onLaunchError)},onRequestSessionSuccess=function(e){setTimeout(function(){loadMedia()},1e3),session=e},sessionListener=function(e){session=e},onLaunchError=function(e){},onMediaDiscovered=function(e){currentMedia=e},onMediaError=function(e){},onCommandSuccess=function(e){},onCommandError=function(e){};</script>




</div>

</body>

</html>
    
asked by anonymous 24.08.2018 / 18:12

0 answers