NEW Youtube Snippet

By ZabuzaMomochi on Jun 23, 2007

This is a snippet that fetches the first result when you search youtube for something.
Syntax: !Youtube texthere
I made this because of a request from a friend, and also since youtube made a new search layout its different, so the old youtube scripts dont work..

on *:text:!youtube*:#: {
  if ($sock(youtube)) .sockclose youtube
  set %Ychan $chan
  set %youtubetext $2-
  sockopen youtube youtube.com 80
}
on *:SOCKOPEN:youtube: {
  sockwrite -nt $sockname GET /results?search_query= $+ %youtubetext $+ &search= HTTP/1.1
  sockwrite -nt $sockname Host: youtube.com
  sockwrite -nt $sockname $crlf
}
on *:SOCKREAD:youtube: {
  if ($sockerr) {
    msg %chan Socket Error: $sockname $+ .
    halt
  }
  else {
    var %sockreader
    sockread %sockreader
    if (*newvtitlelink* iswm %sockreader) {
      noop $regex(%sockreader,/href="(.*?)" rel=/Si)
      set %youtube $regml(1)
      msg %Ychan Link: www.youtube.com $+ %youtube
      unset %Ychan
      sockclose youtube
    }
  }
}

Comments

Sign in to comment.
dma   -  Sep 14, 2017

this works fine

dma  -  Sep 15, 2017

this was just working and now it's not

Sign in to comment

Freckle   -  Jan 20, 2008

$replace(%youtubetext,$chr(32),+)

 Respond  
Mudkipz   -  Jan 20, 2008

this still wont work >.< most stripts on irc dont for me, but the ones iv been trying reacently have

 Respond  
lokicat   -  Jan 05, 2008

yeah how to fix the one word query problem?

 Respond  
guest598594   -  Jul 14, 2007

only lets me search one word

 Respond  
greenlanter420   -  Jun 24, 2007

seems nice what about making it post the top 3 results and maybe give some info on what the video is just a suggestion.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.