<commit_before><html>
<head>

<script type="text/javascript" src="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
</head>
<body>

<select id="chanSelect">
 

</select>
<br>
<br>
<a href="#" class="clickedCast">Cast</a> | <a href="#" class="clickedStream">Stream</a> | <a href="#" class="clickedVLC">VLC Plugin!</a>

<script>
function sessionListener(e) {
  session = e;
  if (session.media.length != 0) {
    console.log("MediaDiscovered");
    //onMediaDiscovered('onRequestSessionSuccess', session.media[0]);
  }
}
function clickme(chan){
    console.log("clk");
    chrome.cast.requestSession(onRequestSessionSuccess, onLaunchError);
}
function receiverListener(e) {
  if( e === chrome.cast.ReceiverAvailability.AVAILABLE) {
    console.log("Available");
  }
}
function onLaunchError(e){
console.log("LaunchError");
}
window.curMedia="http://192.168.0.141:7090/out.m3u8"
//window.curMedia="http://magmastone.net/nhl/proxy.php/nlds150.cdnak.neulion.com/nlds_vod/nhl/vod/2014/10/25/107/2_107_bos_tor_1415_h_whole_1_ipad.mp4.m3u8"
//window.curMedia="http://nhl.cdnllnwnl.neulion.net/u/nhlmobile/vod/nhl/2014/10/25/107/2_107_bos_tor_1415_h_continuous_1_1600.mp4";
function onRequestSessionSuccess(e) {
      session = e;
var mediaInfo = new chrome.cast.media.MediaInfo(window.curMedia);
  mediaInfo.metadata = new chrome.cast.media.GenericMediaMetadata();
  mediaInfo.metadata.metadataType = chrome.cast.media.MetadataType.GENERIC;
mediaInfo.contentType = 'application/x-mpegURL';
//mediaInfo.metadata.images = [{'url':"http://nhl.cdnllnwnl.neulion.net/u/www/thumbs/2014/10/25/653927_eb.jpg"}];
var request = new chrome.cast.media.LoadRequest(mediaInfo);
console.log("Requesting...")
session.loadMedia(request,
   onMediaDiscovered.bind(this, 'loadMedia'),
   onMediaError);
}
function onMediaError(e){
console.log(e);
console.log("MediaError");
}


function onMediaDiscovered(how, media) {
   window.currentMedia = media;
   console.log("MediaDiscovered");
   media.addUpdateListener(onMediaStatusUpdate);
}
function OnMediaError(e){
console.log("MediaError");
}
function onError(e){
console.log("Error");
}
function onInitSuccess(e){
console.log("Initted")
}
initializeCastApi = function() {
  var sessionRequest = new chrome.cast.SessionRequest(chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID);
  var apiConfig = new chrome.cast.ApiConfig(sessionRequest,
    sessionListener,
    receiverListener);
  chrome.cast.initialize(apiConfig, onInitSuccess, onError);
};

window['__onGCastApiAvailable'] = function(loaded, errorInfo) {
  if (loaded) {
    initializeCastApi();
  } else {
    console.log(errorInfo);
  }
}
</script>


