init
This commit is contained in:
33
twitchvideo/requestor.php
Executable file
33
twitchvideo/requestor.php
Executable file
@@ -0,0 +1,33 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>video requestor</title>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
date_default_timezone_set('America/Los_Angeles');
|
||||
if($_POST['videourl']!=""){
|
||||
if($_POST['password']=="1234"){
|
||||
$text = str_replace(["<",">"],"",$_POST['videourl']);
|
||||
$text="https://youtube.com/embed/".explode("=",$text)[1];
|
||||
$file=fopen("url.txt","w");
|
||||
fwrite($file,$text);
|
||||
fclose($file);
|
||||
} else {
|
||||
$message="password is not right";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<p><?php echo $message; ?></p>
|
||||
<div align="center">
|
||||
<iframe width="560" height="315" src="<?php echo $text; ?>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
||||
</div><br><br>
|
||||
<div align="center">
|
||||
<form method="post">
|
||||
url: <input autocomplete="off" type="url" name="videourl" maxlength="200" /><br><br>
|
||||
password: <input autocomplete="off" type="text" name="password" /><br><br>
|
||||
<input autocomplete="off" type="submit" value="enter">
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
1
twitchvideo/url.txt
Executable file
1
twitchvideo/url.txt
Executable file
@@ -0,0 +1 @@
|
||||
https://youtube.com/embed/zViYpS3BIqY
|
||||
27
twitchvideo/video.php
Executable file
27
twitchvideo/video.php
Executable file
@@ -0,0 +1,27 @@
|
||||
<html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
|
||||
|
||||
<iframe id="videobox" width="560" height="315" src="" frameborder="0" allow="autoplay; encrypted-media; gyroscope; picture-in-picture"></iframe>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
function loop(){
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "url.txt",
|
||||
cache: false,
|
||||
async: true,
|
||||
success: function(data){
|
||||
if(data+"?autoplay=1"!=$('#videobox').attr('src')){
|
||||
$("#videobox").attr("src",data+"?autoplay=1");
|
||||
$('#videobox').attr('src', $('#videobox').attr('src'));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
window.onload = setInterval(loop,2000);
|
||||
</script>
|
||||
</body>
|
||||
Reference in New Issue
Block a user