Advertisement
illpastethat

YouTube Script (Parse Vids and Search) v4.1

Feb 6th, 2012
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 19.68 KB | None | 0 0
  1. ;YouTube Script (Parse Vids and Search) v4.1
  2. ;Made by nick1
  3. ;Last edit February 06 2012
  4. ;For help type /YouTube in mIRC
  5. ;2D0 -- Download videos in a few formats [[possible?]], anything else?
  6. ;EDITS -- Added back bold search terms (youtube removed this - now manual),Returns an error message for takedown videos of copyright infringement,will parse annotation links,won't leave extra variables now, minor changes to dialog
  7.  
  8. menu status,channel,query {
  9.   YouTube:youtube
  10. }
  11. alias YouTube {
  12.   dialog -m YouTube YouTube
  13. }
  14.  
  15. dialog Youtube {
  16.   title "YouTube Script (Parse Vids and Search) v4.1"
  17.   size -1 -1 187 132
  18.   option dbu
  19.   icon $mircdir $+ Youtube.ico, 0
  20.   link "View Script On Hawkee -- Report Bugs Here", 1, 39 2 105 8
  21.   button "Exit", 7, 54 120 72 12, cancel
  22.   tab "About", 10, 1 9 183 106
  23.   button "On", 15, 20 98 37 12, tab 10
  24.   button "Off", 16, 120 98 37 12, tab 10
  25.   text "This script was created by nick1 (Rizon Network)", 18, 2 24 116 8, tab 10
  26.   text "Last updated on February 06, 2012", 19, 2 32 104 11, tab 10
  27.   text "Please post suggestions, complaints, or bugs on the hawkee link", 20, 2 41 167 8, tab 10
  28.   text "The script automatically will attempt to protect itself from spam", 21, 2 50 174 8, tab 10
  29.   text "!commands will notice the user; @commands will be public to the channel", 13, 2 79 175 8, tab 10
  30.   text "On/Off Buttons will Enable/Disable the entire script", 17, 26 90 135 7, tab 10
  31.   text "By default the script will run on every channel. To disable for a channel use the Channel Settings tab.", 65, 2 59 176 21, tab 10
  32.   link "Chat Here", 66, 120 24 30 8, tab 10
  33.   tab "Parse", 11
  34.   button "On", 111, 20 98 37 12, tab 11
  35.   button "Off", 9, 120 98 37 12, tab 11
  36.   text "This part of the script will automatically find youtube links that other people post and message the channel with info about the video.", 22, 3 26 177 14, tab 11
  37.   text "The script will return the following information: Title, Views, and User. ", 23, 3 43 174 10, tab 11
  38.   text "There is automatic flood protection enabled so the script will not process the same link twice in a row", 24, 3 56 179 13, tab 11
  39.   text "On/Off Buttons will Enable/Disable the parsing section of the script", 25, 8 90 162 7, tab 11
  40.   tab "Search", 2
  41.   button "On", 5, 20 98 37 12, tab 2
  42.   button "Off", 14, 120 98 37 12, tab 2
  43.   text "This part of the script will automatically find the most relevant YouTube video to the provided search terms.", 57, 4 24 174 13, tab 2
  44.   text "The script will return the following information: Link, Title, Length, Views, and User.", 58, 4 40 176 13, tab 2
  45.   text "Commands may be prefixed with an ! or an @; with !commands private and @commands public to the channel.", 59, 4 54 176 13, tab 2
  46.   box "Search Commands -- Prefix With ! or @ --", 60, 4 68 175 22, tab 2
  47.   text "On/Off Buttons will Enable/Disable the search section of the script", 61, 8 90 159 7, tab 2
  48.   text "ysearch <search terms>; ytsearch <search terms>;youtube <search terms>", 62, 15 75 156 14, tab 2
  49.   tab "Channel Settings", 3
  50.   list 6, 7 56 168 54, tab 3 sort size extsel vsbar
  51.   edit "", 8, 4 24 140 25, tab 3 multi return autohs autovs
  52.   text "List of channels the script will NOT run on", 12, 27 49 101 7, tab 3
  53.   button "Add", 4, 145 25 37 12, tab 3
  54.   button "Remove", 63, 145 38 37 12, tab 3
  55.   button "Click here to enter #channels ...", 64, 5 25 138 23, tab 3
  56.   tab "Just For Fun", 26
  57.   text "See if you can check all the checkboxes! Warning: there might not be a reward.", 27, 22 50 144 17, tab 26
  58.   check "Check Box", 28, 4 23 50 10, tab 26
  59.   check "Check Box", 29, 5 33 50 10, tab 26
  60.   check "Check Box", 30, 39 23 50 10, tab 26
  61.   check "Check Box", 31, 24 31 50 10, tab 26
  62.   check "Check Box", 32, 3 41 50 10, tab 26
  63.   check "Check Box", 33, 15 78 50 10, tab 26
  64.   check "Check Box", 34, 73 80 50 10, tab 26
  65.   check "Check Box", 35, 84 71 50 10, tab 26
  66.   check "Check Box", 36, 91 29 50 10, tab 26
  67.   check "Check Box", 37, 122 80 50 10, tab 26
  68.   check "Check Box", 38, 129 98 50 10, tab 26
  69.   check "Check Box", 39, 79 90 50 10, tab 26
  70.   check "Check Box", 40, 26 91 50 10, tab 26
  71.   check "Check Box", 41, 109 65 50 10, tab 26
  72.   check "Check Box", 42, 125 56 50 10, tab 26
  73.   check "Check Box", 43, 127 30 50 10, tab 26
  74.   check "Check Box", 44, 120 22 50 10, tab 26
  75.   check "Check Box", 45, 44 35 50 10, tab 26
  76.   check "Check Box", 46, 78 39 50 10, tab 26
  77.   check "Check Box", 47, 128 88 50 10, tab 26
  78.   check "Check Box", 48, 11 66 50 10, tab 26
  79.   check "Check Box", 49, 23 99 50 10, tab 26
  80.   check "Check Box", 50, 36 67 50 10, tab 26
  81.   check "Check Box", 51, 127 71 50 10, tab 26
  82.   check "Check Box", 52, 76 61 50 10, tab 26
  83.   check "Check Box", 53, 132 40 50 10, tab 26
  84.   check "Check Box", 54, 45 97 50 10, tab 26
  85.   check "Check Box", 55, 87 96 50 10, tab 26
  86.   check "Check Box", 56, 30 81 50 10, tab 26
  87. }
  88.  
  89. on *:dialog:youtube:init:0: {
  90.   FillChannelBox
  91. }
  92.  
  93. alias FillChannelBox {
  94.   did -r youtube 6
  95.   var %y 1
  96.   while (%y <= $numtok(%youtubefetch,44)) {
  97.     did -a youtube 6 $gettok(%youtubefetch,%y,44)
  98.     inc %y
  99.   }
  100. }
  101.  
  102. on *:dialog:youtube:sclick:*: {
  103.   if ($did == 1) {
  104.     run http://www.hawkee.com/snippet/8577/
  105.   }
  106.   elseif ($did == 66) {
  107.     run https://qchat.rizon.net/?&channels=#rsbot_help&nick=YouTube..
  108.   }
  109.   elseif ($did == 15) {
  110.     enable #search
  111.     enable #parse
  112.   }
  113.   elseif ($did == 16) {
  114.     disable #search
  115.     disable #parse
  116.   }
  117.   elseif ($did == 111) {
  118.     enable #parse
  119.   }
  120.   elseif ($did == 9) {
  121.     disable #parse
  122.   }
  123.   elseif ($did == 5) {
  124.     enable #search
  125.   }
  126.   elseif ($did == 14) {
  127.     disable #search
  128.   }
  129.   elseif ($did == 4) {
  130.     set %youtubefetch $addtok(%youtubefetch,$iif(($left($did(8),1) == $chr(35)),$did(8),$+($chr(35),$did(8))),44)
  131.     did -r youtube 8
  132.     FillChannelBox
  133.   }
  134.   elseif ($did == 63) {
  135.     if ($did(8) != $null) {
  136.       set %youtubefetch $remtok(%youtubefetch,$iif(($left($did(8),1) == $chr(35)),$did(8),$+($chr(35),$did(8))),44)
  137.       did -r youtube 8
  138.     }
  139.     if ($did(6).seltext != $null) {
  140.       set %youtubefetch $remtok(%youtubefetch,$did(6).seltext,44)
  141.     }
  142.     FillChannelBox
  143.   }
  144.   elseif ($did isnum 28-56) {
  145.     $iif(($r(1,3) == 1),.timercheck -m 1 13 did -c youtube $r(28,56),.timeruncheck -m 1 13 did -u youtube $r(28,56))
  146.   }
  147. }
  148.  
  149. raw 408:*: msg $2 $remove($strip($13-),$chr(9))
  150.  
  151. #search on
  152. on $*:text:/^[!@]y(outube|t|tsearch|search|ousearch|outubesearch)/Si:*: {
  153.   $iif($istok(%youtubefetch,$chan,44),halt,noop)
  154.   if ($($+(%,botflood.,$nick),2)) {
  155.     if ($($+(%,botflood.,$nick),2) >= 50) {
  156.       ignore -u60 $address($nick,2)
  157.       msg $chan $+($nick,$chr(44)) You have been put on ignore for 60secs for abusing the bot.
  158.       halt
  159.     }
  160.     elseif ($($+(%,botflood.,$nick),2) >= 40) {
  161.       msg $chan $+($nick,$chr(44)) Please do not flood the bot.
  162.       inc -z $+(%,botflood.,$nick) 20
  163.       halt
  164.     }
  165.     else {
  166.       inc -z $+(%,botflood.,$nick) 25
  167.     }
  168.   }
  169.   else {
  170.     inc -z $+(%,botflood.,$nick) 25
  171.   }
  172.   var %ticks $ticks
  173.   if ($2) {
  174.     set $+(%,ysearch.,%ticks,.msgtype) $iif($chan,$iif($left($strip($1),1) == @,msg $chan,notice $nick),msg $nick)
  175.     set $+(%,ysearch.,%ticks,.search) $replace($2-,$chr(32),+)
  176.     sockopen $+(ysearch.,%ticks) youtube.com 80
  177.   }
  178.   elseif ($2 == $null) {
  179.     notice $nick 4Incorrect Syntax - Use10 $1 <search term>
  180.   }
  181. }
  182.  
  183. on *:input:*:{
  184.   if (($remove($1,$left($strip($1),1)) == ysearch) || ($remove($1,$left($strip($1),1)) == ytsearch) || ($remove($1,$left($strip($1),1)) == youtube) || ($remove($1,$left($strip($1),1)) == yt) || ($remove($1,$left($strip($1),1)) == youtubesearch)) {
  185.     if ($left($1,1) != /) {
  186.       if ($2 != $null) {
  187.         set $+(%,ysearch.,$ticks,.msgtype) msg $active
  188.         set $+(%,ysearch.,$ticks,.search) $replace($2-,$chr(32),+)
  189.         sockopen $+(ysearch.,$ticks) youtube.com 80
  190.       }
  191.       elseif ($2 == $null) {
  192.         .timerYTInputSyntax -m 1 100 echo -at 4Incorrect Syntax - Use10 $1 <search term>
  193.       }
  194.     }
  195.   }
  196.   elseif ((*youtube.com* iswm $1-) || (*youtu.be* iswm $1-)) {
  197.     if ($left($1,1) != /) {
  198.       var %i 1
  199.       while (%i <= $numtok($1-,32)) {
  200.         if ((*youtube.com* iswm $($+($,%i),2)) || (*youtu.be* iswm $($+($,%i),2))) {
  201.           set $+(%,youtube.,$ticks,.url) $($+($,%i),2)
  202.           set $+(%,youtube.,$ticks,.tag) $remove($strip($($+($,%i),2)),feature=player_embedded&,feature=endscreen&,/watch?src_vid=,&fmt=22,&sns=fb,&fmt=18,https://,http://,www.,/v/,youtube.com,youtu.be,youtu.be/,/watch?v=,/watch,?v=,$chr(31),&feature=feedu,#!,&feature=relmfu,&NR=1)
  203.         }
  204.         inc %i
  205.       }
  206.       if ($($+(%,youtube.,$ticks,.tag),2) == $null) {
  207.         unset $+(%,youtube.,$ticks,.*)
  208.       }
  209.       else {
  210.         set $+(%,youtube.,$ticks,.msgtype) msg $active
  211.         set $+(%,youtube.,$ticks,.nick) $nick
  212.         set $+(%,youtube.,$ticks,.chan) $chan
  213.         set $+(%,youtube.,$ticks,.network) $network
  214.         $iif($istok(%youtubefetch,$chan,44),unset $+(%,youtube.,$ticks,.*),sockopen $+(youtube.,$ticks) youtube.com 80)
  215.       }
  216.     }
  217.   }
  218.   elseif (($1 == !youtubelinks) || ($1 == !youtubefetch)) {
  219.     set %youtubefetch $remtok(%youtubefetch,$iif(($2),$2,$chan),44)
  220.     echo -ac info I will message $iif(($2),$2,$chan) with youtube info...
  221.   }
  222.   elseif (($1 == !noyoutubelinks) || ($1 == !noyoutubefetch)) {
  223.     set %youtubefetch $addtok(%youtubefetch,$iif(($2),$2,$chan),44)
  224.     echo -ac info I won't message $iif(($2),$2,$chan) with youtube info...
  225.   }
  226. }
  227.  
  228. on *:sockopen:ysearch*: {  
  229.   sockwrite -nt $sockname GET $+(/results?search_query=,$($+(%,ysearch.,$remove($sockname,ysearch.),.search),2)) HTTP/1.1
  230.   sockwrite -nt $sockname Host: www.youtube.com
  231.   sockwrite -nt $sockname $crlf
  232. }
  233.  
  234. alias nohtml { return $regsubex($$1-,/^[^<]*>|<[^>]*>|<[^>]*$/g,) }
  235.  
  236. on *:SOCKREAD:ysearch*: {
  237.   if ($sockerr) { echo -a SOCKET ERROR: $sockerr | halt }
  238.   sockread %sockreader
  239.   if (*<h3>* iswm %sockreader) {
  240.     set $+(%,ysearch.,$remove($sockname,ysearch.),.title) $iif($nohtml($replace($remove(%sockreader,|),<b>,,</b>,,&quot;,",&#39;,',&amp;,&)) != $null,$nohtml($replace($remove(%sockreader,|),<b>,,</b>,,&quot;,",&#39;,',&amp;,&)),&N0T1TLE&)
  241.     var %i 0
  242.     while (%i <= $numtok($($+(%,ysearch.,$remove($sockname,ysearch.),.search),2),43)) {
  243.       inc %i
  244.       set $+(%,ysearch.,$remove($sockname,ysearch.),.title) $regsubex($($+(%,ysearch.,$remove($sockname,ysearch.),.title),2), /\b( $gettok($($+(%,ysearch.,$remove($sockname,ysearch.),.search),2),%i,43) )\b/gix, $+($chr(2), \1, $chr(2)))
  245.     }
  246.     tokenize 34 %sockreader
  247.     set $+(%,ysearch.,$remove($sockname,ysearch.),.tag) $remove($2,/watch?v=)
  248.     tokenize 38 $($+(%,ysearch.,$remove($sockname,ysearch.),.tag),2)
  249.     set $+(%,ysearch.,$remove($sockname,ysearch.),.tag) $1
  250.   }
  251.   elseif ($($+(%,ysearch.,$remove($sockname,ysearch.),.title),2) === &N0T1TLE&) {
  252.     set $+(%,ysearch.,$remove($sockname,ysearch.),.title) !*NOTITLE*!
  253.     var %i 0
  254.     while (%i <= $numtok($($+(%,ysearch.,$remove($sockname,ysearch.),.search),2),43)) {
  255.       inc %i
  256.       set $+(%,ysearch.,$remove($sockname,ysearch.),.title) $regsubex($($+(%,ysearch.,$remove($sockname,ysearch.),.title),2), /\b( $gettok($($+(%,ysearch.,$remove($sockname,ysearch.),.search),2),%i,43) )\b/gix, $+($chr(2), \1, $chr(2)))
  257.     }
  258.   }
  259.   elseif ($($+(%,ysearch.,$remove($sockname,ysearch.),.title),2) === !*NOTITLE*!) {
  260.     set $+(%,ysearch.,$remove($sockname,ysearch.),.title) $nohtml($replace($remove(%sockreader,|),<b>,,</b>,,&quot;,",&#39;,',&amp;,&))
  261.     var %i 0
  262.     while (%i <= $numtok($($+(%,ysearch.,$remove($sockname,ysearch.),.search),2),43)) {
  263.       inc %i
  264.       set $+(%,ysearch.,$remove($sockname,ysearch.),.title) $regsubex($($+(%,ysearch.,$remove($sockname,ysearch.),.title),2), /\b( $gettok($($+(%,ysearch.,$remove($sockname,ysearch.),.search),2),%i,43) )\b/gix, $+($chr(2), \1, $chr(2)))
  265.     }
  266.   }
  267.   elseif (*</div><h3* iswm %sockreader) {
  268.     set $+(%,ysearch.,$remove($sockname,ysearch.),.title) $regsubex($nohtml($replace($remove(%sockreader,|),<b>,,</b>,,&quot;,",&#39;,',&amp;,&)),/&#(\d\d?\d?\d?);/g,$chr(\1))
  269.     tokenize $($+(%,ysearch.,$remove($sockname,ysearch.),.search),2) 32
  270.     var %i 0
  271.     while (%i <= $numtok($($+(%,ysearch.,$remove($sockname,ysearch.),.search),2),43)) {
  272.       inc %i
  273.       set $+(%,ysearch.,$remove($sockname,ysearch.),.title) $regsubex($($+(%,ysearch.,$remove($sockname,ysearch.),.title),2), /\b( $gettok($($+(%,ysearch.,$remove($sockname,ysearch.),.search),2),%i,43) )\b/gix, $+($chr(2), \1, $chr(2)))
  274.     }
  275.     tokenize 34 %sockreader
  276.     set $+(%,ysearch.,$remove($sockname,ysearch.),.tag) $remove($4,/watch?v=)
  277.     tokenize 38 $($+(%,ysearch.,$remove($sockname,ysearch.),.tag),2)
  278.     set $+(%,ysearch.,$remove($sockname,ysearch.),.tag) $1
  279.   }
  280.   elseif (*<span class="video-time">* iswm %sockreader) {
  281.     set $+(%,ysearch.,$remove($sockname,ysearch.),.time) $nohtml($remove(%sockreader,Add to,Added,to,queue,hozzáadás))
  282.   }
  283.   elseif (*<span class="username-prepend">* iswm %sockreader) {
  284.     set $+(%,ysearch.,$remove($sockname,ysearch.),.user) $remove($nohtml(%sockreader),by)
  285.   }
  286.   elseif (*<span class="viewcount">* iswm %sockreader) {
  287.     set $+(%,ysearch.,$remove($sockname,ysearch.),.viewcount) $remove($nohtml(%sockreader),|,views,megtekintés)
  288.     $($+(%,ysearch.,$remove($sockname,ysearch.),.msgtype),2) 1,0You0,4Tube 10Link:4 http://youtu.be/ $+ $($+(%,ysearch.,$remove($sockname,ysearch.),.tag),2) 10Title:4 $iif($($+(%,ysearch.,$remove($sockname,ysearch.),.msgtype),2) == msg #rsbot,$lower($($+(%,ysearch.,$remove($sockname,ysearch.),.title),2)),$($+(%,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)
  289.     unset $+(%,ysearch.,$remove($sockname,ysearch.),*)
  290.     sockclose $sockname
  291.   }
  292. }
  293. #search end
  294.  
  295. #parse on
  296. on $*:text:/youtu(.be|be.com)/Si:*: {
  297.   $iif($istok(%youtubefetch,$chan,44),halt,noop)
  298.   $iif($istok(%nolinks,$nick,44),halt,noop)
  299.   if ($($+(%,botflood.,$nick),2)) {
  300.     if ($($+(%,botflood.,$nick),2) >= 50) {
  301.       ignore -u60 $address($nick,2)
  302.       msg $chan $+($nick,$chr(44)) You have been put on ignore for 60secs for abusing the bot.
  303.       halt
  304.     }
  305.     elseif ($($+(%,botflood.,$nick),2) >= 40) {
  306.       msg $chan $+($nick,$chr(44)) Please do not flood the bot.  
  307.       inc -z $+(%,botflood.,$nick) 20
  308.       halt
  309.     }
  310.     else {
  311.       inc -z $+(%,botflood.,$nick) 10
  312.     }
  313.   }
  314.   else { inc -z $+(%,botflood.,$nick) 10 }
  315.   var %i 1
  316.   var %ticks $ticks
  317.   while (%i <= $numtok($1-,32)) {
  318.     if ((*youtube.com* iswm $($+($,%i),2)) || (*youtu.be* iswm $($+($,%i),2))) {
  319.       set $+(%,youtube.,%ticks,.url) $($+($,%i),2)
  320.       set $+(%,youtube.,%ticks,.tag) $remove($strip($($+($,%i),2)),feature=player_embedded&,feature=endscreen&,/watch?src_vid=,&fmt=22,&sns=fb,&fmt=18,https://,http://,www.,/v/,youtube.com,youtu.be/,/watch?v=,/watch,?v=,$chr(31),&feature=feedu,#!,&feature=relmfu,&NR=1)
  321.     }
  322.     inc %i
  323.   }
  324.   set $+(%,youtube.,%ticks,.msgtype) msg $iif($chan,$v1,$nick)
  325.   if (($($+(%,youtube.,%ticks,.tag),2) != %_youtube.last) && ($($+(%,youtube.,%ticks,.tag),2) != $null)) {
  326.     set $+(%,youtube.,%ticks,.nick) $nick
  327.     set $+(%,youtube.,%ticks,.chan) $chan
  328.     set $+(%,youtube.,%ticks,.network) $network
  329.     sockopen $+(youtube.,%ticks) youtube.com 80
  330.   }
  331. }
  332.  
  333. on *:sockopen:youtube*: {
  334.   sockwrite -nt $sockname GET $+(/,watch?v=,$($+(%,youtube.,$remove($sockname,youtube.),.tag),2)) HTTP/1.1
  335.   sockwrite -nt $sockname Host: www.youtube.com
  336.   sockwrite -nt $sockname $crlf
  337. }
  338.  
  339. on *:SOCKREAD:youtube*: {
  340.   if ($sockerr) { echo -a SOCKET ERROR: $sockerr | halt }
  341.   else {
  342.     var %sockreader
  343.     sockread %sockreader
  344.     if (*Location: http://www.youtube.com/verify_age?next_url=* iswm %sockreader) {
  345.       if ($($+(%,youtube.,$remove($sockname,youtube.),.msgtype),2) != echo -a) {
  346.         $($+(%,youtube.,$remove($sockname,youtube.),.msgtype),2) 1,0You0,4Tube 10This content may contain material flagged by YouTube's user community that may be inappropriate for some users.
  347.         halt
  348.       }
  349.       set %_youtube.last $($+(%,youtube.,$remove($sockname,youtube.),.tag),2)
  350.       unset $+(%,youtube.,$remove($sockname,youtube.),*)
  351.       sockclose youtube
  352.       halt
  353.     }
  354.     elseif (*<meta name="title"* iswm %sockreader) {
  355.       tokenize 32 %sockreader
  356.       set $+(%,youtube.,$remove($sockname,youtube.),.title) $replace($remove(%sockreader,<meta name="title" content=",">),&amp;quot;,",&amp;#39;,',&quot;,",&amp;,&,&#39;,',&quot;,")
  357.     }
  358.     elseif (*<div id="unavailable-message"* iswm %sockreader) {
  359.       if (*class="long-message">* iswm %sockreader) {
  360.         $($+(%,youtube.,$remove($sockname,youtube.),.msgtype),2) 1,0You0,4Tube10 $nohtml(%sockreader) This video is no longer available because the YouTube account associated with this video has been terminated due to multiple third-party notifications of copyright infringement from claimants.  Sorry about that.
  361.       }
  362.       else {
  363.         $($+(%,youtube.,$remove($sockname,youtube.),.msgtype),2) 1,0You0,4Tube10 $replace($nohtml($replace(%sockreader,<br/>,$chr(32))),&amp;quot;,",&amp;#39;,',&quot;,",&amp;,&,&#39;,',&quot;,")  Sorry about that.
  364.       }
  365.       set %_youtube.last $($+(%,youtube.,$remove($sockname,youtube.),.tag),2)
  366.       unset $+(%,youtube.,$remove($sockname,youtube.),*)
  367.       sockclose youtube
  368.       halt
  369.     }
  370.     elseif ((*<h3><a href="* iswm %sockreader) && ($($+(%,youtube.,$remove($sockname,youtube.),.title),2) == $null)) {
  371.       set $+(%,youtube.,$remove($sockname,youtube.),.title) $nohtml(%sockreader)
  372.     }
  373.     elseif (*<span class="watch-view-count">* iswm %sockreader) {
  374.       set $+(%,youtube.,$remove($sockname,youtube.),.viewcheck) on
  375.     }
  376.     elseif (*<a id="watch-userbanner" class="inline-block" rel="author" href="/user/* iswm %sockreader) {
  377.       tokenize 34 %sockreader
  378.       set $+(%,youtube.,$remove($sockname,youtube.),.user) $10
  379.     }
  380.     elseif ((*<strong>* iswm %sockreader) && ($($+(%,youtube.,$remove($sockname,youtube.),.viewcheck),2) == on)) {
  381.       set $+(%,youtube.,$remove($sockname,youtube.),.viewcount) $nohtml(%sockreader)
  382.       unset $+(%,youtube.,$remove($sockname,youtube.),.viewcheck)
  383.     }
  384.     elseif (*class="yt-user-name author"* iswm %sockreader) {
  385.       tokenize 34 %sockreader
  386.       set $+(%,youtube.,$remove($sockname,youtube.),.user) $remove($iif($2 == eow-date,$6,$2),/user/)
  387.       if ($($+(%,youtube.,$remove($sockname,youtube.),.msgtype),2) == echo -a) {
  388.         $($+(%,youtube.,$remove($sockname,youtube.),.msgtype),2) 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)    
  389.       }
  390.       elseif ($($+(%,youtube.,$remove($sockname,youtube.),.msgtype),2) != echo -a) {
  391.         $($+(%,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)
  392.       }
  393.       set %_youtube.last $($+(%,youtube.,$remove($sockname,youtube.),.tag),2)
  394.       unset $+(%,youtube.,$remove($sockname,youtube.),*)
  395.       sockclose $sockname
  396.     }
  397.   }
  398. }
  399. #parse end
  400.  
  401. on *:sockclose:youtube*: {
  402.   unset $+(%,youtube.,$remove($sockname,youtube.),*)
  403.   sockclose $sockname
  404. }
  405.  
  406. on *:sockclose:ysearch*: {
  407.   unset $+(%,ysearch.,$remove($sockname,ysearch.),*)
  408.   sockclose $sockname
  409. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement