Intended for a channel bot.
Just copy and paste into remotes.
mIRC 6.35+
Gives information on youtube links when posted in the channel, and can now also do YOUTBUE SEARCHES!
Triggered when YouTube link is posted in chat....
YouTube Link Info:
[15:42] <@Neo-Nemesis> http://www.youtube.com/watch?v=rwY3Ftfdy6M
[15:42] <@Boris_III> YouTube Title: Iron Maiden - Killers
[15:42] <@Boris_III> YouTube Info: Iron Maiden - Killers Members: Paul Di'Anno - vocals Steve Harris - bass guitar Dave Murray - guitar Adrian Smith - guitar Clive Burr - drums Iron Maiden's o...
Triggered when user types !youtube
YouTube Search:
[15:43] <@Neo-Nemesis> !youtube Iron Maiden
[15:43] <@Boris_III> YouTube Search - About 105,000 results - http://www.youtube.com/results?search_query=Iron+Maiden&aq=f
[15:43] <@Boris_III> YouTube Official YouTube Channel Link http://www.youtube.com/user/ironmaiden?blend=1
[15:43] <@Boris_III> YouTube Iron Maiden Wasted Years Link: http://www.youtube.com/watch?v=SwB9zg7Tbx8
[15:43] <@Boris_III> YouTube Iron Maiden, ACDC and Guns N Roses 4 LIFE Link http://www.youtube.com/user/benoitiginla12?blend=3
[15:43] <@Boris_III> YouTube aces high Link: http://www.youtube.com/watch?v=4Sam5omG0v0
;YouTube Info 2.0
;By Neo Nemesis
on *:TEXT:*youtube*:#: {
if ($1 == !youtube) {
%c.ytb = $chan
YouTube search $2-
}
else {
%c.ytb = $chan
YouTube $1
}
}
alias s.YTB.Parse {
if (& isin $remove($gettok($1-,2,32),href=",$chr(34))) { return $replace($remove($gettok($remove($1-,<h3>,<b>,</b>,</h3>),2,62),</a),",$chr(34),',$chr(39),&,$chr(38)) 4Link15 http://www.youtube.com $+ $gettok($remove($gettok($1-,2,32),href=",$chr(34)),1,38) }
else { return $replace($remove($gettok($remove($1-,<h3>,<b>,</b>,</h3>),2,62),</a),",$chr(34),',$chr(39),&,$chr(38)) 4Link:15 http://www.youtube.com $+ $remove($gettok($1-,2,32),href=",$chr(34)) }
}
alias YouTube {
if ($1 == search) {
;search
unset %ysrc*
sockclose s.ytb
%ysrch = /results?search_query= $+ $replace($2-,$chr(32),$chr(43)) $+ &aq=f
sockopen s.ytb www.youtube.com 80
}
else {
unset %ytb*
sockclose ytb
%ytb1 = $remove($1,http://,www.,youtube,.com)
sockopen ytb www.youtube.com 80
}
}
on *:SOCKOPEN:s.ytb: {
sockwrite -n $sockname GET %ysrch HTTP/1.1
sockwrite -n $sockname Host: www.youtube.com
sockwrite -n $sockname Connection: Close
sockwrite -n $sockname Content-Type: text/html
sockwrite -n $sockname $crlf
}
on *:SOCKREAD:s.ytb: {
sockread %ysrc.1
if (About <strong> isin %ysrc.1) {
.timerYTB6 1 1 msg %c.ytb 1,0You0,4Tube15,1 Search - $remove(%ysrc.1,<strong>,</strong>) - http://www.youtube.com $+ %ysrch
%ysrc.3 = $true
}
if (dir="ltr" title=" isin %ysrc.1) && (%ysrc.3 == $true) {
if (%ysrc.2) { inc %ysrc.2 }
else { %ysrc.2 = 1 }
if (%ysrc.2 <= 4) { .timerYTBb $+ %ysrc.2 1 $calc(%ysrc.2 + $rand(1,2)) msg %c.ytb 1,0You0,4Tube15,1 $s.YTB.Parse(%ysrc.1) }
else { sockclose s.ytb }
}
}
on *:SOCKOPEN:ytb: {
sockwrite -n $sockname GET %ytb1 HTTP/1.1
sockwrite -n $sockname Host: www.youtube.com
sockwrite -n $sockname Connection: Close
sockwrite -n $sockname Content-Type: text/html
sockwrite -n $sockname $crlf
}
on *:SOCKREAD:ytb: {
sockread %ytb2
if (<meta name=" isin %ytb2) {
if (="title" content=" isin %ytb2) {
%ytb.title = $remove(%ytb2,<meta name="title" content=",">)
.timerYTB1 1 1 msg %c.ytb 1,0You0,4Tube15,1 Title: $replace(%ytb.title,',$chr(39),",$chr(34),&,$chr(38)) $+
}
if (="description" content=" isin %ytb2) {
%ytb.desc = $remove(%ytb2,<meta name="description" content=",">)
.timerYTB2 1 2 msg %c.ytb 1,0You0,4Tube15,1 Info: $replace(%ytb.desc,',$chr(39),",$chr(34),&,$chr(38)) $+
}
if (%ytb.title) && (%ytb.desc) { sockclose ytb }
}
}
@alimak96: If you don't think its useful then don't use the script and save comment space for those who do use it :P This script is intended for a IRC channel bot anyways.
@Everyone Else:
Sorry haven't been around lately, enjoying my year long coder vacation!
When vacation is over I will begin working on YouTube Script and the IRC Guard 5000 and releasing new versions of them at the beginning of my next coding year, which should be pretty soon, I've been itching to get back to coding, just taking a break to let the carpal tunnel wear off more.
Soon my lovlies soon.
cool :D
I notice that if you time something like (for example): testhttp://www.youtube.com/watch?v=rdTVb64pfMs&hd=1test the script does not detect the link also sometimes if it is: "example http://www.youtube.com/watch?v=rdTVb64pfMs&hd=1 example" it does not work
would it be possible to make it at least display some of this information?
[YouTube] Title: Vince Carter Top 10 In Your Face Dunks | Uploaded: 10/05/07 by yelistener | Length: 2:50 | Views: 712,361
or would anyone know where i could locate a working YouTube detector script. thanks
looks good tho N3M3S1S, glad to know ppl are still trying on this topic
[10:54am] <04~toclafane> http://www.youtube.com/watch?v=RSXHKrPVopg&feature=youtu.be
[10:54am] <03&thunderbolt> 4toclafane 10is currently watching4 Geese on I-90
Manually altering the code would remove that.
Hmm that is strange, it must not be returning the correct information.
YouTube recently added YouTu.be to their servers so now instead of just YouTube.com it also have YouTu.be so any links that have YouTu.be instead of YouTube.com may cause problems.
I will make a new version soon.
Kinda Broken for me...
when I do a !Youtube (whatever)
It gives me the first link to the search that youtube would give... but the Video Links aren't working...
It goes
Killlerx: !youtube test
Killlerx: YouTubeSearch - About 1,940,000 results - http://www.youtube.com/results?search_query=test&aq=f
Killlerx: YouTube
Killlerx: YouTube
Killlerx: YouTube MOTORVISION TEST 4Link15 http://www.youtube.com/user/motorvisiontest?blend=3
Killlerx: YouTube
Note it appears fine on mIRC but the server it is connected to the IRC they are using (with the video cast) it isn't working. Is there a way to take out the top 4 video's appearing?
Ehmm dunno but with mirc 7.19 , charging the code at youtube.mrc .... !youtube Iron maiden ...and doesnt work. Idea?
This url doesnt work http://www.youtube.com/watch?v=_XI1DD_vJuY
¿¿?? Sorry for my poor english