Jump to content

Archived

This topic is now archived and is closed to further replies.

chain

YouTube Script (Parse Vids and Search) v2.2

Recommended Posts

  • Administrators

YouTube Script (Parse Vids and Search) v2.2

 

t_62904_LBvZeV9NFzTqsCJHPscuewDLy

 

IMPORTANT:

I do not own youtube.com...

 

VERSIONS:

v1.0 (original) http://pastebin.com/ydjkA3E2 --Initial Upload (Search and Parse)

v2.1 http://pastebin.com/VaqPj282 -- Updated for youtu.be and included multiple links

v2.2 (current) http://pastebin.com/Xf3sJZ7G -- Update to remove some formatting [[$chr(31)]]

 

INFO:

April 25, 2011

My Second Snippet to post.

Just posting because it would be interesting to get some feedback.

I know no coding languages besides mSl and I am limited in that.

I can be contacted via reply.anonymouse+forward@gmail.com

I can be found at irc.rizon.net:6667 #rsbot_help name nick1

Quick Chat Link, feel free to leave a message for me http://t.ard.me/be or just to chat.

 

DIRECTIONS:

Copy entire code and paste into remote section of a new script (File

Used to automatically parse youtube links and give info either by an echo to you or via a channel message

Default is to message a channel with info only if you are an op or above, OR you have specified you want to by typing in the channel !youtube (to shut off use !noyoutube)

Search using @ysearch

Or search using commands such as @youtube

"!" commands will notice the user "@" commands will be public

 

Let me know when its broken//what you want changed.

 

--Feedback greatly appreciated

 

--If you don't like it lick it.

 

>;YouTube Script (Parse Vids and Search) v2.2;Made by nick1;Last edit June 2 2011 raw 408:*: msg $2 $remove($strip($13-),$chr(9)) on $*:text:/^[!@]y(outube|t|tsearch|search|ousearch|outubesearch)/Si:*:{  if ($($+(%,botflood.,$nick),2)) {    if ($($+(%,botflood.,$nick),2) >= 50) { ignore -u60 $address($nick,0) | msg $chan $+($nick,$chr(44)) You Have Been Put On Ignore For 60secs For Abusing The Bot. | halt }    elseif ($($+(%,botflood.,$nick),2) >= 40) { msg $chan $+($nick,$chr(44)) Please Do Not Abuse The Bot. | inc -z $+(%,botflood.,$nick) 20 | halt }    else { inc -z $+(%,botflood.,$nick) 25 }  }  else { inc -z $+(%,botflood.,$nick) 25 }  var %ticks $ticks  if ($2) {    set $+(%,ysearch.,%ticks,.msgtype) $iif($left($strip($1),1) == @,msg $chan,notice $nick)    set $+(%,ysearch.,%ticks,.search) $replace($2-,$chr(32),+)    sockopen $+(ysearch.,%ticks) youtube.com 80  }  elseif ($2 == $null) { msg $chan $+(4,$nick,,$chr(44)) 10Incorrect Syntax: Try ! or @ 4YOUTUBE10  }} on *:input:*:{  if (($remove($1,$left($strip($1),1)) == ysearch) || ($remove($1,$left($strip($1),1)) == ytsearch) || ($remove($1,$left($strip($1),1)) == yt) || ($remove($1,$left($strip($1),1)) == youtube) || ($remove($1,$left($strip($1),1)) == youtubesearch)) {    set $+(%,ysearch.,$ticks,.msgtype) msg $active    set $+(%,ysearch.,$ticks,.search) $replace($2-,$chr(32),+)    sockopen $+(ysearch.,$ticks) youtube.com 80  }  elseif (*youtube.com* iswm $1-) {    set %i 1    while (%i 12[4,YOUTUBE,12])10 Error Encountered! | unset %youtube.*  }} on *:sockopen:ysearch*: {    set %checksockname $sockname   .timerCheck 1 5 checkifsockopen   sockwrite -nt $sockname GET /results?search_query= $+ $($+(%,ysearch.,$remove($sockname,ysearch.),.search),2) HTTP/1.1  sockwrite -nt $sockname Host: www.youtube.com  sockwrite -nt $sockname $crlf} alias nohtml { return $regsubex($$1-,/^[^|]*>|]*$/g,) } on *:SOCKREAD:ysearch*: {   if ($sockerr) { echo -a SOCKET ERROR: $sockerr | halt }  sockread %sockreader  if (** iswm %sockreader) {    set $+(%,ysearch.,$remove($sockname,ysearch.),.title) $regsubex($nohtml($replace($remove(%sockreader,|),[b],,[/b],,",",&,&)),/(\d\d?\d?\d?);/g,$chr(\1))    tokenize 34 %sockreader    set $+(%,ysearch.,$remove($sockname,ysearch.),.tag) $2  }  elseif (*
,[/b],,",",&,&)),/(\d\d?\d?\d?);/g,$chr(\1))    tokenize 34 %sockreader    set $+(%,ysearch.,$remove($sockname,ysearch.),.tag) $4  }  elseif (** iswm %sockreader) {    set $+(%,ysearch.,$remove($sockname,ysearch.),.time) $nohtml($remove(%sockreader,Add to,Added,to,queue))  }  elseif (** iswm %sockreader) {    set $+(%,ysearch.,$remove($sockname,ysearch.),.user) $remove($nohtml(%sockreader),by)  }  elseif (** iswm %sockreader) {    set $+(%,ysearch.,$remove($sockname,ysearch.),.viewcount) $remove($nohtml(%sockreader),|,views)    $($+(%,ysearch.,$remove($sockname,ysearch.),.msgtype),2) 1,0You0,4Tube 10Link:4 http://youtube.com $+ $($+(%,ysearch.,$remove($sockname,ysearch.),.tag),2) 10Title:4 $($+(%,ysearch.,$remove($sockname,ysearch.),.title),2) 10Length:4 $($+(%,ysearch.,$remove($sockname,ysearch.),.time),2) 10Views:4 $($+(%,ysearch.,$remove($sockname,ysearch.),.viewcount),2) 10User:4 $($+(%,ysearch.,$remove($sockname,ysearch.),.user),2)    unset $+(%,ysearch.,$remove($sockname,ysearch.),*)    sockclose $sockname  }}   on $*:text:/youtu(.be|be.com)/Si:*: {  if (($chan != #nova) && ($nick != Runescript)) {    if ($($+(%,botflood.,$nick),2)) {      if ($($+(%,botflood.,$nick),2) >= 50) { ignore -u60 $address($nick,0) | msg $chan $+($nick,$chr(44)) You Have Been Put On Ignore For 60secs For Abusing The Bot. | halt }      elseif ($($+(%,botflood.,$nick),2) >= 40) { msg $chan $+($nick,$chr(44)) Please Do Not Abuse The Bot. | inc -z $+(%,botflood.,$nick) 20 | halt }      else { inc -z $+(%,botflood.,$nick) 10 }    }    else { inc -z $+(%,botflood.,$nick) 10 }    set %i 1    var %ticks $ticks    while (%i 12[4 $+ $($+(%,youtube.,$remove($sockname,youtube.),.chan),2) $+ 12] 1,0You0,4Tube 10Title:4 $($+(%,youtube.,$remove($sockname,youtube.),.title),2) 10Views:4 $($+(%,youtube.,$remove($sockname,youtube.),.viewcount),2) 10User:4 $($+(%,youtube.,$remove($sockname,youtube.),.user),2) 12From4 $($+(%,youtube.,$remove($sockname,youtube.),.nick),2) 10on12 $($+(%,youtube.,$remove($sockname,youtube.),.network),2)          else { $($+(%,youtube.,$remove($sockname,youtube.),.msgtype),2) 1,0You0,4Tube 10Title:4 $($+(%,youtube.,$remove($sockname,youtube.),.title),2) 10Views:4 $($+(%,youtube.,$remove($sockname,youtube.),.viewcount),2) 10User:4 $($+(%,youtube.,$remove($sockname,youtube.),.user),2) }      set %_youtube.last $($+(%,youtube.,$remove($sockname,youtube.),.tag),2)      unset $+(%,youtube.,$remove($sockname,youtube.),*)      sockclose youtube    }  }} 

Link to comment
Share on other sites

  • Administrators

ouTube Script (Parse Vids and Search) v2.3

 

    ;YouTube Script (Parse Vids and Search) v2.3

    ;Made by nick1

    ;Last edit June 13 2011

     

    raw 408:*: msg $2 $remove($strip($13-),$chr(9))

     

    on $*:text:/^[!@]y(outube|t|tsearch|search|ousearch|outubesearch)/Si:*:{

      if ($($+(%,botflood.,$nick),2)) {

        if ($($+(%,botflood.,$nick),2) >= 50) { ignore -u60 $address($nick,0) | msg $chan $+($nick,$chr(44)) You Have Been Put On Ignore For 60secs For Abusing The Bot. | halt }

        elseif ($($+(%,botflood.,$nick),2) >= 40) { msg $chan $+($nick,$chr(44)) Please Do Not Abuse The Bot. | inc -z $+(%,botflood.,$nick) 20 | halt }

        else { inc -z $+(%,botflood.,$nick) 25 }

      }

      else { inc -z $+(%,botflood.,$nick) 25 }

      var %ticks $ticks

      if ($2) {

        set $+(%,ysearch.,%ticks,.msgtype) $iif($left($strip($1),1) == @,msg $chan,notice $nick)

        set $+(%,ysearch.,%ticks,.search) $replace($2-,$chr(32),+)

        sockopen $+(ysearch.,%ticks) youtube.com 80

      }

      elseif ($2 == $null) { msg $chan $+(4,$nick,,$chr(44)) 10Incorrect Syntax: Try ! or @ 4YOUTUBE10  }

    }

     

    on *:input:*:{

      if (($remove($1,$left($strip($1),1)) == ysearch) || ($remove($1,$left($strip($1),1)) == ytsearch) || ($remove($1,$left($strip($1),1)) == yt) || ($remove($1,$left($strip($1),1)) == youtubesearch)) {

        set $+(%,ysearch.,$ticks,.msgtype) msg $active

        set $+(%,ysearch.,$ticks,.search) $replace($2-,$chr(32),+)

        sockopen $+(ysearch.,$ticks) youtube.com 80

      }

      elseif (*youtube.com* iswm $1-) {

        var %i 1

        while (%i 12[4,YOUTUBE,12])10 Error Encountered!

      }

    }

     

    on *:sockopen:ysearch*: {  

      set %checksockname $sockname

      .timerCheck 1 5 checkifsockopen

      sockwrite -nt $sockname GET /results?search_query= $+ $($+(%,ysearch.,$remove($sockname,ysearch.),.search),2) HTTP/1.1

      sockwrite -nt $sockname Host: www.youtube.com

      sockwrite -nt $sockname $crlf

    }

     

    alias nohtml { return $regsubex($$1-,/^[^|]*>|]*$/g,) }

     

    on *:SOCKREAD:ysearch*: {

      if ($sockerr) { echo -a SOCKET ERROR: $sockerr | halt }

      sockread %sockreader

      if (** iswm %sockreader) {

        set $+(%,ysearch.,$remove($sockname,ysearch.),.title) $regsubex($nohtml($replace($remove(%sockreader,|),[b],,[/b],,",",&,&)),/(\d\d?\d?\d?);/g,$chr(\1))

        tokenize 34 %sockreader

        set $+(%,ysearch.,$remove($sockname,ysearch.),.tag) $2

      }

      elseif (*

,[/b],,",",&,&)),/(\d\d?\d?\d?);/g,$chr(\1)) tokenize 34 %sockreader set $+(%,ysearch.,$remove($sockname,ysearch.),.tag) $4 } elseif (** iswm %sockreader) { set $+(%,ysearch.,$remove($sockname,ysearch.),.time) $nohtml($remove(%sockreader,Add to,Added,to,queue)) } elseif (** iswm %sockreader) { set $+(%,ysearch.,$remove($sockname,ysearch.),.user) $remove($nohtml(%sockreader),by) } elseif (** iswm %sockreader) { set $+(%,ysearch.,$remove($sockname,ysearch.),.viewcount) $remove($nohtml(%sockreader),|,views) $($+(%,ysearch.,$remove($sockname,ysearch.),.msgtype),2) 1,0You0,4Tube 10Link:4 http://youtube.com $+ $($+(%,ysearch.,$remove($sockname,ysearch.),.tag),2) 10Title:4 $($+(%,ysearch.,$remove($sockname,ysearch.),.title),2) 10Length:4 $($+(%,ysearch.,$remove($sockname,ysearch.),.time),2) 10Views:4 $($+(%,ysearch.,$remove($sockname,ysearch.),.viewcount),2) 10User:4 $($+(%,ysearch.,$remove($sockname,ysearch.),.user),2) unset $+(%,ysearch.,$remove($sockname,ysearch.),*) sockclose $sockname } } on $*:text:/youtu(.be|be.com)/Si:*: { if (($chan != #nova) && ($nick != Runescript)) { if ($($+(%,botflood.,$nick),2)) { if ($($+(%,botflood.,$nick),2) >= 50) { ignore -u60 $address($nick,0) | msg $chan $+($nick,$chr(44)) You Have Been Put On Ignore For 60secs For Abusing The Bot. | halt } elseif ($($+(%,botflood.,$nick),2) >= 40) { msg $chan $+($nick,$chr(44)) Please Do Not Abuse The Bot. | inc -z $+(%,botflood.,$nick) 20 | halt } else { inc -z $+(%,botflood.,$nick) 10 } } else { inc -z $+(%,botflood.,$nick) 10 } set %i 1 var %ticks $ticks while (%i 1,0You0,4Tube 10This content may contain material flagged by YouTube's user community that may be inappropriate for some users. } set %_youtube.last $($+(%,youtube.,$remove($sockname,youtube.),.tag),2) unset $+(%,youtube.,$remove($sockname,youtube.),*) sockclose youtube halt } elseif (*

Link to comment
Share on other sites



×
×
  • Create New...