Top

YouTube URL "Detector" (v.8)


mIRC Code
+ 19 likes
Please Register to submit score.
Bookmark and Share
Average Score  9.3 (of 21 scores)
Date Added  Mar 27, 2009
Last Updated  Jun 01, 2009
Tags  detector  kirby  mirc  tube  url  you  youtube 

Introduction

This was actually ^Neptune's request, so here it is.

YouTube! When you're chatting with your friends on IRC, you'll usually encounter some YouTube links to videos. But ever wonder what the video is? Instead of opening a new tab in your browser to see actually "what" it is, you can have a personal YouTube URL Detector.

Just load it onto a bot, put a YouTube URL, and it'll give you information on the following:
  • Title of the video
  • Uploader's name
  • Date uploaded
  • Duration of the video
  • Number of views
  • Rating + Number of Ratings
:)

Newer news
Updates!: I've removed the TinyURL edition for specific reasons, mentioned below. I might post a snippet on it later, but it will not be in this snippet. (If you liked the older version and enjoyed the benefit of downloading the videos, check out the older version here.
I've also enhanced the speed of the script, removed the use of key identifiers such as $between and $htmlfree, and reduced script space. Triple the pleasure?

Older news

If you do not like the new update:
Quote:
Some of you might say that the TinyURL links do not work, or it leads to a blank page and halts.
"It is most likely because it is a .flv file and/or unknown to the web browser."

Edit: That is false. I've later realized that the URL is actually user-based, essentially only one person can access it, or the bot owner; the owner sockopens to the YouTube site, and therefore, given a specific code that expires when accessed.

Despite the update, I doubt many will be intrigued to even download a certain YouTube video (if you can stream it online, why download it?), so I'm not worried much.
Otherwise, the TinyURL's should work if the selected browser detects it.
If your browser happens to detect the video, the video name should be called video.flv.


If you find any bugs, let me know!

Here's a picture:


If you can't see the picture:
Quote:
<@noob> http://www.youtube.com/watch?v=eghL7ORV1lg
<@null> [YouTube]: Title: Seinfeld - Million to One Shot Doc | By: NIGathan (uploaded on August 12, 2008) | Duration: 2mins 8secs | Views: 7,573 | Rating: 4.5 (11 ratings)


Here's the other picture:


If you can't see the picture:
Quote:
<@noob> http://www.youtube.com/watch?v=eghL7ORV1lg
<@null> [YouTube]: Title: Seinfeld - Million to One Shot Doc | By: NIGathan (uploaded on August 12, 2008) | Duration: 2mins 8secs | Views: 7,573 | Rating: 4.5 (11 ratings) | Download: http://tinyurl.com/dem5lq (http://preview.tinyurl.com/dem5lq)


Updates:
Update #1 - Sat Mar 27, 11:32 AM: Fixed the bug with the "duration" with ^Neptune's $between.
Update #2 - Sat Mar 28, 11:47 AM: Added error checks to see if the video exists or not.
Update #3 - Sun Mar 29, 11:36 AM: Fixed minor bug (if ratings on the video are disabled).
Update #4 - Tue Mar 31, 6:25 PM: Fixed bug where it gets text after the video url. Thanks to Jonesy44 for the regex help.
Update #5 - Mon Apr 13, 9:33 PM: Added TinyURL link to direct link to the YouTube Video, for downloading. (.flv file called video.flv)


Enjoy! :D

Grab the Code

;SOF
 
 
;~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*;
;             YouTube Video "Detector"           ;
;             Made by Kirby (Quakenet)           ;
;*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~;
 
;// YouTube Detector Identifiers //
alias -l addmark { return $+($sock($1).mark,$chr($3),$2) }
alias -l smsg { msg $iif(c isincs $chan($1).mode,$1 $strip($2-),$1-) }
 
