also here's a debug-like version. you'll be able to see what point it gets to by the echo's.
Code:
on *:TEXT:!yt &:#: {  
  echo -a 1
  if ($sock(YTube)) .sockclose YTube
  set %link $2
  sockopen -e YTube www.youtube.com 443
}

on *:SOCKOPEN:YTube: {
  echo -a 2
  sockwrite -nt $sockname GET /watch?v= $+ %link HTTP/1.1
  sockwrite -nt $sockname Host: www.youtube.com $+ $str($crlf,2)
}

on *:SOCKREAD:YTube: {
  echo -a 3
  if (!$sockerr) {
    var %sockreader | sockread %sockreader
    tokenize 32 %sockreader
    echo -a error $1-
  }
  if ($regex(%sockreader,/"length_seconds":".+?"/)) {
    echo -a $1
    unset %link
    sockclose YTube
    echo -a regex
  }
}


EDIT:
i ran your script with LBr7kECsjcQ, and got these socket errors:
Quote:
error HTTP/1.1 301 Moved Permanently
3
error Date: Sun, 01 Feb 2015 02:34:23 GMT
3
error Server: gwiseguy/2.0
3
error Location: https://www.youtube.com/
3
error X-Frame-Options: SAMEORIGIN
3
error X-XSS-Protection: 1; mode=block; report=https://www.google.com/appserve/security-bugs/log/youtube
3
error Cache-Control: no-cache
3
error Content-Type: text/html; charset=utf-8
3
error Expires: Tue, 27 Apr 1971 19:44:06 EST
3
error P3P: CP="This is not a P3P policy! See http://support.google.com/accounts/answer/151657?hl=en for more info."
3
error X-Content-Type-Options: nosniff
3
error Set-Cookie: VISITOR_INFO1_LIVE=KbLAQ04pw8g; expires=Fri, 02-Oct-2015 14:27:23 GMT; path=/; domain=.youtube.com
3
error Set-Cookie: YSC=IJF3VIdZXqY; path=/; domain=.youtube.com; HttpOnly
3
error Alternate-Protocol: 443:quic,p=0.02
3
error Accept-Ranges: none
3
error Vary: Accept-Encoding
3
error Transfer-Encoding: chunked

Last edited by judge2020; 01/02/15 02:35 AM. Reason: edit

#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball