Skip to content

Instantly share code, notes, and snippets.

@t9md
Last active May 14, 2020 01:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save t9md/c5f73108265a1497289467580a3161eb to your computer and use it in GitHub Desktop.
Save t9md/c5f73108265a1497289467580a3161eb to your computer and use it in GitHub Desktop.
Bookmarklet to copy subtitles when you are using LLN(for Netflix)+LLY(for Youtube)

bookmarklet-setup

This bookmarklet works for both LLN and LLY.

  1. Create bookmark on bookmarkbar with the name copy-subtitle.
  2. Edit bookmark you've just created and replace URL with content of clip-subtitle.js.
  3. On Yourtube with LLY enabled, click bookmarklet. Done.
  4. Now, you have subtitles in your clipboard. So you can paste it to DeepL

If you want to modify bookmarklet.

  1. Use original.js as template and modify as you like.
  2. Compile it on Closure Compiler. See more detailed instruction at here(Japanese Site).
javascript:'use strict';(async function(){var a=Array.from(document.getElementById("lln-vertical-view-subs").children).map(a=>a.innerText.trim()).join("\n");await navigator.clipboard.writeText(a);console.log("subtitle copied!!")})();
// ==ClosureCompiler==
// @output_file_name default.js
// @compilation_level SIMPLE_OPTIMIZATIONS
// @language_out ECMASCRIPT_2017
// ==/ClosureCompiler==
javascript:(async function() {
var t = Array.from(document.getElementById("lln-vertical-view-subs").children).map((e) => e.innerText.trim()).join("\n")
await navigator.clipboard.writeText(t)
console.log("subtitle copied!!");
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment