mIRC Home    About    Download    Register    News    Help

Print Thread
#270606 03/08/22 02:55 PM
Joined: Mar 2022
Posts: 15
CeraVea Offline OP
Pikka bird
OP Offline
Pikka bird
Joined: Mar 2022
Posts: 15
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,\",",\\,\,\\\\,\\)
}


 


JilValentine | (Read error: EOF from client) | https://jilvalentine.de
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
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)


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Mar 2022
Posts: 15
CeraVea Offline OP
Pikka bird
OP Offline
Pikka bird
Joined: Mar 2022
Posts: 15
updating my mirc client fixed it. thanks a lot! i knew it's just something simple. smile


JilValentine | (Read error: EOF from client) | https://jilvalentine.de
Joined: Mar 2022
Posts: 15
CeraVea Offline OP
Pikka bird
OP Offline
Pikka bird
Joined: Mar 2022
Posts: 15
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.


JilValentine | (Read error: EOF from client) | https://jilvalentine.de
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
The /me command assumes your cursor is in the correct editbox. Use:

/describe #channelname message

Joined: Aug 2022
Posts: 1
M
MMX Offline
Mostly harmless
Offline
Mostly harmless
M
Joined: Aug 2022
Posts: 1
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.


Link Copied to Clipboard