Simple YouTube Title Announcer v0.2

By MMX on Mar 06, 2022

Simple YouTube Title Announcer v0.2 (2022)

youtube-mirc.png

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.
Also tested and works well on ADIIRC 4.2
Important: mIRC v7.56+ is required, because of $urlget function.

Changelog:
v0.2 - added support for Youtube shorts
v0.1 - initial version

How to install:

Let's assume your mIRC is installed in D:\mIRC\

  1. Copy and save the script code in a file. For example: youtube_title.mrc
  2. Put the saved file in your scripts folder (example: D:\mIRC\scripts)
  3. Open mIRC and do: //load -rs scripts/youtube_title.mrc

How to Uninstall:

  1. Open mIRC and do: //unload -rs scripts/youtube_title.mrc
    That's it. No garbage or variables left behind.

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,\",",\\,\,\\\\,\\)
}

Comments

Sign in to comment.
AndyAbnormal   -  27 days ago

Hello
The script works wonderfully and shows me reliably... unfortunately it only shows me the titles of the other users..
Nothing is displayed on my links.
I tried to do it myself, but I'm completely overwhelmed.
I would be happy if anyone could help me. 😥🙃

 Respond  
Laststock   -  Feb 06, 2024

Hi there ! I just came across your code by searching on google. I tried it by loading it in AdiIRC64 and I can't make it work. I hope it's not a stupid mistake of mine, but I think i did the right steps to create a new script, save it, and loading it. Can you confirm by any chance if the script is still working ? I know it's been a long time ago and I'll understand having no answer. Thank youu take care

MMX  -  Feb 22, 2024

As of today (22.02.2024) it is still working. Tested on AdiIRC 4.2

Sign in to comment

pinkpolaris   -  Apr 08, 2022

I'm using this in my channel and it's working great. I am also able to customize the colors, the way I like. Good snip!

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.