t9md
May 13, 2020, 10:28am
1
I have just created a simple bookmarklet which allows you to copy subtitles to your clipboard that works for both LLN and LLY.
Hope this feature would be provided as tiny button on subtitle sidebar.
My main usecase is to quickly check overall meaning with better translation service such as DeepL .
README.md
<img width="1236" alt="bookmarklet-LLY" src="https://user-images.githubusercontent.com/155205/81800933-96e81000-954e-11ea-9c80-dd90c13100c4.png">
This bookmarklet works for both [LLN](https://languagelearningwithnetflix.com/) and [LLY](https://languagelearningwithnetflix.com/youtube_instructions.html).
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](https://languagelearningwithnetflix.com/youtube_instructions.html) enabled, click bookmarklet. Done.
4. Now, you have subtitles in your clipboard. So you can paste it to [DeepL](https://www.deepl.com/translator)
If you want to modify bookmarklet.
This file has been truncated. show original
clip-subtitle.js
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!!")})();
original.js
// ==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!!");
})();
3 Likes