<script>
function checkStream(){
        $.get("http://192.168.0.141:7090/out.m3u8").fail(function(){
            setTimeout(checkStream,1000);
        }).done(function(){
            if(window.typeS=="cast"){
                clickme("cast");
            }else if (window.typeS=="web"){
                window.location.href="http://192.168.0.141:7090/out.m3u8"
            }else{
              var vlc = document.getElementById("vlc");
              var it=vlc.playlist.add("http://192.168.0.141:7090/out.m3u8");
              vlc.playlist.playItem(it);
            }
        });
}
$(document).ready(function(){

  $.getJSON("http://192.168.0.149/lineup.json").done(function(data){
    for (var i = data.length - 1; i >= 0; i--) {
      z=data[i]["GuideNumber"].split(".");
      toadd="<option value='"+z[0]+"_"+z[1]+"'>"+data[i]["GuideName"]+"</option>";
      $("#chanSelect").append(toadd);
    };
  });

    $(".clickedCast").click(function(){
        chan=$("#chanSelect").val();
        console.log($(this).attr("chan"));
        $.get("http://192.168.0.141:7090/?chan="+chan)
        alert("Waiting for stream to start.");
        window.typeS="cast"
        setTimeout(checkStream,1000);

    });
    $(".clickedStream").click(function(){
        chan=$("#chanSelect").val();
        $.get("http://192.168.0.141:7090/?chan="+chan)
        alert("Waiting for stream to start.");
        window.typeS="web"
        setTimeout(checkStream,1000);
        console.log($(this).attr("chan"));
    });
    $(".clickedVLC").click(function(){
        chan=$("#chanSelect").val();
        $.get("http://192.168.0.141:7090/?chan="+chan)
        alert("Waiting for stream to start.");
        window.typeS="vlc"
        setTimeout(checkStream,1000);
        console.log($(this).attr("chan"));
    });
<commit_msg>Fixed support for someone other than me running it...<commit_after><html>
<head>

<script type="text/javascript" src="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
</head>
<body>

<select id="chanSelect">
 

</select>
<br>
<br>
<a href="#" class="clickedCast">Cast</a> | <a href="#" class="clickedStream">Stream</a> | <a href="#" class="clickedVLC">VLC Plugin!</a>

<script>
function sessionListener(e) {
  session = e;
  if (session.media.length != 0) {
    console.log("MediaDiscovered");
    //onMediaDiscovered('onRequestSessionSuccess', session.media[0]);
  }
}
function clickme(chan){
    console.log("clk");
    chrome.cast.requestSession(onRequestSessionSuccess, onLaunchError);
}
function receiverListener(e) {
  if( e === chrome.cast.ReceiverAvailability.AVAILABLE) {
    console.log("Available");
  }
}
function onLaunchError(e){
console.log("LaunchError");
}
window.curMedia="http://"+window.location.hostname+":"+window.location.port+"/out.m3u8"
//window.curMedia="http://magmastone.net/nhl/proxy.php/nlds150.cdnak.neulion.com/nlds_vod/nhl/vod/2014/10/25/107/2_107_bos_tor_1415_h_whole_1_ipad.mp4.m3u8"
//window.curMedia="http://nhl.cdnllnwnl.neulion.net/u/nhlmobile/vod/nhl/2014/10/25/107/2_107_bos_tor_1415_h_continuous_1_1600.mp4";
function onRequestSessionSuccess(e) {
      session = e;
var mediaInfo = new chrome.cast.media.MediaInfo(window.curMedia);
  mediaInfo.metadata = new chrome.cast.media.GenericMediaMetadata();
  mediaInfo.metadata.metadataType = chrome.cast.media.MetadataType.GENERIC;
mediaInfo.contentType = 'application/x-mpegURL';
//mediaInfo.metadata.images = [{'url':"http://nhl.cdnllnwnl.neulion.net/u/www/thumbs/2014/10/25/653927_eb.jpg"}];
var request = new chrome.cast.media.LoadRequest(mediaInfo);
console.log("Requesting...")
session.loadMedia(request,
   onMediaDiscovered.bind(this, 'loadMedia'),
   onMediaError);
}
function onMediaError(e){
console.log(e);
console.log("MediaError");
}


function onMediaDiscovered(how, media) {
   window.currentMedia = media;
   console.log("MediaDiscovered");
   media.addUpdateListener(onMediaStatusUpdate);
}
function OnMediaError(e){
console.log("MediaError");
}
function onError(e){
console.log("Error");
}
function onInitSuccess(e){
console.log("Initted")
}
initializeCastApi = function() {
  var sessionRequest = new chrome.cast.SessionRequest(chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID);
  var apiConfig = new chrome.cast.ApiConfig(sessionRequest,
    sessionListener,
    receiverListener);
  chrome.cast.initialize(apiConfig, onInitSuccess, onError);
};

window['__onGCastApiAvailable'] = function(loaded, errorInfo) {
  if (loaded) {
    initializeCastApi();
  } else {
    console.log(errorInfo);
  }
}
</script>


<script>
function checkStream(){
        $.get("http://"+window.location.hostname+":"+window.location.port+"/out.m3u8").fail(function(){
            setTimeout(checkStream,1000);
        }).done(function(){
            if(window.typeS=="cast"){
                clickme("cast");
            }else if (window.typeS=="web"){
                window.location.href="http://"+window.location.hostname+":"+window.location.port+"/out.m3u8"
            }else{
              var vlc = document.getElementById("vlc");
              var it=vlc.playlist.add("http://"+window.location.hostname+":"+window.location.port+"/out.m3u8");
              vlc.playlist.playItem(it);
            }
        });
}
$(document).ready(function(){
$.get("/ip.txt").done(function(hdmr){
  window.ip=hdmr;
  $.getJSON("http://"+window.ip+"/lineup.json").done(function(data){
    for (var i = data.length - 1; i >= 0; i--) {
      z=data[i]["GuideNumber"].split(".");
      toadd="<option value='"+z[0]+"_"+z[1]+"'>"+data[i]["GuideName"]+"</option>";
      $("#chanSelect").append(toadd);
    };
  });

    $(".clickedCast").click(function(){
        chan=$("#chanSelect").val();
        console.log($(this).attr("chan"));
        $.get("http://"+window.location.hostname+":"+window.location.port+"/?chan="+chan)
        alert("Waiting for stream to start.");
        window.typeS="cast"
        setTimeout(checkStream,1000);

    });
    $(".clickedStream").click(function(){
        chan=$("#chanSelect").val();
        $.get("http://"+window.location.hostname+":"+window.location.port+"/?chan="+chan)
        alert("Waiting for stream to start.");
        window.typeS="web"
        setTimeout(checkStream,1000);
        console.log($(this).attr("chan"));
    });
    $(".clickedVLC").click(function(){
        chan=$("#chanSelect").val();
        $.get("http://"+window.location.hostname+":"+window.location.port+"/?chan="+chan)
        alert("Waiting for stream to start.");
        window.typeS="vlc"
        setTimeout(checkStream,1000);
        console.log($(this).attr("chan"));
    });
});
{'fraction_non_alphanumeric': 0.19451602927533243, 'fraction_numerical': 0.03216163282135862, 'mean_word_length': 3.998454404945904, 'pattern_counts': {'":': 7, '<': 53, '<?xml version=': 0, '>': 55, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 8, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4963751', 'n_tokens_mistral': 3497, 'n_tokens_neox': 3290, 'n_words': 402}