Importing Netflix Subtitles

LingQ STILL cannot import Netflix subtitles. The import begins about 25 minutes into the video. This has been reported numerous times and never seems to be addressed.

Almost a dozen Netflix videos are included in the library feed under “Netflix”, but it seems to be impossible to import them.

Is this a supported feature of LingQ or not? If it is not, just say so. “Looking into it” doesn’t seem to be producing any solution. I have used every browser. I even stooped to trying MS Edge. It doesn’t work on any of them. I have not tried Android, just Win 11.

3 Likes

@ejackson

I had a stickybeak at the code for Netflix importing.

  scriptElem.text = `
        async function extractSubs(movieObj) {
            let movieId = movieObj.movieId,
                movieData = document.getElementById('LQNFXSUB'),
                movieElem = movieData.querySelector('.id' + movieId);

            if (movieElem) return;
Full LingQ Netflix Import Code
 async function extractSubs(movieObj) {
            let movieId = movieObj.movieId,
                movieData = document.getElementById('LQNFXSUB'),
                movieElem = movieData.querySelector('.id' + movieId);

            if (movieElem) return;

            movieElem = document.createElement('div');
            movieElem.setAttribute('class', 'id' + movieId);
            movieData.appendChild(movieElem);

            for (const track of movieObj.timedtexttracks) {
                if (!track.ttDownloadables || track.isForcedNarrative || track.isNoneTrack) continue;

                const webvttDL = track.ttDownloadables['webvtt-lssdh-ios8'];
                if (!webvttDL || !webvttDL.urls) continue;

                const bestUrl = Object.values(webvttDL.urls)[0];
                if (bestUrl) {
                    let text = document.createElement('textarea'),
                        lang = track.language;

                    switch(lang) {
                        case 'zh-Hans':
                            lang = 'zh';
                            break;
                        case 'zh-Hant':
                            lang = 'zh-t';
                            break;
                        case 'nb':
                            lang = 'no';
                            break;
                        case 'nn':
                            lang = 'no';
                            break;
                        default:
                            lang = lang.split('-')[0];
                    }

                    console.log('[' + movieId + '] Found', track.languageDescription,
                                'captions; code:', lang, '(' + track.language + ')');

                    text.setAttribute('class', lang);
                    text.setAttribute('name', track.languageDescription);
                    text.setAttribute('data-url', bestUrl['url']);
                    movieElem.appendChild(text);
                }
            }
        }

        async function extractInfo(url) {
            let opts = new URLSearchParams(url.split('?')[1]),
                elem = document.getElementById('LQNFXSUB').querySelector('.id' + opts.get('movieid'));

            if (!elem) return;

            let data = await fetch(url);
            if (data.ok) {
                let info = await data.json(),
                    title = info.video.title,
                    image = info.video.artwork[0].url,
                    descr = info.video.synopsis;

                if (info.video.currentEpisode) {
                    search:
                    for (const season of info.video.seasons) {
                        for (const episode of season.episodes) {
                            if (episode.id === info.video.currentEpisode) {
                                title += ' S' + season.seq + ':E' + episode.seq;
                                image = episode.stills[0].url;
                                descr = episode.synopsis;
                                break search;
                            }
                        }
                    }
                }

                elem.dataset.title = title;
                elem.dataset.image = image;
                elem.dataset.descr = descr;
            }
        }

        const originalStringify = JSON.stringify, originalParse = JSON.parse;

        JSON.stringify = function(value) {
            let orig = originalStringify.apply(this, arguments);
            if (value === undefined) return orig;

            let data = originalParse(orig);
            if (data && data.params && data.params.profiles) {
                data.params.profiles.unshift('webvtt-lssdh-ios8');
                return originalStringify(data);
            }
            return originalStringify.apply(this, arguments);
        };
        JSON.parse = function() {
            const value = originalParse.apply(this, arguments);
            if (value && value.result && value.result.movieId && value.result.timedtexttracks)
                extractSubs(value.result);
            return value;
        };

        const originalXHRopen = XMLHttpRequest.prototype.open;

        XMLHttpRequest.prototype.open = function(method, url) {
            if (url.includes('metadata?movieid')) extractInfo(url);
            return originalXHRopen.apply(this, arguments);
        }

The big take away is that we need to find this element ‘LQNFXSUB’.

Subtitles are stored in this datalink

it ends up downloading with some extra info around the subtitles but that can be fixed with some formatting code.

You can also just copy the Netflix url to SaveTheVideo or Use my Rooster Import tool.

1 Like

@ejackson What browser are you using and do you have the latest LingQ extension version installed?

I have tried Chrome (118.0.5993.89) and Firefox (118.0.2), the latest versions.

Using LingQ Extensions:
Version 2.3.23 for Chrome.
Version 2.2.23 for Firefox

Both begin transcript at ~25:30 and carry on to the end of the show.
I’m reading Norwegian CC, but I doubt that has anything to do with it.

Same symptoms if I pick up a Netflix show from the LingQ library. The last one I tried from the LingQ library is Bloodride in Norwegian, but I’ve tried many with the same results. If I pick a show that is shorter than about 25 minutes, I get nothing on Import, though I get the Imported" message.

This has been going on for many months, and I’ve always used the latest browser and extension versions. Symptoms have not changed since I first reported this months ago.

I used Language Reactor to identify exactly where the transcript begins. LR provides the complete transcript.

This bug greatly affects the utility of LingQ for me, and I hope it can be resolved in the near future.

Thanks. I’m only interested in text importing.

Thanks, we will investigate that.

Reply to -
"ejackson

Thanks, we will investigate that."

I’m just curious if other people have reported the same kind of problem. I also have language reactor and use it to get subtitles.

I was a paid member of Lingq for more than a year - it just didn’t fit my approach to language learning.

This was before Lingq started using Open AI’s whisper technology - I’ve been considering getting the paid plan if it can manage translation captions inside Lingq for me.

John

I have the same issue. When I use the Chrome LingQ importer to import Netflix content, the subtitles start from about half way through the programme.

I watched the Dustin Shermaul video from 2022 showing you how to do it but it just doesn’t work like so much with LingQ.

1 Like

I’ve noticed that LingQ has no problem importing complete LingQ shows for a couple of them in the LingQ library. I managed to import the whole of ‘Under the Amalfi Sun’ from when it starts at 0 minutes till when it finishes.

However, when I go into Netflix to import my own shows, the imported text / subtitles start from half way through the programme.

Can you put ‘Generation 56K’ in the LingQ library and have a go to import the full length of the shows in the series so I can import the full versions from your site?

Thank You.

@David72 Do you have the latest extension version installed?

I have version 2.3.12