I have HISTFILE env set to .md file inside vault, I have added ```shell at beginning to have syntax highlight. If you also want to store output I don’t know better solution then scipt util.
I also store every script I use as .md file in vault with line #```shell bellow shell bang to have syntax highlight when i want to edit them using obsidian.
I’m also using freetube and I have script for exporting notes in format I want. It doesn’t support timestamps because I rarely use them, but when I have to I simply add ?t=<time in seconds> at end of url.
For mobile I simply save links to latter convert them using my freetube script.