Manual (very) technical method for copying subtitles from YouTube, for videos with no other subtitles other than the auto-generated one and you want it imported immediately

This is for people who are comfortable with coding (you don’t have to write anything new though).

Since we now have to wait hours (sometimes an entire day) to import videos, I decided to start pulling the subtitles straight from YouTube, using simple code that just needs to be pasted into the console of the browser you’re using.

If you want to do this, here are the steps below (I don’t think it’s ideal, but here we go):

  1. open your browser
  2. open 1 tab that goes to LingQ, and 1 tab that goes to Youtube
  3. in the LingQ tab, click on Import in the top right, and then click Lesson
  4. in the Youtube tab, find the video you want to watch, copy that link
  5. in the LingQ tab, click on Original URL on the left, and paste in that Youtube click and click ADD
  6. in the Youtube tab, open the console debugger (this is different per browser, usually if you right click on the page where there is whitespace, it’ll have some sort of option for developer tools / console debug)
  7. paste in the function below, and hit Enter, the function will run right away
  8. copy the text that is printed (this is the transcript)
  9. in the LingQ tab, paste the copied text into the Input Text section
  10. create a title, and hit Save and Generate lesson

Here is the function you need to use in step 7:

(function() {
  function getSubtitles(){
    $('button.yt-spec-button-shape-next--outline[aria-label="Show transcript"]').click();
    console.log($('#segments-container').textContent.replace(/\n\s+/g, '\n').replace(/^\s*\d+:\d+\s*/gm, '').replace(/\n/g, ' '));
  }
  getSubtitles();
})();

Again, this isn’t ideal, this is just some method I am starting to use while we wait for LingQ to let us quickly import lessons like we used to. It isn’t too painful once you’re in the groove of it, you’ll memorize the steps after the first run through, the main thing is keeping the function somewhere handy (maybe a sticky on the desktop?).

I like your thinking but your process is too manual. If you download the LingQ importer and check out the source code you may get some ideas on a developing a 1 click video - lesson with all the trimmings you need.

I developed a playlist importer extension which is free to use (up to 5 videos per playlist / 2hrs per video for free version)

1 Like

thanks, yeah mine is not an ideal solution, it’s just the one I’ve been using that is hopefully temporary. Really, we need LingQ to just allow us to import auto-generated subtitles with their existing tool. I think they’re holding technology to a higher standard than their actual user experience (I’ve seen this mistake many times, find “cool” or “trendy” technology to use, and then find ways to utilize it for the user, vs “what does the user want?” and then find the appropriate technology to implement it)