0
0
Xoş gəldin, Qonaq
Master Forum | Arxiv Mövzular | Arxiv 1
  Php kod da komek
Mövzu Bağlıdır
By_HiKMeT By_HiKMeT [Off] [#] (18.08.2016 / 19:08)
Salam sekile baxin orda Download sozunu cixarmaq isdeyirem php kodunu atiram bura bacaran xais cixarib kodu atsin da mene

  1. <?php
  2. include_once('config.php');
  3. ob_start();// if not, some servers will show this php warning: header is already set in line 46...
  4.  
  5. function clean($string) {
  6. $string = str_replace(' ', '-', $string); // Replaces all spaces with hyphens.
  7. return preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars.
  8. }
  9.  
  10. function formatBytes($bytes, $precision = 2) {
  11. $units = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
  12. $bytes = max($bytes, 0);
  13. $pow = floor(($bytes ? log($bytes) : 0) / log(1024));
  14. $pow = min($pow, count($units) - 1);
  15. $bytes /= pow(1024, $pow);
  16. return round($bytes, $precision) . '' . $units[$pow];
  17. }
  18. function is_chrome(){
  19. $agent=$_SERVER['HTTP_USER_AGENT'];
  20. if( preg_match("/like\sGecko\)\sChrome\//", $agent) ){// if user agent is google chrome
  21. if(!strstr($agent, 'Iron')) // but not Iron
  22. return true;
  23. }
  24. return false;// if isn't chrome return false
  25. }
  26.  
  27. if(isset($_REQUEST['videoid'])) {
  28. $my_id = $_REQUEST['videoid'];
  29. if(strlen($my_id)>11){
  30. $url = parse_url($my_id);
  31. $my_id = NULL;
  32. if( is_array($url) && count($url)>0 && isset($url['query']) && !empty($url['query']) ){
  33. $parts = explode('&',$url['query']);
  34. if( is_array($parts) && count($parts) > 0 ){
  35. foreach( $parts as $p ){
  36. $pattern = '/^v\=/';
  37. if( preg_match($pattern, $p) ){
  38. $my_id = preg_replace($pattern,'',$p);
  39. break;
  40. }
  41. }
  42. }
  43. if( !$my_id ){
  44. echo '<p>No video id passed in</p>';
  45. }
  46. }else{
  47. echo '<p>Invalid url</p>';
  48. }
  49. }
  50. } else {
  51. echo '<p>No video id passed in</p>';
  52. }
  53.  
  54. if(isset($_REQUEST['type'])) {
  55. $my_type = $_REQUEST['type'];
  56. } else {
  57. $my_type = 'redirect';
  58. }
  59.  
  60. if ($my_type == 'Download') {
  61. ?>
  62.  
  63.  
  64.  
  65. <?php
  66. } // end of if for type=Download
  67.  
  68. /* First get the video info page for this video id */
  69. -$my_video_info = 'http://www.youtube.com/get_video_info?&video_id='. $my_id;
  70. +//$my_video_info = 'http://www.youtube.com/get_video_info?&video_id='. $my_id;
  71. +$my_video_info = 'http://www.youtube.com/get_video_info?&video_id='. $my_id.'&asv=3&el=detailpage&hl=en_US'; //video details fix *1
  72. $my_video_info = curlGet($my_video_info);
  73.  
  74. /* TODO: Check return from curl for status code */
  75.  
  76. $thumbnail_url = $title = $url_encoded_fmt_stream_map = $type = $url = '';
  77.  
  78. parse_str($my_video_info);
  79. include("head1.php");
  80.  
  81. echo '<div class="title">'.$title.'</div>';
  82. echo '<div class="item" align="center">';
  83. echo '<iframe width="560" height="315" src="https://www.youtube.com/embed/'. $my_id .'" frameborder="0" allowfullscreen></iframe>';
  84. echo '</div>';
  85.  
  86. echo '';
  87.  
  88. $my_title = $title;
  89. $cleanedtitle = clean($title);
  90.  
  91. if(isset($url_encoded_fmt_stream_map)) {
  92. /* Now get the url_encoded_fmt_stream_map, and explode on comma */
  93. $my_formats_array = explode(',',$url_encoded_fmt_stream_map);
  94. if($debug) {
  95. echo '<pre>';
  96. print_r($my_formats_array);
  97. echo '</pre>';
  98. }
  99. } else {
  100. echo '<p>No encoded format stream found.</p>';
  101. echo '<p>Here is what we got from YouTube:</p>';
  102. echo $my_video_info;
  103. }
  104. if (count($my_formats_array) == 0) {
  105. echo '<p>No format stream map found - was the video id correct?</p>';
  106. }
  107.  
  108. /* create an array of available download formats */
  109. $avail_formats[] = '';
  110. $i = 0;
  111. $ipbits = $ip = $itag = $sig = $quality = '';
  112. $expire = time();
  113.  
  114. foreach($my_formats_array as $format) {
  115. parse_str($format);
  116. $avail_formats[$i]['itag'] = $itag;
  117. $avail_formats[$i]['quality'] = $quality;
  118. $type = explode(';',$type);
  119. $avail_formats[$i]['type'] = $type[0];
  120. $avail_formats[$i]['url'] = urldecode($url) . '&signature=' . $sig;
  121. $avail_formats[$i]['expires'] = date("G:i:s T", $expire);
  122. $avail_formats[$i]['ipbits'] = $ipbits;
  123. $avail_formats[$i]['ip'] = $ip;
  124. $i++;
  125. }
  126.  
  127. if ($debug) {
  128. echo '<p>These links will expire at '. $avail_formats[0]['expires'] .'</p>';
  129. echo '<p>The server was at IP address '. $avail_formats[0]['ip'] .' which is an '. $avail_formats[0]['ipbits'] .' bit IP address. ';
  130. echo 'Note that when 8 bit IP addresses are used, the download links may fail.</p>';
  131. }
  132. if ($my_type == 'Download') {
  133. echo '<div class="title">Videos Formats For Download:
  134. </div>';
  135.  
  136. /* now that we have the array, print the options */
  137. for ($i = 0; $i < count($avail_formats); $i++) {
  138. echo '<div class="menu">';
  139. echo '' . $avail_formats[$i]['itag'] . ' ';
  140. if($config['VideoLinkMode']=='direct'||$config['VideoLinkMode']=='both')
  141. echo '<a href="' . $avail_formats[$i]['url'] . '&title='.$cleanedtitle.'" class="mime">' . $avail_formats[$i]['type'] . '</a> ';
  142. else
  143. echo '' . $avail_formats[$i]['type'] . '';
  144. echo '(' . $avail_formats[$i]['quality'];
  145. if($config['VideoLinkMode']=='proxy'||$config['VideoLinkMode']=='both')
  146. echo ' / ' . '<a href="http://www.baneeishaque.somee.com/Youtube_api/download.php?mime=' . $avail_formats[$i]['type'] .'&title='. urlencode($my_title) .'&token='.base64_encode($avail_formats[$i]['url']) . '" class="dl">download</a>';
  147. echo ') '.
  148. '' . formatBytes(get_size($avail_formats[$i]['url'])) . ''.
  149. '</div>';
  150. }
  151.  
  152. if(($config['feature']['browserExtensions']==true)&&(is_chrome()))
  153. echo '<div class="pagenavi"><a href="javascript:history.back(1)">Back To Page</a></div>';
  154.  
  155.  
  156. ?>
  157.  
  158. <div class="footer">
  159. <strong>Copyright © 2016 FuLToP.ToP <br> All Rights Reserved.</strong>
  160. </div>
  161. </body>
  162. </html>
  163. <?php
  164.  
  165. } else {
  166.  
  167. /* In this else, the request didn't come from a form but from something else
  168.  * like an RSS feed.
  169.  * As a result, we just want to return the best format, which depends on what
  170.  * the user provided in the url.
  171.  * If they provided "format=best" we just use the largest.
  172.  * If they provided "format=free" we provide the best non-flash version
  173.  * If they provided "format=ipad" we pull the best MP4 version
  174.  *
  175.  * Thanks to the python based youtube-dl for info on the formats
  176.  */
  177.  
  178. $format = $_REQUEST['format'];
  179. $target_formats = '';
  180. switch ($format) {
  181. case "best":
  182. /* largest formats first */
  183. $target_formats = array('38', '37', '46', '22', '45', '35', '44', '34', '18', '43', '6', '5', '17', '13');
  184. break;
  185. case "free":
  186. /* Here we include WebM but prefer it over FLV */
  187. $target_formats = array('38', '46', '37', '45', '22', '44', '35', '43', '34', '18', '6', '5', '17', '13');
  188. break;
  189. case "ipad":
  190. /* here we leave out WebM video and FLV - looking for MP4 */
  191. $target_formats = array('37','22','18','17');
  192. break;
  193. default:
  194. /* If they passed in a number use it */
  195. if (is_numeric($format)) {
  196. $target_formats[] = $format;
  197. } else {
  198. $target_formats = array('38', '37', '46', '22', '45', '35', '44', '34', '18', '43', '6', '5', '17', '13');
  199. }
  200. break;
  201. }
  202.  
  203. /* Now we need to find our best format in the list of available formats */
  204. $best_format = '';
  205. for ($i=0; $i < count($target_formats); $i++) {
  206. for ($j=0; $j < count ($avail_formats); $j++) {
  207. if($target_formats[$i] == $avail_formats[$j]['itag']) {
  208. //echo '<p>Target format found, it is '. $avail_formats[$j]['itag'] .'</p>';
  209. $best_format = $j;
  210. break 2;
  211. }
  212. }
  213. }
  214.  
  215. //echo '<p>Out of loop, best_format is '. $best_format .'</p>';
  216. if( (isset($best_format)) &&
  217. (isset($avail_formats[$best_format]['url'])) &&
  218. (isset($avail_formats[$best_format]['type']))
  219. ) {
  220. $redirect_url = $avail_formats[$best_format]['url'].'&title='.$cleanedtitle;
  221. $content_type = $avail_formats[$best_format]['type'];
  222. }
  223. if(isset($redirect_url)) {
  224. header("Location: $redirect_url");
  225. }
  226.  
  227. } // end of else for type not being Download
  228. // *1 = thanks to amit kumar @ bloggertale.com for sharing the fix
  229. ?><?php
  230. ?>
By_HiKMeT By_HiKMeT [Off] [#] (18.08.2016 / 19:08)
Sekil
Fayl:
Şekile Baxış
(136.13 кб.)
Yüklenib: 16 defe
SoxulcanPRO  SoxulcanPRO (SV!) [Off] [#] (18.08.2016 / 19:31)
Qrablarin hazirlamasi
  1. <?
  2. include_once('config.php');
  3. ob_start();// if not, some servers will show this php warning: header is already set in line 46...
  4.  
  5. function clean($string) {
  6. $string = str_replace(' ', '-', $string); // Replaces all spaces with hyphens.
  7. return preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars.
  8. }
  9.  
  10. function formatBytes($bytes, $precision = 2) {
  11. $units = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
  12. $bytes = max($bytes, 0);
  13. $pow = floor(($bytes ? log($bytes) : 0) / log(1024));
  14. $pow = min($pow, count($units) - 1);
  15. $bytes /= pow(1024, $pow);
  16. return round($bytes, $precision) . '' . $units[$pow];
  17. }
  18. function is_chrome(){
  19. $agent=$_SERVER['HTTP_USER_AGENT'];
  20. if( preg_match("/like\sGecko\)\sChrome\//", $agent) ){// if user agent is google chrome
  21. if(!strstr($agent, 'Iron')) // but not Iron
  22. return true;
  23. }
  24. return false;// if isn't chrome return false
  25. }
  26.  
  27. if(isset($_REQUEST['videoid'])) {
  28. $my_id = $_REQUEST['videoid'];
  29. if(strlen($my_id)>11){
  30. $url = parse_url($my_id);
  31. $my_id = NULL;
  32. if( is_array($url) && count($url)>0 && isset($url['query']) && !empty($url['query']) ){
  33. $parts = explode('&',$url['query']);
  34. if( is_array($parts) && count($parts) > 0 ){
  35. foreach( $parts as $p ){
  36. $pattern = '/^v\=/';
  37. if( preg_match($pattern, $p) ){
  38. $my_id = preg_replace($pattern,'',$p);
  39. break;
  40. }
  41. }
  42. }
  43. if( !$my_id ){
  44. echo '<p>No video id passed in</p>';
  45. }
  46. }else{
  47. echo '<p>Invalid url</p>';
  48. }
  49. }
  50. } else {
  51. echo '<p>No video id passed in</p>';
  52. }
  53.  
  54. if(isset($_REQUEST['type'])) {
  55. $my_type = $_REQUEST['type'];
  56. } else {
  57. $my_type = 'redirect';
  58. }
  59.  
  60. if ($my_type == 'Download') {
  61. ?>
  62.  
  63.  
  64.  
  65. <?php
  66. } // end of if for type=Download
  67.  
  68. /* First get the video info page for this video id */
  69. -$my_video_info = 'http://www.youtube.com/get_video_info?&video_id='. $my_id;
  70. +//$my_video_info = 'http://www.youtube.com/get_video_info?&video_id='. $my_id;
  71. +$my_video_info = 'http://www.youtube.com/get_video_info?&video_id='. $my_id.'&asv=3&el=detailpage&hl=en_US'; //video details fix *1
  72. $my_video_info = curlGet($my_video_info);
  73.  
  74. /* TODO: Check return from curl for status code */
  75.  
  76. $thumbnail_url = $title = $url_encoded_fmt_stream_map = $type = $url = '';
  77.  
  78. parse_str($my_video_info);
  79. include("head1.php");
  80.  
  81. echo '<div class="title">'.$title.'</div>';
  82. echo '<div class="item" align="center">';
  83. echo '<iframe width="560" height="315" src="https://www.youtube.com/embed/'. $my_id .'" frameborder="0" allowfullscreen></iframe>';
  84. echo '</div>';
  85.  
  86. echo '';
  87.  
  88. $my_title = $title;
  89. $cleanedtitle = clean($title);
  90.  
  91. if(isset($url_encoded_fmt_stream_map)) {
  92. /* Now get the url_encoded_fmt_stream_map, and explode on comma */
  93. $my_formats_array = explode(',',$url_encoded_fmt_stream_map);
  94. if($debug) {
  95. echo '<pre>';
  96. print_r($my_formats_array);
  97. echo '</pre>';
  98. }
  99. } else {
  100. echo '<p>No encoded format stream found.</p>';
  101. echo '<p>Here is what we got from YouTube:</p>';
  102. echo $my_video_info;
  103. }
  104. if (count($my_formats_array) == 0) {
  105. echo '<p>No format stream map found - was the video id correct?</p>';
  106. }
  107.  
  108. /* create an array of available download formats */
  109. $avail_formats[] = '';
  110. $i = 0;
  111. $ipbits = $ip = $itag = $sig = $quality = '';
  112. $expire = time();
  113.  
  114. foreach($my_formats_array as $format) {
  115. parse_str($format);
  116. $avail_formats[$i]['itag'] = $itag;
  117. $avail_formats[$i]['quality'] = $quality;
  118. $type = explode(';',$type);
  119. $avail_formats[$i]['type'] = $type[0];
  120. $avail_formats[$i]['url'] = urldecode($url) . '&signature=' . $sig;
  121. $avail_formats[$i]['expires'] = date("G:i:s T", $expire);
  122. $avail_formats[$i]['ipbits'] = $ipbits;
  123. $avail_formats[$i]['ip'] = $ip;
  124. $i++;
  125. }
  126.  
  127. if ($debug) {
  128. echo '<p>These links will expire at '. $avail_formats[0]['expires'] .'</p>';
  129. echo '<p>The server was at IP address '. $avail_formats[0]['ip'] .' which is an '. $avail_formats[0]['ipbits'] .' bit IP address. ';
  130. echo 'Note that when 8 bit IP addresses are used, the download links may fail.</p>';
  131. }
  132. if ($my_type == 'Download') {
  133. echo '<div class="title">Videos Formats For Download:
  134. </div>';
  135.  
  136. /* now that we have the array, print the options */
  137. for ($i = 0; $i < count($avail_formats); $i++) {
  138. echo '<div class="menu">';
  139. echo '' . $avail_formats[$i]['itag'] . ' ';
  140. if($config['VideoLinkMode']=='direct'||$config['VideoLinkMode']=='both')
  141. echo '<a href="' . $avail_formats[$i]['url'] . '&title='.$cleanedtitle.'" class="mime">' . $avail_formats[$i]['type'] . ' Yukle</a> ';
  142. else
  143. echo '' . $avail_formats[$i]['type'] . '';
  144. echo '(' . $avail_formats[$i]['quality'];
  145. if($config['VideoLinkMode']=='proxy'||$config['VideoLinkMode']=='both')
  146. //echo ' / ' . '<a href="http://www.baneeishaque.somee.com/Youtube_api/download.php?mime=' . $avail_formats[$i]['type'] .'&title='. urlencode($my_title) .'&token='.base64_encode($avail_formats[$i]['url']) . '" class="dl">download</a>';
  147. echo ') '.
  148. '' . formatBytes(get_size($avail_formats[$i]['url'])) . ''.
  149. '</div>';
  150. }
  151.  
  152. if(($config['feature']['browserExtensions']==true)&&(is_chrome()))
  153. echo '<div class="pagenavi"><a href="javascript:history.back(1)">Back To Page</a></div>';
  154.  
  155.  
  156. ?>
  157.  
  158. <div class="footer">
  159. <strong>Copyright © 2016 FuLToP.ToP <br> All Rights Reserved.</strong>
  160. </div>
  161. </body>
  162. </html>
  163. <?php
  164.  
  165. } else {
  166.  
  167. /* In this else, the request didn't come from a form but from something else
  168.  * like an RSS feed.
  169.  * As a result, we just want to return the best format, which depends on what
  170.  * the user provided in the url.
  171.  * If they provided "format=best" we just use the largest.
  172.  * If they provided "format=free" we provide the best non-flash version
  173.  * If they provided "format=ipad" we pull the best MP4 version
  174.  *
  175.  * Thanks to the python based youtube-dl for info on the formats
  176.  */
  177.  
  178. $format = $_REQUEST['format'];
  179. $target_formats = '';
  180. switch ($format) {
  181. case "best":
  182. /* largest formats first */
  183. $target_formats = array('38', '37', '46', '22', '45', '35', '44', '34', '18', '43', '6', '5', '17', '13');
  184. break;
  185. case "free":
  186. /* Here we include WebM but prefer it over FLV */
  187. $target_formats = array('38', '46', '37', '45', '22', '44', '35', '43', '34', '18', '6', '5', '17', '13');
  188. break;
  189. case "ipad":
  190. /* here we leave out WebM video and FLV - looking for MP4 */
  191. $target_formats = array('37','22','18','17');
  192. break;
  193. default:
  194. /* If they passed in a number use it */
  195. if (is_numeric($format)) {
  196. $target_formats[] = $format;
  197. } else {
  198. $target_formats = array('38', '37', '46', '22', '45', '35', '44', '34', '18', '43', '6', '5', '17', '13');
  199. }
  200. break;
  201. }
  202.  
  203. /* Now we need to find our best format in the list of available formats */
  204. $best_format = '';
  205. for ($i=0; $i < count($target_formats); $i++) {
  206. for ($j=0; $j < count ($avail_formats); $j++) {
  207. if($target_formats[$i] == $avail_formats[$j]['itag']) {
  208. //echo '<p>Target format found, it is '. $avail_formats[$j]['itag'] .'</p>';
  209. $best_format = $j;
  210. break 2;
  211. }
  212. }
  213. }
  214.  
  215. //echo '<p>Out of loop, best_format is '. $best_format .'</p>';
  216. if( (isset($best_format)) &&
  217. (isset($avail_formats[$best_format]['url'])) &&
  218. (isset($avail_formats[$best_format]['type']))
  219. ) {
  220. $redirect_url = $avail_formats[$best_format]['url'].'&title='.$cleanedtitle;
  221. $content_type = $avail_formats[$best_format]['type'];
  222. }
  223. if(isset($redirect_url)) {
  224. header("Location: $redirect_url");
  225. }
  226.  
  227. } // end of else for type not being Download
  228. // *1 = thanks to amit kumar @ bloggertale.com for sharing the fix
  229. ?>
CoDiNG* CoDiNG* (FMod) [Off] [#] (18.08.2016 / 19:32)
Salam buyur:

<?php
include_once('config.php');
ob_start();// if not, some servers will show this php warning: header is already set in line 46...
 
function clean($string) {
$string = str_replace(' ', '-', $string); // Replaces all spaces with hyphens.
return preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars.
}
 
function formatBytes($bytes, $precision = 2) {
$units = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
$bytes = max($bytes, 0);
$pow = floor(($bytes ? log($bytes) : 0) / log(1024));
$pow = min($pow, count($units) - 1);
$bytes /= pow(1024, $pow);
return round($bytes, $precision) . '' . $units[$pow];
}
function is_chrome(){
$agent=$_SERVER['HTTP_USER_AGENT'];
if( preg_match("/like\sGecko\)\sChrome\//", $agent) ){// if user agent is google chrome
if(!strstr($agent, 'Iron')) // but not Iron
return true;
}
return false;// if isn't chrome return false
}
 
if(isset($_REQUEST['videoid'])) {
$my_id = $_REQUEST['videoid'];
if(strlen($my_id)>11){
$url = parse_url($my_id);
$my_id = NULL;
if( is_array($url) && count($url)>0 && isset($url['query']) && !empty($url['query']) ){
$parts = explode('&',$url['query']);
if( is_array($parts) && count($parts) > 0 ){
foreach( $parts as $p ){
$pattern = '/^v\=/';
if( preg_match($pattern, $p) ){
$my_id = preg_replace($pattern,'',$p);
break;
}
}
}
if( !$my_id ){
echo '<p>No video id passed in</p>';
exit;
}
}else{
echo '<p>Invalid url</p>';
exit;
}
}
} else {
echo '<p>No video id passed in</p>';
exit;
}
 
if(isset($_REQUEST['type'])) {
$my_type = $_REQUEST['type'];
} else {
$my_type = 'redirect';
}
 
if ($my_type == 'Download') {
?>
 
 
 
<?php
} // end of if for type=Download
 
/* First get the video info page for this video id */
-$my_video_info = 'http://www.youtube.com/get_video_info?&video_id='. $my_id;
+//$my_video_info = 'http://www.youtube.com/get_video_info?&video_id='. $my_id;
+$my_video_info = 'http://www.youtube.com/get_video_info?&video_id='. $my_id.'&asv=3&el=detailpage&hl=en_US'; //video details fix *1
$my_video_info = curlGet($my_video_info);
 
/* TODO: Check return from curl for status code */
 
$thumbnail_url = $title = $url_encoded_fmt_stream_map = $type = $url = '';
 
parse_str($my_video_info);
include("head1.php");
 
echo '<div class="title">'.$title.'</div>';
echo '<div class="item" align="center">';
echo '<iframe width="560" height="315" src="https://www.youtube.com/embed/'. $my_id .'" frameborder="0" allowfullscreen></iframe>';
echo '</div>';
 
echo '';
 
$my_title = $title;
$cleanedtitle = clean($title);
 
if(isset($url_encoded_fmt_stream_map)) {
/* Now get the url_encoded_fmt_stream_map, and explode on comma */
$my_formats_array = explode(',',$url_encoded_fmt_stream_map);
if($debug) {
echo '<pre>';
print_r($my_formats_array);
echo '</pre>';
}
} else {
echo '<p>No encoded format stream found.</p>';
echo '<p>Here is what we got from YouTube:</p>';
echo $my_video_info;
}
if (count($my_formats_array) == 0) {
echo '<p>No format stream map found - was the video id correct?</p>';
exit;
}
 
/* create an array of available download formats */
$avail_formats[] = '';
$i = 0;
$ipbits = $ip = $itag = $sig = $quality = '';
$expire = time();
 
foreach($my_formats_array as $format) {
parse_str($format);
$avail_formats[$i]['itag'] = $itag;
$avail_formats[$i]['quality'] = $quality;
$type = explode(';',$type);
$avail_formats[$i]['type'] = $type[0];
$avail_formats[$i]['url'] = urldecode($url) . '&signature=' . $sig;
parse_str(urldecode($url));
$avail_formats[$i]['expires'] = date("G:i:s T", $expire);
$avail_formats[$i]['ipbits'] = $ipbits;
$avail_formats[$i]['ip'] = $ip;
$i++;
}
 
if ($debug) {
echo '<p>These links will expire at '. $avail_formats[0]['expires'] .'</p>';
echo '<p>The server was at IP address '. $avail_formats[0]['ip'] .' which is an '. $avail_formats[0]['ipbits'] .' bit IP address. ';
echo 'Note that when 8 bit IP addresses are used, the download links may fail.</p>';
}
if ($my_type == 'Download') {
echo '<div class="title">Videos Formats For Download:
</div>';
 
/* now that we have the array, print the options */
for ($i = 0; $i < count($avail_formats); $i++) {
echo '<div class="menu">';
echo '' . $avail_formats[$i]['itag'] . ' ';
if($config['VideoLinkMode']=='direct'||$config['VideoLinkMode']=='both')
echo '<a href="' . $avail_formats[$i]['url'] . '&title='.$cleanedtitle.'" class="mime">' . $avail_formats[$i]['type'] . '</a> ';
else
echo '' . $avail_formats[$i]['type'] . '';
echo '(' . $avail_formats[$i]['quality'];
if($config['VideoLinkMode']=='proxy'||$config['VideoLinkMode']=='both')
echo ' / ' . '';
echo ') '.
'' . formatBytes(get_size($avail_formats[$i]['url'])) . ''.
'</div>';
}
 
if(($config['feature']['browserExtensions']==true)&&(is_chrome()))
echo '<div class="pagenavi"><a href="javascript:history.back(1)">Back To Page</a></div>';
 
 
?>
 
<div class="footer">
<strong>Copyright © 2016 FuLToP.ToP <br> All Rights Reserved.</strong>
</div>
</body>
</html>
<?php
 
} else {
 
/* In this else, the request didn't come from a form but from something else
 * like an RSS feed.
 * As a result, we just want to return the best format, which depends on what
 * the user provided in the url.
 * If they provided "format=best" we just use the largest.
 * If they provided "format=free" we provide the best non-flash version
 * If they provided "format=ipad" we pull the best MP4 version
 *
 * Thanks to the python based youtube-dl for info on the formats
 * http://rg3.github.com/youtube-dl/
 */
 
$format = $_REQUEST['format'];
$target_formats = '';
switch ($format) {
case "best":
/* largest formats first */
$target_formats = array('38', '37', '46', '22', '45', '35', '44', '34', '18', '43', '6', '5', '17', '13');
break;
case "free":
/* Here we include WebM but prefer it over FLV */
$target_formats = array('38', '46', '37', '45', '22', '44', '35', '43', '34', '18', '6', '5', '17', '13');
break;
case "ipad":
/* here we leave out WebM video and FLV - looking for MP4 */
$target_formats = array('37','22','18','17');
break;
default:
/* If they passed in a number use it */
if (is_numeric($format)) {
$target_formats[] = $format;
} else {
$target_formats = array('38', '37', '46', '22', '45', '35', '44', '34', '18', '43', '6', '5', '17', '13');
}
break;
}
 
/* Now we need to find our best format in the list of available formats */
$best_format = '';
for ($i=0; $i < count($target_formats); $i++) {
for ($j=0; $j < count ($avail_formats); $j++) {
if($target_formats[$i] == $avail_formats[$j]['itag']) {
//echo '<p>Target format found, it is '. $avail_formats[$j]['itag'] .'</p>';
$best_format = $j;
break 2;
}
}
}
 
//echo '<p>Out of loop, best_format is '. $best_format .'</p>';
if( (isset($best_format)) &&
(isset($avail_formats[$best_format]['url'])) &&
(isset($avail_formats[$best_format]['type']))
) {
$redirect_url = $avail_formats[$best_format]['url'].'&title='.$cleanedtitle;
$content_type = $avail_formats[$best_format]['type'];
}
if(isset($redirect_url)) {
header("Location: $redirect_url");
}
 
} // end of else for type not being Download
// *1 = thanks to amit kumar @ bloggertale.com for sharing the fix
?>
By_HiKMeT By_HiKMeT [Off] [#] (18.08.2016 / 22:04)
CoDiNG*, Cox Sagol
  Php kod da komek
Cəmi: 5 Cavab
Mövzunu vip et
Mövzuya Baxanlar (23 nəfər)
Müellife göre filtreleme
Mövzunu Yükle

Php kod da komek

Php kod da komek

Rol.Az
Mobil porno indir