Advertisement
illpastethat

YouTube Script (Parse Vids and Search) v4.2

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