Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Why do you want to reinvent the wheel? use Rapidleech script!</p> <p>Btw, if you still need to reinvent the wheel, here is source-code of the Youtube plugin of Rapidleech (it's highly readable:</p> <hr /> <pre><code>class youtube_com extends DownloadClass { /* Some blah blah about the age verification and erroneous URLs $fmt is quality/format number and is an integer */ public function Download($link) { $this-&gt;fmts = array(38,37,22,45,35,44,34,43,18,5,17); $yt_fmt = empty($_REQUEST['yt_fmt']) ? '' : $_REQUEST['yt_fmt']; $this-&gt;fmturlmaps = $this-&gt;GetVideosArr($fmt_url_maps); if (empty($yt_fmt) &amp;&amp; !isset($_GET["audl"])) return $this-&gt;QSelector($link); elseif (isset($_REQUEST['ytube_mp4']) &amp;&amp; $_REQUEST['ytube_mp4'] == 'on' &amp;&amp; !empty($yt_fmt)) { //look for and download the highest quality we can find? if ($yt_fmt == 'highest') { foreach ($this-&gt;fmts as $fmt) { if (array_key_exists($fmt, $this-&gt;fmturlmaps)) { $furl = $this-&gt;fmturlmaps[$fmt]; break; } } } else { //get the format the user specified (making sure it actually exists) if (!$furl = $this-&gt;fmturlmaps[$yt_fmt]) html_error ('Specified video format not found'); $fmt = $yt_fmt; } } else { //just get the one Youtube plays by default (in some cases it could also be the highest quality format) $fmt = key($this-&gt;fmturlmaps); $furl = $this-&gt;fmturlmaps[$fmt]; } if (preg_match ('%^5|34|35$%', $fmt)) $ext = '.flv'; elseif (preg_match ('%^17$%', $fmt)) $ext = '.3gp'; elseif (preg_match ('%^18|22|37|38$%', $fmt)) $ext = '.mp4'; elseif (preg_match ('%^43|44|45$%', $fmt)) $ext = '.webm'; else $ext = '.flv'; if (!preg_match('#&lt;title&gt;(.*)\s+-\sYouTube[\r|\n|\t|\s]*&lt;/title&gt;#Us', $this-&gt;page, $title)) html_error('No video title found! Download halted.'); if (!preg_match ('/video_id=(.+?)(\\\|"|&amp;|(\\\u0026))/', $this-&gt;page, $video_id)) html_error('Video id not found.'); $FileName = str_replace (Array ("\\", "/", ":", "*", "?", "\"", "&lt;", "&gt;", "|"), "_", html_entity_decode(trim($title[1]), ENT_QUOTES)) . "-[{$video_id[1]}][f$fmt]$ext"; if (stristr($furl, '|')) { $u_arr = explode('|', $furl); $furl = preg_replace('#://([^/]+)#', "://".$u_arr[2], $u_arr[0]); } if (isset($_REQUEST['ytdirect']) &amp;&amp; $_REQUEST['ytdirect'] == 'on') { echo "&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;&lt;a style='color:yellow' href='" . urldecode($furl) . "'&gt;Click here or copy the link to your download manager to download&lt;/a&gt;&lt;/h4&gt;"; echo "&lt;input name='dlurl' style='width: 1000px; border: 1px solid #55AAFF; background-color: #FFFFFF; padding:3px' value='" . urldecode($furl) . "' onclick='javascript:this.select();' readonly&gt;&lt;/input&gt;"; } else { $this-&gt;RedirectDownload (urldecode($furl), $FileName, $this-&gt;cookie, 0, 0, $FileName); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload