Skip to content

cmd for saving commented youtube timestamps 2 file

m2habert edited this page May 13, 2022 · 2 revisions

use case:

∵ research, lengthy tube videos

∴ maybe it'd be a good idea to automate a bookmarking of sorts thru js -d

(we can't really extract youtube's timestamps, that has to be inputed by the user)

such as:

       command  timestamp2notes                                                js -d¥ \
                   tri.excmds.exclaim_quiet (                                         \
                                       'echo "'                                       \
                                       + document.location.href                       \
                                       + '#t=' + JS_ARGS[1] + 'm' + JS_ARGS[2] + 's'  \
                                       + ' . . . . . : ' + JS_ARGS.slice(3).join(' ') \
                                       + '"  >> ~/notes/"⊃◊'                          \
                                       + document.title                               \
                                       + '.txt"'                                      \
                    )¥

therefore, if user, while watching a vid, enters:

:timestamp2notes 12 30 foo bar qux with double extra asyncronous foo bar qux!

command will save (=append) to a .txt file (named with the video title) the current url with the #t=__m__s youtube timestamp ("#t12m30s" in this example) followed by the "foo bar (...) qux!" string.

https://www.youtube.com/watch?v=kRkp-uJTK7s#t=12m30s . . . . . : foo bar qux with double extra asyncronous foo bar qux!

(I use ~/notes/ as my personal "any kind of stuff" drawer and added here "⊃◊" as a name tag)

First + second arguments should be minutes and seconds.

Of course, binding same cmd to some combination streamlines for a better interface:

bindurl www.youtube.com --mode=ignore          y'    fillcmdline timestamp2notes 
bindurl www.youtube.com                        y'    fillcmdline timestamp2notes 

example result