;// YouTube Detector Text Event //
on *:text:*youtube.com/watch?v=*:#: {
  if (!$sock(youtube)) {
    noop $regex($strip($1-),http:\/\/.*youtube.*\/watch\?v=(.{11})&?.*)
    sockopen youtube www.youtube.com 80 | sockmark youtube $+(#,>,$regml(1))
  }
}
 
;// YouTube Detector Socket (Video Information) //
on *:sockopen:youtube: {
  sockwrite -n $sockname GET $+(/watch?v=,$gettok($sock(youtube).mark,2,62)) HTTP/1.0
  sockwrite -n $sockname Host: www.youtube.com
  sockwrite -n $sockname $crlf
}
on *:sockread:youtube: {
  var %yt | sockread %yt
  if ($regex(%yt,<title>YouTube\s-\s(.+)<\/title>)) sockmark youtube $addmark(youtube,Title: $+(,$regml(1),),62)
  elseif ($regex(%yt,.+"l":\s(\d+))) sockmark youtube $addmark(youtube,Duration: $+(,$duration($regml(1)),),62)
  elseif ($regex(%yt,/ratingL-(.+)"\stitle|"smallText">(.+)\sratings<\/span>/g)) sockmark youtube $addmark(youtube,$+($regml(1),>,$regml(2)),62)
  elseif ($regex(%yt,count">(.+)<\/span>\sviews)) sockmark youtube $addmark(youtube,$regml(1),62)
  elseif ($regex(%yt,date">(.+)<\/span>)) sockmark youtube $addmark(youtube,$+($chr(40),uploaded on $regml(1),$chr(41)),62)
  elseif ($regex(%yt,<a\sclass="url"\shref="\/user\/(\w+)")) sockmark youtube $addmark(youtube,By: $+(,$regml(1),),62)
}
on *:sockclose:youtube: {
  tokenize 62 $sock(youtube).mark | var %x $numtok($sock(youtube).mark,62)
  smsg $1 [1,0You0,4Tube]: $iif(%x >= 7,$3 $chr(124) $5 $6 $chr(124) $4 $chr(124) Views: $+(,$iif(%x == 9,$9,$8),) $chr(124) Rating: $iif(%x == 9,$+(,$7,) $+($chr(40),$8 $iif($8 == 1,rating,ratings),$chr(41),),$+(,Ratings were disabled,)),Either the video doesn't exist or it contained a malformed video ID.)
}
 
 
;EOF

Comments

  (61)  RSS
^Neptune
Comments: 598
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Mar 27, 2009 9:30 pm
Works brilliantly. I gave it an 8/10. :)
MaxEvans
Comments: 89
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Mar 27, 2009 10:00 pm
Love it! 8/10 here too! =D
Aucun50
Comments: 548
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Mar 28, 2009 2:49 am
Very nice
Feety
Comments: 7
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Mar 28, 2009 9:39 am
Loving it.
Kirby
Comments: 475
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Mar 28, 2009 10:54 am
Made two major updates.
I don't think I will need to update anything, nor do I believe there are any bugs in this script anymore. If you find any, post a comment here.
I've been asked to "decompress" the script, so it's softer on the eyes. :-)
jonesy44
Comments: 1,856
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Mar 28, 2009 12:34 pm
Good effort mate! Love the idea & well exectued. 9/10. Keep it up :)

Only thing i changed was it echo's the msg instead, i perfer to keep things quiet. Works well for a bot though as it is!
Kirby
Comments: 475
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Mar 28, 2009 12:43 pm
Ty!
Spanky
Comments: 233
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Mar 28, 2009 3:54 pm
8/10 i also made it echo instead of msg. nice work.
AlienDK
Comments: 34
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Mar 28, 2009 6:28 pm
I can't belive that someone hasn't thought of this before :D 9/10
^Neptune
Comments: 598
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Mar 28, 2009 7:29 pm
Actually they have - I got the idea from RuneScript. :P
Firstmate
Comments: 119
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Mar 28, 2009 10:54 pm
Its actually been made before, just never posted to sites like these.
Kirby
Comments: 475
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Mar 29, 2009 10:37 am
Updated again. If the video has ratings disabled, then it should replace the text for Rating: with "Ratings were disabled".
Eugenio
Comments: 1,193
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Mar 29, 2009 3:52 pm
Farking handy code Kirbz
/me rates 8
xXLifelessxLoren__x
Comments: 47
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Mar 30, 2009 7:24 am
Very nice :]
I like
8/10
AlienDK
Comments: 34
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Mar 30, 2009 10:01 am
Okay then. "I can't belive that someone hasn't posted it on "sites like these" before" :P
Kirby
Comments: 475
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Mar 31, 2009 5:31 pm
Updated. Hope you enjoy it.
Prelude
Comments: 99
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Apr 10, 2009 12:02 am
<--

7/10 kirbz.
Kirby
Comments: 475
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Apr 10, 2009 1:25 pm
¯\(°_o)/¯
^Neptune
Comments: 598
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Apr 13, 2009 8:37 pm
Here's an updated picture that you cannot see at all.
Kirby
Comments: 475
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Apr 13, 2009 8:47 pm
Some of you might say that the TinyURL links do not work, or it leads to a blank page and halts.
It is most likely because it is a .flv file and/or unknown to the web browser.
This script literally "gets" the same download url (as shown in /getvid - download youtube video (http://www.hawkee.com/snippet/3441/))
It also may be because of differences in operating systems. Because I code my scripts on Linux, I do not see through the eyes of Windows users, sorry.
Despite the update, I doubt many users will be intrigued to even download a certain YouTube video (if you can stream it online, why download it?), so I'm not worried much.
Otherwise, the TinyURL's should work if the selected browser detects it.
If your browser happens to detect the video, the video name should be called video.flv.
If you do not like the new update, you can use the older version (no TinyURL download link).
Kirbeh_Pr0nz
Comments: 144
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Apr 14, 2009 4:35 pm
you come up with nice unique......unthought of snippets that somehow amaze me 10/10 ILY KIRBY.
i hope my name doesnt offend you x]
Kirby
Comments: 475
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Apr 14, 2009 4:40 pm
Eh, I don't really care about your nick lol. ¯\(°_o)/¯
Kirbeh_Pr0nz
Comments: 144
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Apr 14, 2009 4:54 pm
ok gewd :3
Blitzjager
Comments: 193
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Apr 14, 2009 8:06 pm
Quote:
^Neptune: Here's an updated picture that you cannot see at all.

Hahah
^Neptune
Comments: 598
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Apr 15, 2009 5:56 am
Quote:
you come up with nice unique......unthought of snippets that somehow amaze me 10/10 ILY KIRBY.


Idea came from RuneScript.
Kirby
Comments: 475
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Apr 15, 2009 6:16 am
Quote:
Idea came from RuneScript.

I think he is talking generally about my scripts overall.
But yes, this Youtube URL Detector's idea came from Runescript. I have just reproduced the format through my own coding and added a few more features of my own.
Sapphy
Comments: 5
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Apr 18, 2009 4:13 pm
I love it! :D

10/10
killwithme
Comments: 20
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Apr 19, 2009 5:38 am
nice one :)
killwithme
Comments: 20
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Apr 20, 2009 11:12 am
actually I tried to decrypt your regex but i couldn't.
so i'm still stuck with getting the current rating with php...

could you tell me where that is in the video page?
thanks
Kirby
Comments: 475
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Apr 20, 2009 8:04 pm
Quote:
so i'm still stuck with getting the current rating with php...
could you tell me where that is in the video page?


The current rating is the first sockmark in
Code:
  elseif (<div id="defaultRatingMessage"><span class="smallText"> isin %youtube) { sockmark youtube $addmark(youtube,$gettok(%youtube,4,34),62) | sockmark youtube $addmark(youtube,$gettok($htmlfree(%youtube),1,32),62) }
.
killwithme
Comments: 20
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Apr 21, 2009 7:23 am
got it
Blitzjager
Comments: 193
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Apr 21, 2009 7:42 am
There's a less exact one
<button class="master-sprite ratingL ratingL-4.5" title="4.5"></button>
Unless you're logging I don't think you can get what you posted.
killwithme
Comments: 20
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Apr 22, 2009 2:34 pm
I took this one, I couldn't decrypt the code from Kirby ;)
And it works..
eyiezinc
Comments: 38
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on May 4, 2009 3:28 pm
unbelievable ideas! 9/10 here too! =D
Ejayrazz
Comments: 6
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on May 28, 2009 10:00 pm
It seems the downloading doesn't work?
I am amazed by this work though.
Kirby
Comments: 475
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on May 31, 2009 8:53 pm
Made some updates guys. Please read the description!
yourname
Comments: 4
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Jun 1, 2009 10:38 am
AWESOME SCRIPT!!! 10/10!!! thx man!!!
darkarrow
Comments: 24
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Jul 23, 2009 7:14 pm
this thing is awsome 8/10 would be 10/10 but it doesnt detect all the videos that u say ometimes it says it cant find them
VinX
Comments: 56
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Jul 31, 2009 7:06 am
would give a 9/10

doesnt detect all the vids :P



17:33:56 [@VinX] www.youtube.com/watch?v=tcZVpaVn-eM
17:34:45 [&V-BOT] Url: http://www.youtube.com/watch?v=tcZVpaVn-eM - Title: YouTube - Enrique Iglesias - Do You Knowé (The Ping Pong Song)
17:34:47 [&V-BOT] [YouTube]: Either the video doesn't exist or it contained a malformed video ID.
killwithme
Comments: 20
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Aug 2, 2009 6:41 am
Could be because some videos need a confirmation of your age or as in the video postet by VinX, I'm not allowed to view it in my country >_>
Here's one that needs age-confirmation: http://www.youtube.com/watch?v=o_gGggFtOaY
Calyp5o
Comments: 10
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Aug 2, 2009 9:58 am
Thanks, just added it... really like it. Very useful.
VinX
Comments: 56
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Aug 3, 2009 3:25 am
yea killwithme , it does show me error about the Age Confirmation instead of the Title
Kafei
Comments: 1
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Aug 10, 2009 7:24 am
i get "Views:  | Rating: Ratings were disabled" with every video. any ideas?
Sidearm
Comments: 2
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Aug 15, 2009 10:40 am
Excellent script, I used an ECHO instead of (s)msg for personal use. :)
TheDeathly
Comments: 1
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Sep 2, 2009 2:37 am
i tried this script and i couldnt get it to work... using the latest mIRC client.. 6.35
any suggestions?
Geo
Comments: 1
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Sep 2, 2009 12:00 pm
It seems as if every video that I/other users post has "Ratings were disabled", when they are not...
andromeda
Comments: 26
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Sep 2, 2009 8:41 pm
I'm using version 6.35 too TheDeathly but it work fine for me..i really like this..small code but has a big function..
VinX
Comments: 56
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Sep 3, 2009 3:29 am
13:57:33 ‹~VinX› www.youtube.com/watch?v=glsaOQka-Mg
13:57:34 ‹&V-BOT› [YouTube]: Either the video doesn't exist or it contained a malformed video ID.
13:57:54 ‹~VinX› www.youtube.com/watch?v=zwSJnB9VluI
13:57:55 ‹&V-BOT› [YouTube]: Either the video doesn't exist or it contained a malformed video ID.
atropine
Comments: 2
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Nov 6, 2009 2:52 am
This script is now well and truly broken due to youtube updating their website look.

Is anyone able to post a revision that works now. It's such a good script.

thanks
knoeki
Comments: 120
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Nov 6, 2009 6:01 am
Yup, it doesn't show the title anymore...
atropine
Comments: 2
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Nov 6, 2009 11:17 pm
To help out whoever fixes this script. Not only does the script now have problems with odinary links people post on irc, but now youtube have now introduced a different format of links which is working similtaneously with the old links now, but will probably take over from the old style. People are posting both formats of links.
Here is an example.
"Lego Claw Machine"

old style link - http://www.youtube.com/watch?v=iPVvH0hFadk
new style link - http://www.youtube.com/user/MlCHAELHlCKOXFilms#p/u/0/iPVvH0hFadk
Arcitech
Comments: 2
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Nov 7, 2009 7:25 pm
Regarding the missing titles, did a bit of tweaking and come up with something that worked for me.

Replace:
if ($regex(%yt,<title>YouTube\s-\s(.+)<\/title>)) sockmark youtube $addmark(youtube,Title: $+(,$regml(1),),62)

with:
if ($regex(%yt,<h1 >(.+)<\/h1>)) sockmark youtube $addmark(youtube,Title: $+(,$regml(1),),62)
RicJames
Comments: 26
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Nov 9, 2009 7:54 am
Thanks arcitech your suggestion fixed the title but it still displays Ratings were disabled for all videos. Hopefully kirby updates this soon :)
Arcitech
Comments: 2
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Nov 9, 2009 9:58 am
I've got a fix for the ratings also mate, replace the smsg line with this one:
smsg $1 [1,0You0,4Tube]: $iif(%x >= 7,$3 $chr(124) $5 $chr(124) $4 $chr(124) Views: $+(,$iif(%x == 9,$9,$8),) $chr(124) Rating: $iif(%x == 8,$+(,$6,) $+($chr(40),$7 $iif($8 == 1,rating,ratings),$chr(41),),$+(,Ratings were disabled,)),Either the video doesn't exist or it contained a malformed video ID.)

:)

edit: the colour control codes don't seem to be showing, so you'll have to add those back in yourself.
mrmr
Comments: 4
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Nov 12, 2009 10:51 am
Code:
on *:sockread:youtube: {
  var %yt | sockread %yt

  if ($regex(%yt,/<h1 >(.+)<\/h1>/)) sockmark youtube $addmark(youtube,Title: $+(,$regml(1),),62)
  elseif ($regex(%yt,/"length_seconds": "(\d+)/) ) sockmark youtube $addmark(youtube,Duration: $+(,$duration($regml(1)),),62)
  elseif ($regex(%yt,/ratingL-(.+)"\stitle|"smallText">(.+)\sratings<\/span>/g)) sockmark youtube $addmark(youtube,$+($regml(1),>,$regml(2)),62)
  elseif ($regex(%yt,/"watch-view-count">(.+)<\/span>\svi/)) sockmark youtube $addmark(youtube,$regml(1),62)
  elseif ($regex(%yt,date">(.+)<\/span>)) sockmark youtube $addmark(youtube,$+($chr(40),uploaded on $regml(1),$chr(41)),62)
  elseif ($regex(%yt,<a\sclass="url"\shref="\/user\/(\w+)")) sockmark youtube $addmark(youtube,By: $+(,$regml(1),),62)
}


This should work at the time of NOW.
Be aware that in some country, due to youtube's localization, something could not work as intended ;) (learn it the hard way...eehhe)


ohhh, wanna add this too:
Code:
on *:INPUT:#: {
  if ($regex($1,http\:\/\/.*youtube.*\/watch\?v=(.{11})&?.*)) {
    if (!$sock(youtube)) {
      noop $regex($strip($1-),http:\/\/.*youtube.*\/watch\?v=(.{11})&?.*)
      sockopen youtube www.youtube.com 80 | sockmark youtube $+(#,>,$regml(1))
    }
  }
}
this should "catch" also input from you, parsing youtube links that you paste in any channel.

Note that I'm a scripting beginner...so don't mind my "bad" style

EDIT: typo in ratings regex
kibblz
Comments: 3
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Nov 13, 2009 12:10 am
okay, nice job on getting duration to work. only one problem:

this is the script with Arcitech's tweak;

[5:05:24 pm] <kibblz> http://www.youtube.com/watch?v=cxGYHnTRMAw
[5:05:29 pm] <Tifa> [YouTube]: Title: Vixen - Cryin' | (uploaded on March 12, 2009) | By: emimusic | Views: 17,126 | Rating: 5.0 (61 ratings)

work's fine. but no duration.

this is with your tweak mrmr:

[5:04:37 pm] <kibblz> http://www.youtube.com/watch?v=cxGYHnTRMAw
[5:04:40 pm] <Tifa> [YouTube]: Duration: 3mins 30secs | By: emimusic | Title: Vixen - Cryin' | Views: 17,126 | Rating: (uploaded on March 12, 2009) (5.0 ratings)

the duration is now showing first and the restings are not showing :(

so i have been forced to go back until someone can sort the duration out... many thanks for trying guys. this script is very good :)
mrmr
Comments: 4
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Nov 14, 2009 4:32 am
@Kibblz
you were right...there was a typo in the ratings regex.
(fixed in the previous comment, directly)


Code:
smsg $1 [1,0You0,4Tube]: $iif(%x >= 7,$4 $chr(124) $5 $6 $chr(124) $3 $chr(124) Views: $+(,$iif(%x == 9,$9,$8),) $chr(124) Rating: $iif(%x == 9,$+(,$7,) $+($chr(40),$8 $iif($8 == 1,rating,ratings),$chr(41),),$+(,Ratings were disabled,)),Either the video doesn't exist or it contained a malformed video ID.)

this smsg should fix the order

Quote:
[11:23] <pippo> http://www.youtube.com/watch?v=31sZ9xZr_Ew
[11:23] <pippo> [YouTube]: Title: Franz Ferdinand - Ulysses | By: DominoRecords (uploaded on 09 gennaio 2009) | Duration: 3mins 15secs | Views: 2321909 | Rating: Ratings were disabled



Still got some problems with Ratings regex.
Someone know "where" to parse Rating Value? How?
In the page source I cannot get "ratingL" anywhere...


** EDIT **

Quote:
[11:33] <pippo> http://www.youtube.com/watch?v=31sZ9xZr_Ew
[11:33] <pippo> [YouTube]: Title: Franz Ferdinand - Ulysses | By: DominoRecords (uploaded on 09 gennaio 2009) | Duration: 3mins 15secs | Views: 2321909 | Rating: 5.0 (5832 ratings)


ehm, in the "ratings" regex, we're matching the word "ratings" after the value count:
$regex(%yt,/ratingL-(.+)"\stitle|"smallText">(.+)\sratings<\/span>/g)

Now, I'm from italy....the italian localization for "rating" is "voti".
So I've replaced 'ratings' with 'voti' and now, also ratings are parsed

Note, that even if in your browser you get the non-localized (en-US?) page, the socket from mIRC get your country localization.
kibblz
Comments: 3
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Nov 14, 2009 10:10 am
awesome. it works beautifully now. thanks heaps mrmr!
RicJames
Comments: 26
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Nov 15, 2009 9:55 am
What ^^^^ said :)
Kirby
Comments: 475
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Nov 15, 2009 12:39 pm
Gotta fix this. :-P
MorbidAngel
Comments: 3
 
mIRC Snippet:  YouTube URL "Detector" (v.8)
Posted on Nov 17, 2009 4:57 pm
getting this as result for a while now (pasted newest code few mins ago so that is not problem). Double checked if i have 2 same scripts running and doesn't seem i have (i had problem with that once)

(23:48:47) (@MA|AFK) http://www.youtube.com/watch?v=Bk1gSOPvGfU
(23:48:49) (SexSlave) [YouTube]: By: theserbs | 4.5 7 | (uploaded on August 12, 2007) | Views: | Rating: Ratings were disabled

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  
Bottom