I am using k2 to buildg my Joomla 3.5 site. My k2 items are basically youtube videos, every youtube video has a URL pattern for its preview image and I want it to be the item's image. But I don't want to bother with the repetitive job (copying the video ID, fitting it into the URL, and saving it as the item's image) every time I create an item. So I am thinking maybe I can write some script to automatically get the images(it is easy to do once the video's id is provided). The problem is, this script has to be exectued every time I create an item.
I just start to learn some basic things about Joomla extension developing, my question is, which category does the thing I want to fall into? Shall it be a plugin? Or a k2 plugin? Or there is totally no interface for this kind of thing and I will have to hack some PHP file?
Furthermore, I also have some node.js script to scrape the description of the Youtube videos(Yes I am being lazy again, I don't want to copy and paste those descriptions every time I create an item). How do I get Joomla to run these node.js scripts?