mIRC Homepage
Posted By: CeraVea YouTube Title Announcer - 03/08/22 02:55 PM
Hello,

I kind of got this script from MMX working for a very long time, and now it's not grabbing YT titles. I am not sure what the deal is. I am trying to find the author but I couldn't find him. Hehe. Maybe someone can help me get this to work again? Help?

Code



; Simple YouTube Title Announcer v0.1 - MMX 2022
; Requires mIRC v7.56+ (because of $urlget)

ON $*:TEXT:/(https\x3a\/\/|www\.)([\S]*youtube\.com[\S]+v\=|youtu\.be\/)([\S]{11})/Si:#:{
  if ($regml(3)) {
    var %url $+(https://m.youtube.com/watch?persist_app=1&app=m&v=,$regml(3))
    var %id $urlget(%url,gbi,&ytdata,yt_get_title $chan)
  }
}
alias -l yt_get_title {
  var %chan $1, %id $2
  if ($bfind($urlget(%id).target,1,/title":\{"runs":\[\{"text":"(.*?)"\}/Sig).regex) {
    msg %chan 01You00,04Tube: $yt_dehex($regml(1))
  }
}
alias -l yt_dehex {
  var %title $regsubex($1-,/\\u(.{4})/ig,$chr($base(\1,16,10)))
  return $replace(%title,\",",\\,\,\\\\,\\)
}


 
Posted By: Wims Re: YouTube Title Announcer - 03/08/22 06:43 PM
I tested that code and it worked perfectly fine on 7.69

Quote
[20:40:21] <sroelse> https://www.youtube.com/watch?v=8l75Z8wil_U
[20:40:22] <Ouims> YouTube: Jedi Mind Tricks "Design in Malice" feat. Young Zee & Pacewon - Official Video
[20:40:57] <sroelse> https://www.youtube.com/watch?v=OYR5X-vihAo
[20:40:59] <Ouims> YouTube: Tinariwen & Kiran Ahluwalia Mustt Mustt
[20:41:10] <sroelse> https://www.youtube.com/watch?v=evN6DIGPIJM
[20:41:11] <Ouims> YouTube: Peter Gabriel - In Your Eyes (Secret World Live)
[20:41:21] <sroelse> https://www.youtube.com/watch?v=o-BrVkJCHgg
[20:41:22] <Ouims> YouTube: Andrew Bird - Full Performance (Live on KEXP)
Posted By: CeraVea Re: YouTube Title Announcer - 04/08/22 01:57 AM
updating my mirc client fixed it. thanks a lot! i knew it's just something simple. smile
Posted By: CeraVea Re: YouTube Title Announcer - 04/08/22 12:02 PM
On second thought, I'd like to see if I can add a line script for ACTION event. I tried to copy the TEXT event and replaced it with ACTION but when I did /me <youtubelink> the script does not work.
Posted By: maroon Re: YouTube Title Announcer - 04/08/22 12:33 PM
The /me command assumes your cursor is in the correct editbox. Use:

/describe #channelname message
Posted By: MMX Re: YouTube Title Announcer - 18/08/22 04:22 PM
Originally Posted by CeraVea
Hello,
I kind of got this script from MMX working for a very long time, and now it's not grabbing YT titles. I am not sure what the deal is. I am trying to find the author but I couldn't find him. Hehe. Maybe someone can help me get this to work again? Help?


It's not that hard to find the author. grin
The script is published on Hawkee and there is a comment section + private messages.



Originally Posted by CeraVea
On second thought, I'd like to see if I can add a line script for ACTION event. I tried to copy the TEXT event and replaced it with ACTION but when I did /me <youtubelink> the script does not work.


This works. I just tested it. Make sure the script is not installed on the same mIRC client that is sending the message.
By the way, there is a new version with added support for youtube shorts.
© mIRC Discussion Forums