Simple is the keyword. You don't need any registrations or API keys.
Just load the script and it should work in any channel your bot is in.
Important: mIRC v7.56+ is required, because of $urlget function.
Changelog:
v0.2 - added support for Youtube shorts
v0.1 - initial version
Let's assume your mIRC is installed in D:\mIRC\
The script can easily break if YouTube make changes to their website.
If it is broken or you find a bug or you have a suggestion - leave a comment below.
I will try to keep the script in working condition and fix bugs as soon as possible.
; Simple YouTube Title Announcer v0.2 - MMX 2022
; Requires mIRC v7.56+ (because of $urlget)
; Changelog:
; v0.2 - added support for youtube shorts
; v0.1 - initial version
ON $*:TEXT:/(youtube\.com|youtu\.be)\/([\S]+v=|shorts\/|)([\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,\",",\\,\,\\\\,\\)
}