You need to use the -e switch for an ssl connection, and I don't know if the server would like an extra space after the host and before the $crlf.

Code:
alias youtube {
  sockopen -e ytube www.googleapis.com 443
}

on *:sockopen:ytube:{
  if ($sockerr) { 
    sockclose $sockname
    halt 
  }
  sockwrite -n $sockname GET /youtube/v3/playlistItems?part=id&playlistId=<playlist ID Here>&key=<api key here> HTTP/1.1
  sockwrite -n $sockname Host: www.googleapis.com
  sockwrite -n $sockname $crlf
  
  echo -tag socket write
}


This is a very basic sockread:
Code:
on *:sockread:ytube:{
  if ($sockerr) { return }
  var %read | sockread -f %read
  while ($sockbr) {
    if (%read != $null) echo -ag %read
    sockread -f %read
  }
}

Last edited by Loki12583; 24/07/14 03:13 AM.