Jump to content
BoomBastic

შეცდომა მაქვს სადღაც heeeeelp

Recommended Posts

შეცდომა მაქვს სადღაც და თუ კარგი ხალხი ხართ მიპოვეთ რა შეცდომა მაქვს

 

 

 

<?php
include'head.php';
      $api_key = 'AIzaSyCoB8-pPx62hHgqFM6V4-wP2fnoOGhLhtI';
      
      $video_url = 'https://www.youtube.com/watch?v='.$_GET['url'].'';
	  
      $api_url = 'https://www.googleapis.com/youtube/v3/videos?part=snippet%2CcontentDetails%2Cstatistics&id='.($_GET['url']).'&key=AIzaSyCoB8-pPx62hHgqFM6V4-wP2fnoOGhLhtI';
            
      $data = json_decode(file_get_contents($api_url));
      ?>
<?php
$response = array(
    'data' => null,
    'error' => null,
);
$isResponse = false;
$isError = false;
$isSuccessResponse = false;
$providerName = null;
$url = '';
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
    $isResponse = true;
    require_once __DIR__ . '/YoutubeDownloader.php';
    try {
        if (!isset($_GET['url']) || !trim($_GET['url'])) {
            throw new VideoDownloaderException("Url does not set");
        }
        $urle = trim($_GET['url']);
		$url = 'https://www.youtube.com/watch?v='.$urle.'';
        $yd = new YoutubeDownloader($url);
        $fullInfo = $yd->getFullInfo();
        $videoId = $fullInfo['video_id'];
        $response['data'] = array(
            'baseInfo' => $yd->getBaseInfo(),
            'downloadInfo' => $yd->getDownloadsInfo(),
        );
        $isSuccessResponse = true;
    } catch (Exception $e) {
        $isError = true;
        header('Bad request', true, 400);
        $response['error'] = $e->getMessage();
    }
}
?>

<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css">
<script src="//code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<!--<script src="js/youtube-downloader.js"></script>-->
<div id="content">
<div class="row-body content-track">
<div class="body-content">
<div class="nine columns" id="main-content">
<div id="profile-card"></div>
<div id="track" class="song-container song-container-page">


<style>
#table, #td, #th {  
  border: 1px solid #ddd;
  text-align: left;
}

#table {
  border-collapse: collapse;
  width: 100%;
}

#th, #td {
  padding: 15px;
}
.videoWrapper {
	position: relative;
	padding-bottom: 56.25%; /* 16:9 */
	padding-top: 25px;
	height: 0;
}
.videoWrapper iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}
</style>
<div class="videoWrapper">
<? echo'<iframe width="560" height="349" src="https://www.youtube.com/embed/'.$_GET['url'].'" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'; ?>
</div>





<div class="sidebar-container widget-description"><div class="sidebar-content"><div class="sidebar-header"> <?
     
      echo '<strong>დასახელება: </strong>' . $data->items[0]->snippet->title . '<br>';
      echo '<strong>გამოქვეყნდა: </strong>' . $data->items[0]->snippet->publishedAt . '<br>';
	  echo '<strong>ფაილის ავტორი: </strong>' . $data->items[0]->snippet->channelTitle . '<br>';
      echo '<strong>ნანახია: </strong>' . $data->items[0]->statistics->viewCount . '<br>';

	  
      ?>
	  </div>
	  
	     
	  
<div class="container">
    <div class="alert alert-danger" role="alert" id="error-block" style="display: <?= $isError ? 'block' : 'none' ?>">
        <?= $isError ? $response['error'] : '' ?>
    </div>

    <?php if ($isSuccessResponse): ?>
        <?php
        $baseInfo = $response['data']['baseInfo'];
        $downloadInfo = $response['data']['downloadInfo'];
        ?>
    <?php endif; ?>

  

  
</div>	  
	  
	
	  
	  
	  
	   <table id="table">
                <thead <?= !$isSuccessResponse ? 'style="display: none"' : '' ?>>
                <tr id="tr">
                    <th id="th">ტიპი</th>
                    <th id="th">ფორმატი</th>
                    <th id="th">ბმულები</th>
                </tr>
                </thead>
				<tbody>
                                                        <tr id="hideid18">                            <td id="td">
							<b>ვიდეო</b></td>
                            <td id="td"><b>mp4</b></td>
                            <td id="td">
 <?php echo'<a href="download.php?id='.$_GET['url'].'&amp;itag=18" target="_blank" class="btn btn-success">'; ?>
                                    <span class="glyphicon glyphicon-circle-arrow-down"></span>
                                     <i class="fa fa-download"></i> გადმოწერა
                                </a><br></td>
                        </tr>
						<tr id="hideid251"> <td id="td">
							<b>აუდიო</b></td>
                            <td id="td"> <b>webm</b></td>
                            <td id="td">
				<?php echo'<a href="download.php?id='.$_GET['url'].'&amp;itag=251" target="_blank" class="btn btn-success">'; ?>
                                    <span class="glyphicon glyphicon-circle-arrow-down"></span>
                                     <i class="fa fa-download"></i> გადმოწერა
                                </a><br></td>
                        </tr>
                                                    </tbody>
				</table>
	  
	    <br>
		<div class="videoWrapper">
</div>
		
		
		
		
		
  <div class="row">
        <div class="col-md-6" style="display: <?= $isSuccessResponse ? 'block' : 'none' ?>">
            <pre id="video-description">
                <?php if ($isSuccessResponse): ?>
<?= htmlspecialchars($baseInfo['description']) ?>
                <?php endif; ?>
            </pre>
        </div>
		
		
		
		<style>
		#hideid36, #hideid17, #hideid137, #hideid248, #hideid136, #hideid247, #hideid135, #hideid244, #hideid134, #hideid243, #hideid133, #hideid242, #hideid160, #hideid278, #hideid140, #hideid171, #hideid249, #hideid250
{
			display:none;
		}
		</style>
        
    </div>
</div></div>
</div>

</div>
</div>

</div>
</div>

	  
	  
      <?
include'footer.php';
    ?>

 


Welcome to Detroit city

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×