Usage:
;YouTube Link detector by Ford_Lawnmower irc.Geekshed.net #Script-Help
alias -l GetLinkDetectorForYoutube {
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Start Setup;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Change %tagcolor to the color you want for tags:
var %tagcolor $+($chr(15),$chr(2))
;;;; Change %textcolor to the color you want for normal text
var %textcolor $+($chr(15),$chr(3),04)
;;;; Change %logo to change the YouTube logo
var %logo $+($chr(2),$chr(3),01,$chr(44),00You,$chr(3),00,$chr(44),04Tube,$chr(2),$chr(15))
;;;; Change %tagSelection to choose the tags you want displayed.
;;;; Valid tags are: title views likes dislikes uploader and date
var %tagSelection title views likes dislikes uploader date
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End Setup;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
var %sockname $+(LinkDetectorForYoutube,$network,$2,$ticks,$r(1,1000))
hadd -m %sockname tags %tagSelection
hadd %sockname tagcolor %tagcolor
hadd %sockname textcolor %textcolor
hadd %sockname logo %logo
sockopen %sockname www.youtube.com 80
sockmark %sockname $1-2 $+(/watch?v=,$3,&hl=en)
}
menu Channel,Status {
.$iif($group(#LinkDetectorForYoutube) == On,$style(1)) LinkDetectorForYoutube
..$iif($group(#LinkDetectorForYoutube) == On,$style(2)) On: .enable #LinkDetectorForYoutube
..$iif($group(#LinkDetectorForYoutube) == Off,$style(2)) Off: .disable #LinkDetectorForYoutube
}
#LinkDetectorForYoutube on
On $*:Text:/(^[\+-])ytdetect$|(https?\x3a\/\/|www\.)(([\S]*youtube\.com[\S]+v\=)|(youtu\.be\/))([\S]{11})/Si:#: {
var %action $strip($regml(1)), %id $strip($regml(4))
if (%action isin +-) && ($regex($nick($chan,$nick).pnick,/(!|~|&|@)/)) {
if (%action == +) {
if ($istok(%LinkDetectorForYoutubeChanList,$+($network,$chan),32)) { .msg $chan $nick $chan is already running the LinkDetectorForYoutube script }
else {
.enable #LinkDetectorForYoutube
set %LinkDetectorForYoutubeChanList $addtok(%LinkDetectorForYoutubeChanList,$+($network,$chan),32)
.msg $chan $nick has activated the LinkDetectorForYoutube script for $chan .
}
}
else {
if (!$istok(%LinkDetectorForYoutubeChanList,$+($network,$chan),32)) { .msg $chan $nick $chan is not running the LinkDetectorForYoutube script }
else {
Set %LinkDetectorForYoutubeChanList $remtok(%LinkDetectorForYoutubeChanList,$+($network,$chan),1,32)
.msg $chan $nick has deactivated the LinkDetectorForYoutube script for $chan .
}
}
}
elseif (!$timer($+(LinkDetectorForYoutube,$network,$nick))) && ($istok(%LinkDetectorForYoutubeChanList,$+($network,$chan),32)) {
.timer $+ $+(LinkDetectorForYoutube,$network,$nick) 1 4 noop
GetLinkDetectorForYoutube .msg $chan %id
}
}
#LinkDetectorForYoutube end
On *:sockopen:LinkDetectorForYoutube*: {
if (!$sockerr) {
sockwrite -nt $sockname GET $gettok($sock($sockname).mark,3,32) HTTP/1.0
sockwrite -n $sockname Host: $sock($sockname).addr
sockwrite -n $sockname $crlf
}
else { sockclose $sockname | return }
}
On *:sockread:LinkDetectorForYoutube*: {
if ($sockerr) { sockclose $sockname | return }
else {
var %LinkDetectorForYoutube | sockread %LinkDetectorForYoutube
if ($regex(%LinkDetectorForYoutube,/watch-like\s[^<>]+><[^<>]+><[^<>]+>([^<>\s]+)\s?</i)) {
hadd $sockname likes $+($hget($sockname,tagcolor),Likes:) $+($hget($sockname,textcolor),$regml(1))
}
elseif ($regex(%LinkDetectorForYoutube,/watch-dislike\s[^<>]+><[^<>]+><[^<>]+>([^<>\s]+)\s?</i)) {
hadd $sockname dislikes $+($hget($sockname,tagcolor),Dislikes:) $+($hget($sockname,textcolor),$regml(1))
}
elseif ($regex(%LinkDetectorForYoutube,/\/user\/(.*?)">/i)) {
hadd $sockname uploader $+($hget($sockname,tagcolor),Uploader:) $+($hget($sockname,textcolor),$regml(1))
}
elseif ($regex(%LinkDetectorForYoutube,/<span class="yt-user-name[^>]*>([^<]*)</i)) {
hadd $sockname uploader $+($hget($sockname,tagcolor),Uploader:) $+($hget($sockname,textcolor),$regml(1))
}
elseif ($regex(%LinkDetectorForYoutube,/watch-view-count"\s?>([^\x20]*)</i)) {
hadd $sockname views $+($hget($sockname,tagcolor),Views:) $+($hget($sockname,textcolor),$regml(1))
}
elseif (id="watch-uploader-info"> isin %LinkDetectorForYoutube) {
hadd $sockname datefound 1
}
elseif ($hget($sockname,datefound) && $regex(%LinkDetectorForYoutube,/(?:published|uploaded)\son\s(.*?)<\/strong>/i)) {
hadd $sockname date $+($hget($sockname,tagcolor),Upload Date:) $+($hget($sockname,textcolor),$regml(1))
if ($hget($sockname,tags)) $gettok($sock($sockname).mark,1-2,32) $hget($sockname,logo) $Xchr($regsubex($v1,/([\S]+)/g,$hget($sockname,\t)))
if ($hget($sockname)) hfree $sockname
sockclose $sockname
}
;long-title ?
elseif ($regex(%LinkDetectorForYoutube,/class="watch-title".*title="(.*?)">/)) {
hadd $sockname title $+($hget($sockname,tagcolor),Title:) $+($hget($sockname,textcolor),$regml(1))
}
elseif ($regex(%LinkDetectorForYoutube,/<meta\sname="title"\scontent="(.*?)">/)) {
hadd $sockname title $+($hget($sockname,tagcolor),Title:) $+($hget($sockname,textcolor),$regml(1))
}
}
}
on *:sockclose:LinkDetectorForYoutube*: if ($hget($sockname)) hfree $sockname
alias -l Xchr {
var %return $regsubex($regsubex($1-,/&#x([A-F0-9]{1,2});/g,$chr($base($regml(\n),16,10))),/&#([0-9]{2,4});/g,$utf8(\1))
return $xXchr($replacecs(%return,–,$utf8(8211),—,$utf8(8212),¡,$utf8(161),·,·,»,»,«,«,Ü,Ü,$&
ü,ü,Á,Á,á,á,É,É,¿,$utf8(191),“,$utf8(8220),”,$utf8(8221),',',$&
‘,$utf8(8216),’,$utf8(8217),¢,$utf8(162),©,$utf8(169),÷,$utf8(247),µ,$utf8(181),$&
¶,$utf8(182),±,±,€,$utf8(8364),£,£,®,$utf8(174),§,$utf8(167),™,$utf8(153),$&
¥,$utf8(165),¤,$utf8(164),¦,$utf8(166),§,$utf8(167),¨,$utf8(168),ª,$utf8(170),$&
¬,$utf8(172),­,$utf8(173),¯,$utf8(175),°,$utf8(176),²,$utf8(178),³,$utf8(179),$&
´,´,ç,$utf8(184),¹,$utf8(185),º,$utf8(186),¼,$utf8(188),½,$utf8(189),$&
¾,$utf8(190),À,$utf8(192),Â,$utf8(194),Ã,$utf8(195),Ä,$utf8(196),Å,$utf8(197),$&
Æ,$utf8(198),Ç,$utf8(199),È,$utf8(200),Ê,$utf8(202),Ë,$utf8(203),Ì,$utf8(204),Î,$utf8(206),$&
Ï,$utf8(207),Ð,$utf8(208),Ò,$utf8(210),Ô,$utf8(212),Õ,$utf8(213),Ö,$utf8(214),×,$utf8(215),$&
Ø,$utf8(216),Ù,$utf8(217),Û,$utf8(219),Ý,$utf8(221),Þ,$utf8(222),ß,$utf8(223),à,$utf8(224),$&
â,$utf8(226),ã,$utf8(227),ä,$utf8(228),å,$utf8(229),ç,$utf8(231),è,$utf8(232),ê,$utf8(234),ë,$utf8(235),$&
ì,$utf8(236),î,$utf8(238),ï,$utf8(239),ð,$utf8(240),ò,$utf8(242),ô,$utf8(244),õ,$utf8(245),ö,$utf8(246),$&
÷,$utf8(247),ø,$utf8(248),ù,$utf8(249),û,$utf8(251),ý,$utf8(253),þ,$utf8(254),ÿ,$utf8(255),∠,$utf8(8736),$&
∧,$utf8(8743),ƒ,$utf8(402),Α,$utf8(913),Β,$utf8(914),Γ,$utf8(915),Δ,$utf8(916),Ε,$utf8(917),Ζ,$utf8(918),$&
Η,$utf8(919),Θ,$utf8(920),Ι,$utf8(921),Κ,$utf8(922),Λ,$utf8(923),Μ,$utf8(924),Ν,$utf8(925),Ξ,$utf8(926),$&
Ο,$utf8(927),Π,$utf8(928),Ρ,$utf8(929),Σ,$utf8(931),Τ,$utf8(932),Υ,$utf8(933),Φ,$utf8(934),Χ,$utf8(935),$&
Ψ,$utf8(936),Ω,$utf8(937),α,$utf8(945),β,$utf8(946),γ,$utf8(947),δ,$utf8(948),ε,$utf8(949),ζ,$utf8(950)))
}
alias -l xXchr {
return $replacecs($1-,η,$utf8(951),θ,$utf8(952),ι,$utf8(953),κ,$utf8(954),λ,$utf8(955),μ,$utf8(956),$&
ν,$utf8(957),ξ,$utf8(958),ο,$utf8(959),π,$utf8(960),ρ,$utf8(961),ς,$utf8(962),$&
σ,$utf8(963),τ,$utf8(964),υ,$utf8(965),φ,$utf8(966),χ,$utf8(967),ψ,$utf8(968),$&
ω,$utf8(969),ϑ,$utf8(977),ϒ,$utf8(978),ϖ,$utf8(982),•,$utf8(8226),…,$utf8(8230),$&
′,$utf8(8242),″,$utf8(8243),‾,$utf8(8254),⁄,$utf8(8260),℘,$utf8(8472),$&
ℑ,$utf8(8465),ℜ,$utf8(8476),™,$utf8(8482),ℵ,$utf8(8501),←,$utf8(8592),$&
↑,$utf8(8593),→,$utf8(8594),↓,$utf8(8595),↔,$utf8(8596),↵,$utf8(8629),⇐,$utf8(8656),$&
⇑,$utf8(8657),⇒,$utf8(8658),⇓,$utf8(8659),⇔,$utf8(8660),∀,$utf8(8704),∂,$utf8(8706),$&
∃,$utf8(8707),∅,$utf8(8709),∇,$utf8(8711),∈,$utf8(8712),∉,$utf8(8713),∋,$utf8(8715),$&
∏,$utf8(8719),∑,$utf8(8721),−,$utf8(8722),∗,$utf8(8727),√,$utf8(8730),∝,$utf8(8733),$&
∞,$utf8(8734),∨,$utf8(8744),∩,$utf8(8745),∪,$utf8(8746),∫,$utf8(8747),∴,$utf8(8756),$&
∼,$utf8(8764),≅,$utf8(8773),≈,$utf8(8776),≠,$utf8(8800),≡,$utf8(8801),≤,$utf8(8804),$&
≥,$utf8(8805),⊂,$utf8(8834),⊃,$utf8(8835),⊄,$utf8(8836),⊆,$utf8(8838),⊇,$utf8(8839),$&
⊕,$utf8(8853),⊗,$utf8(8855),⊥,$utf8(8869),⋅,$utf8(8901),⌈,$utf8(8968),⌉,$utf8(8969),$&
⌊,$utf8(8970),⌋,$utf8(8971),⟨,$utf8(9001),⟩,$utf8(9002),◊,$utf8(9674),♠,$utf8(9824),$&
♣,$utf8(9827),♥,$utf8(9829),♦,$utf8(9830),é,é,Í,Í,í,í,Ó,Ó,ó,ó,$&
Ñ,Ñ,ñ,ñ,Ú,Ú,ú,ú, ,$chr(32),æ,æ,",",<,<,>,>, &,&,",")
}
alias -l UTF8 {
if ($version >= 7) return $chr($1)
elseif ($1 < 255) { return $chr($1) }
elseif ($1 >= 256) && ($1 < 2048) { return $+($chr($calc(192 + $div($1,64))),$chr($calc(128 + $mod($1,64)))) }
elseif ($1 >= 2048) && ($1 < 65536) { return $+($chr($calc(224 + $div($1,4096))),$chr($calc(128 + $mod($div($1,64),64))),$chr($calc(128 + $mod($1,64)))) }
elseif ($1 >= 65536) && ($1 < 2097152) {
return $+($chr($calc(240 + $div($1,262144))),$chr($calc(128 + $mod($div($1,4096),64))),$chr($calc(128 + $mod($div($1,64),64))),$&
$chr($calc(128 + $mod($1,64))))
}
}
alias -l div { return $int($calc($1 / $2)) }
alias -l mod {
var %int $int($calc($1 / $2))
return $calc($1 - (%int * $2))
}
alias -l H2U { return $utf8($base($1,16,10)) }
I'm catching a 301 Perm Moved page when I post a link.
I added some echo's to the script to see where it was going wrong, and they all check out.
This is what I get from the sock read echo:
HTTP/1.1 301 Moved Permanently
Date: Sat, 03 Oct 2015 00:39:59 GMT
Server: gwiseguy/2.0
Content-Length: 0
X-XSS-Protection: 1; mode=block; report=https://www.google.com/appserve/security-bugs/log/youtube
Cache-Control: no-cache
Content-Type: text/html; charset=utf-8
X-Content-Type-Options: nosniff
P3P: CP="This is not a P3P policy! See http://support.google.com/accounts/answer/151657?hl=en for more info."
Location: https://www.youtube.com/watch?v=kdUnpV7n1xs
Expires: Tue, 27 Apr 1971 19:44:06 EST
X-Frame-Options: SAMEORIGIN
Set-Cookie: VISITOR_INFO1_LIVE=S9KY8ccag8c; path=/; domain=.youtube.com; expires=Thu, 02-Jun-2016 12:32:59 GMT; httponly
Set-Cookie: YSC=uhmg8nBjaOs; path=/; domain=.youtube.com; httponly
Could you add playlist support?
Something like this: https://www.youtube.com/playlist?list=PLat_oTO7cmowvoTNEOQWZgCdaXDLLGnv0
You've Been Doing it Wrong by CrazyRussianHacker 23 videos 467,182 views 310 likes 1 hour, 30 minutes
thanks!
@incognitus - If you change Line-77 from
elseif ($regex(%LinkDetectorForYoutube,/watch-view-count">(.*)\sviews/i)) {
to
elseif ($regex(%LinkDetectorForYoutube,/>([^<]*)<div class="watch-view/i)) {
it should be a temporary fix until Ford updates his code. :)
@incognitus - Try this instead:
elseif ($regex(%LinkDetectorForYoutube,/watch-view-count">(.*)</i)) {
Line-77. Sorry, the other worked when I posted it.
wow. i cant believe that i requested this over two years ago. and its still getting great use for many many people.
Thanks to @FordLawnmower for continuing to keep updating this snippet and many more like it.
Your The Best.
i paste link in channel like
http://www.youtube.com/watch?v=vYeajoizdm0
and it doesn't display anything
now it responds when activated but i still can't get it to respond when link is posted..
and yes i see the error in the A
sence the A was not correct is it possible
alias -l Xchr {
var %return $regsubex($regsubex($1-,/&#x([A-F0-9]{1,2});/g,$chr($base($regml(\n),16,10))),/&#([0-9]{2});/g,$chr(\1))
return $replacecs(%return,–,,·,·,»,»,«,«,Ü,Ü,ü,ü,Á,Á,á,á,É,$&
É,é,é,Í,Í,í,í,Ó,Ó,ó,ó,Ñ,Ñ,ñ,ñ,Ú,Ú,ú,ú, ,$chr(32),$&
æ,æ,",",&,&)
is incorect as well?
just a thought
Replace line 65 with:
if ($regex(%LinkDetectorForYoutube,/<span class="likes-count">(.*?)</span>/i)) {
That should fix the likes.
Replace line 68 with:
elseif ($regex(%LinkDetectorForYoutube,/<span class="dislikes-count">(.*?)</span>/i)) {
To fix the dislikes.
Replace line 71 with:
elseif (<span class="watch-view-count $"> isin %LinkDetectorForYoutube) {
That should fix the views.
Could you or someone else please fix this script it doesn't work at all, and contains odd things like
var ¬tion $strip($regml(1)), %id $strip($regml(4))
if (¬tion isin +-) && ($regex($nick($chan,$nick).pnick,/(!|~|&|@)/)) {
if (¬tion == +) {
Is that supposed to be %action and if so is that why it's broken?
On the other hand does this work fine for people, and it's just me?
this is the only error i see . it shows on status screen
Is it possible for someone to post a full working script that shows name, views, upload date, likes and dislikes.
I use a very old version works fine but as youtube has changed it will now only show name and upload date.
Hi, just dropping this here to let you know.
The latest version of March 17 doesn't work for me. For some reason, neither +ytdetect nor YouTube links seem to correctly activate the script (or its "on TEXT" part respectively), but there are no error messages whatsoever.
The older one I've been using still works just fine (though it only does so correctly with %LinkDetectorForYoutubeChanList set to # but not with single $network#$chan entries. I've tried either way as well with the newer version to no avail). The date on the working script's file says December 14 2012.
Try this... there is a slight error in lines 29, 30 and 31 with the variables.
On $*:Text:/(^[\+-])ytdetect$|(https?\x3a\/\/|www\.)(([\S]*youtube\.com[\S]+v\=)|(youtu\.be\/))([\S]{11})/Si:#: {
var %tion $strip($regml(1)), %id $strip($regml(4))
if (%tion isin +-) && ($regex($nick($chan,$nick).pnick,/(!|~|&|@)/)) {
if (%tion == +) {
if ($istok(%LinkDetectorForYoutubeChanList,$+($network,$chan),32)) { .msg $chan $nick $chan is already running the LinkDetectorForYoutube script }
else {
.enable #LinkDetectorForYoutube
set %LinkDetectorForYoutubeChanList $addtok(%LinkDetectorForYoutubeChanList,$+($network,$chan),32)
.msg $chan $nick has activated the LinkDetectorForYoutube script for $chan .
}
}
else {
if (!$istok(%LinkDetectorForYoutubeChanList,$+($network,$chan),32)) { .msg $chan $nick $chan is not running the LinkDetectorForYoutube script }
else {
Set %LinkDetectorForYoutubeChanList $remtok(%LinkDetectorForYoutubeChanList,$+($network,$chan),1,32)
.msg $chan $nick has deactivated the LinkDetectorForYoutube script for $chan .
}
}
}
elseif (!$timer($+(LinkDetectorForYoutube,$network,$nick))) && ($istok(%LinkDetectorForYoutubeChanList,$+($network,$chan),32)) {
.timer $+ $+(LinkDetectorForYoutube,$network,$nick) 1 4 noop
GetLinkDetectorForYoutube .msg $chan %id
}
}
It worked for me when I changed it. > [7:18pm] <~Stewie> +ytdetect
[7:18pm] <&thunderbolt> Stewie #i is already running the LinkDetectorForYoutube script
Yea, I had tried that before, realizing that the variable wasn't supposed to look the way it does. The original variable's name is %action and somehow it became ¬tion in the script above - but correcting it doesn't change anything. This newer version of the script still doesn't work for me, when all I do is copy&paste it (and change the variable in those 3 lines).
Thanks for trying to help though!
When you view the 'Variables' page... is something like this in it > %LinkDetectorForYoutubeChanList Torn#i if not, maybe you could try adding the channels manually, just until you can get the +/-ytdetect to work. Also, you do have OP status or above in the channel, right? It won't work for the +/-ytdetect if you don't.
Try this:
On *:sockread:LinkDetectorForYoutube*: {
if ($sockerr) { sockclose $sockname | return }
else {
var %LinkDetectorForYoutube | sockread %LinkDetectorForYoutube
if ($regex(%LinkDetectorForYoutube,/<span class="likes-count">(.*?)</span>/i)) {
hadd $sockname likes $+($hget($sockname,tagcolor),Likes:) $+($hget($sockname,textcolor),$regml(1))
}
elseif ($regex(%LinkDetectorForYoutube,/<span class="dislikes-count">(.*?)</span>/i)) {
hadd $sockname dislikes $+($hget($sockname,tagcolor),Disikes:) $+($hget($sockname,textcolor),$regml(1))
}
elseif (<span class="watch-view-count"> isin %LinkDetectorForYoutube) {
hadd $sockname viewsFound 1
if ($regex(%linkdetectorforyoutube,/\/user\/([^\/]+)\/videos/i)) {
hadd $sockname uploader $+($hget($sockname,tagcolor),Uploader:) $+($hget($sockname,textcolor),$regml(1))
}
}
elseif ($hget($sockname,viewsFound)) {
hadd $sockname viewsFound 0
hadd $sockname views $+($hget($sockname,tagcolor),Views:) $+($hget($sockname,textcolor),$remove(%LinkDetectorForYoutube,<strong>,</strong>))
}
elseif (($regex(%LinkDetectorForYoutube,/dir="ltr">(.*?)<\/a><span class="yt-user-separator">/i))) {
hadd $sockname uploader $+($hget($sockname,tagcolor),Uploader:) $+($hget($sockname,textcolor),$regml(1))
hadd $sockname date $+($hget($sockname,tagcolor),Upload Date:) $+($hget($sockname,textcolor),$regml(2))
}
elseif (($regex(%LinkDetectorForYoutube,/watch-video-date"\s>(.*?)<\/span>/i))) {
hadd $sockname date $+($hget($sockname,tagcolor),Upload Date:) $+($hget($sockname,textcolor),$regml(1))
if ($hget($sockname,tags)) $gettok($sock($sockname).mark,1-2,32) $hget($sockname,logo) $Xchr($regsubex($v1,/([\S]+)/g,$hget($sockname,\t)))
if ($hget($sockname)) hfree $sockname
sockclose $sockname
}
elseif ($regex(%LinkDetectorForYoutube,/class="watch-video-date"\s>(.*?)<\/span>/)) {
hadd $sockname date $+($hget($sockname,tagcolor),Upload Date:) $+($hget($sockname,textcolor),$regml(1))
}
elseif ($regex(%LinkDetectorForYoutube,/class="long-title".*title="(.*?)">/)) {
hadd $sockname title $+($hget($sockname,tagcolor),Title:) $+($hget($sockname,textcolor),$regml(1))
}
elseif ($regex(%LinkDetectorForYoutube,/<meta\sname="title"\scontent="(.*?)">/)) {
hadd $sockname title $+($hget($sockname,tagcolor),Title:) $+($hget($sockname,textcolor),$regml(1))
}
}
}
[6:45pm] <~Stewie> http://www.youtube.com/watch?v=kHeMck0Ap3I
[6:46pm] <&thunderbolt> YouTube Title: Amaranthe -Razorblade Views: 1,583 Likes: 19 Disikes: 1 Uploader: Luis Manuel Oviedo Vizcaya Upload Date: 23 Mar 2013
Reproducable bug. Sometimes it lists the video description, sometimes it doesn't. No rhyme or reason. Didn't happen in older versions prior to youtube changing stuff up.
[07:04pm] http://www.youtube.com/watch?v=rN7pkFNEg5c
[07:04pm] You Views: 292,302 Uploader: aaandre321 Upload Date: Jul 7, 2008
[07:04pm] http://www.youtube.com/watch?v=rN7pkFNEg5c
[07:04pm] You: The Wire - Bunk's interrogation techniques Views: 292,302 Uploader: aaandre321 Upload Date: Jul 7, 2008
I've never seen this and I've been unable to reproduce it in several tries.
[19:40:06] <@Ford_Lawnmower> http://www.youtube.com/watch?v=rN7pkFNEg5c
[19:40:07] YouTube Title: The Wire - Bunk's interrogation techniques Views: 292,302 Uploader: aaandre321 Upload Date: Jul 7, 2008
[19:40:57] <@Ford_Lawnmower> http://www.youtube.com/watch?v=rN7pkFNEg5c
[19:40:58] YouTube Title: The Wire - Bunk's interrogation techniques Views: 292,302 Uploader: aaandre321 Upload Date: Jul 7, 2008
[19:41:02] <@Ford_Lawnmower> http://www.youtube.com/watch?v=rN7pkFNEg5c
[19:41:03] YouTube Title: The Wire - Bunk's interrogation techniques Views: 292,302 Uploader: aaandre321 Upload Date: Jul 7, 2008
[19:41:07] <@Ford_Lawnmower> http://www.youtube.com/watch?v=rN7pkFNEg5c
[19:41:08] YouTube Title: The Wire - Bunk's interrogation techniques Views: 292,302 Uploader: aaandre321 Upload Date: Jul 7, 2008
[19:41:16] <@Ford_Lawnmower> http://www.youtube.com/watch?v=rN7pkFNEg5c
[19:41:17] YouTube Title: The Wire - Bunk's interrogation techniques Views: 292,302 Uploader: aaandre321 Upload Date: Jul 7, 2008
[19:41:26] <@Ford_Lawnmower> http://www.youtube.com/watch?v=rN7pkFNEg5c
[19:41:27] YouTube Title: The Wire - Bunk's interrogation techniques Views: 292,302 Uploader: aaandre321 Upload Date: Jul 7, 2008
If I can't reproduce it , I won't be able to fix it. If you have anymore information that you think will help, please post it.
I've slightly modified the script, but I don't see why it would cause this. Posted below. Do you see any issues here?
;YouTube Link detector by Ford_Lawnmower irc.Geekshed.net #Script-Help
alias -l GetLinkDetectorForYoutube {
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Start Setup;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Change %tagcolor to the color you want for tags:
var %tagcolor $+($chr(15),$chr(2))
;;;; Change %textcolor to the color you want for normal text
var %textcolor $chr(15)
;;;; Change %logo to change the YouTube logo
var %logo $+($chr(2),$nick))
;;;; Change %tagSelection to choose the tags you want displayed.
;;;; Valid tags are: title views likes dislikes uploader and date
var %tagSelection title views likes dislikes uploader date
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End Setup;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
var %sockname $+(LinkDetectorForYoutube,$network,$2,$ticks,$r(1,1000))
hadd -m %sockname tags %tagSelection
hadd %sockname tagcolor %tagcolor
hadd %sockname textcolor %textcolor
hadd %sockname logo %logo
sockopen %sockname www.youtube.com 80
sockmark %sockname $1-2 $+(/watch?v=,$3)
}
And this:
elseif ($regex(%LinkDetectorForYoutube,/class="long-title".*title="(.*?)">/)) {
hadd $sockname title $+($hget($sockname,tagcolor),:) $+($hget($sockname,textcolor),$regml(1))
}
elseif ($regex(%LinkDetectorForYoutube,/<meta\sname="title"\scontent="(.*?)">/)) {
hadd $sockname title $+($hget($sockname,tagcolor),:) $+($hget($sockname,textcolor),$regml(1))
This script probably won't work with 6.2 . I don't have the time to sort it out and see what issues it would have with 6.2 but I'm sure there are some. Most likely the issue is that the variable length being to short to read the youtube page. 6.2 is 7 years old and you will have trouble with lots of newer scripts if you keep using it. To upgrade, all you have to do is replace the mIRC.exe with a newer one. I would suggest 6.35 if you have a lot of older scripts.
@FordLawnmower - It'd be cool if you could add two things:
1) "on ACTION" and "on NOTICE" (both utilizing the same formatting as "on TEXT")
2) a variable in the top section, to have a single spot to toggle between msg and echo
Thanks for maintaining this script ;)
Yes @amclay . Just do a find and replace.
Find: .msg
Replace with: msg
The dot -->> .
in front of msg suppresses the output on the client running the script.
Whenever a link is posted, I don't see what the script is writing to the channel. Is there a way to fix it?
IE
ON THE BOT
[03:17] <@tester> http://www.youtube.com/watch?v=IPEnEkBY-9U
ON PERSON POSTING
[03:16] <@tester> http://www.youtube.com/watch?v=IPEnEkBY-9U
[03:16] <@bot> YouTube Title: Wolf's Retarded Mission Episode 1 Views: 416,103 Likes: 3,163 Disikes: 160 Upload Date: Jun 4, 2008
Pretty sure this is broken