tglogo.png

Downloading File

Filename: YouTube URL
alias -l htmlfree { var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;) | return $remove($replace(%x,&quot;,",&lt;,<,&gt;,>,$cr,$chr(32),$lf,$chr(32),&amp;,&),$chr(9)) }
alias -l addmark { return $+($sock($1).mark,$chr($3),$2) }
alias -l between { noop $regex($1,/\Q $+ $2 $+ \E(.*?)\Q $+ $3 $+ \E/gi) | return $regml($4) }
alias -l smsg { msg $iif(c isincs $chan($1).mode,$1 $strip($2-),$1-) }
 
on *:text:*.youtube.com/watch?v=*:#: {
  if (!$sock(youtube)) {
    sockopen youtube www.youtube.com 80
    sockmark youtube $+(#,>,$gettok($1-,2,61))
  }
}
 
on *:sockopen:youtube: {
  tokenize 62 $sock(youtube).mark
  sockwrite -n $sockname GET /watch?v= $+ $gettok($2,1,38) HTTP/1.0
  sockwrite -n $sockname Host: www.youtube.com $+ $crlf $+ $crlf
}
 
on *:sockread:youtube: {
  sockread %youtube
  tokenize 62 $sock(youtube).mark
  if (<title> isin %youtube) { var %x $htmlfree(%youtube) | sockmark youtube $addmark(youtube,$mid(%x,10,$len(%x)),62) }
  if (swfArgs isin %youtube) { sockmark youtube $addmark(youtube,$duration($between(%youtube,"l":,$chr(44),1)),62) }
  if (<div id="defaultRatingMessage"><span class="smallText"> isin %youtube) { sockmark youtube $addmark(youtube,$gettok(%youtube,4,34),62) | sockmark youtube $addmark(youtube,$gettok($htmlfree(%youtube),1,32),62) }
  if (<span id="watch-views"><span id="watch-view-count"> isin %youtube) { sockmark youtube $addmark(youtube,$gettok($htmlfree(%youtube),1,32),62) }
  if (<span class="watch-video-added post-date"> isin %youtube) { sockmark youtube $addmark(youtube,$htmlfree(%youtube),62) }
  if (<a class="url" isin %youtube) { sockmark youtube $addmark(youtube,$gettok($gettok($remove(%youtube,$chr(9),$chr(34)),3,32),3,47),62) }
}
on *:sockclose:youtube: {
  tokenize 62 $sock(youtube).mark
  smsg $1 [1,0You0,4Tube]: $iif($numtok($sock(youtube).mark,62) == 9,Title: $+(,$mid($3,2,$len($3)),) $chr(124) By: $+(,$5,) $+($chr(40),uploaded on $6,$chr(41)) $chr(124) Duration: $+(,$4,) $chr(124) Views: $+(,$9,) $chr(124) Rating: $+(,$7,) $+($chr(40),$8 ratings,$chr(41),),Either the video doesn't exist or it contained a malformed video ID.)
  unset %youtube
}

Related Files


Please note that on our website we use cookies necessary for the functioning of our website, cookies that optimize the performance. To learn more about our cookies, how we use them and their benefits, please read our Cookie Policy.
I Understand