This script is partly based on this one, referred on the post title:
https://www.reddit.com/r/commandline..._links_in_mpv/
It was originally an independent development, so it relies in some aspects more on mpv.conf (to define its input pipe/fifo file), so one may want to modify it according to whatever preference regarding that.
The main difference is a gimmick to get the URL from where the cursor is hovering...