Youtube history to textfile

Simplest version:
I would like to write a macro that when I am watching a youtube video, I can log the URL to a simple text file as historical record

More complicated
Add video title, some short comment, 1-5 stars etc , export into tap forms. etc

The simplest solution I could think of is this. It is triggered whenever the URL changes, which could either be because you clicked on a link, or switched to a different tab. So it might catch a little more than you wanted. But it's simple. You will need to have a folder called ~/data/ which is where I put most of my data files. The other data could also be added by including some user input.

Log all URL changes Macro (v11.0.2)

Log all URL changes.kmmacros (2.9 KB)

There are plenty of browser-targeting tokens listed on the Tokens page, including ones to gran the URL. And the Actions page has "Append text to a file", which sounds like what you want.

Video title can normally be proxied by the page title (also listed on the Tokens page), and you could easily add some notes and a star rating via "Prompt for User Input" or the recently-added "Prompt for Snippet". "Tap forms" I've not heard off, but if it can import tab- or CSV-delimited data you could bounce what you've gathered through a temp file -- or you could just macro the "manual method" of adding the data.

Give it a go and see how you get on. But remember the Forum guidelines -- if you spend more than 5 minutes banging your head against a problem, ask!

This is one of those problems where I'd be really tempted to use a SQLite database. You could store the URL and all the data you want, get it out in a neat report format, and check for duplicates before updating the list, etc.

It'd only take me a few months to get it working perfectly, then YouTube would change something and break the entire thing.

Yea, a text file is the way to go :).


1 Like