12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>YouPlay</title>
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <link href="bootstrap.css" rel="stylesheet">
- <style>
- body {
- padding-top: 60px;
- }
- </style>
- <link href="bootstrap-responsive.css" rel="stylesheet">
- </head>
- <body>
- <div class="navbar navbar-inverse navbar-fixed-top">
- <div class="navbar-inner">
- <div class="container">
- <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </button>
- <a class="brand" href="#">YouPlay</a>
- <div class="nav-collapse collapse">
- <ul class="nav">
- <li><a href="index.php">Home</a></li>
- </ul>
- </div>
- </div>
- </div>
- </div>
- <div class="container">
- <?php
- $config = new stdClass();
- $config->host = "localhost";
- $config->username = "";
- $config->password = "";
- $config->database = "";
- $db = mysqli_connect($config->host,$config->username,$config->password,$config->database);
- if(!isset($_GET["id"])) {
- ?>
- <table class="table">
- <thead>
- <tr>
- <th>Play</th>
- <th>Artist</th>
- <th>Title</th>
- </tr>
- </thead>
- <tbody>
- <?php
- $list = mysqli_query($db,"SELECT * FROM youplay");
- while($entry = mysqli_fetch_assoc($list)) {
- echo "<tr>";
- echo "<td><a href='index.php?id=".$entry["id"]."'>Play</a></td>";
- echo "<td>".htmlspecialchars($entry["artist"])."</td>";
- echo "<td>".htmlspecialchars($entry["title"])."</td>";
- echo "</tr>";
- }
- ?>
- </tbody>
- </table>
- <?php
- }
- else {
- include("ytclass.php");
- $ytclass = new YTDownloader();
- $video = mysqli_fetch_assoc(mysqli_query($db,"SELECT * FROM youplay WHERE id='".mysqli_real_escape_string($db,$_GET["id"])."'"));
- $vlink = $ytclass->getDownloadLinks($video["watchid"])["dl"];
- ?>
- <div class='page-header'>
- <h1><?php echo htmlspecialchars($video["title"]) ?>
- <small> <?php echo htmlspecialchars($video["artist"]) ?></small></h1>
- </div>
- <video controls style="width:90%;margin-left:5%">
- <?php
- for($i=0;$i<count($vlink);$i++) {
- echo "<source src='".$vlink[$i]["url"]."'>";
- }
- ?>
- Your browser does not support the video tag.
- </video>
- <? } ?>
- </div>
- </body>
- </html>
|