Skip to content

Breaker for users to read long subtitles while watching Netflix.

License

Notifications You must be signed in to change notification settings

emirgoren/breaker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

breaker

Breaker for users to read long subtitles while watching Netflix.

Usage

1 => Open the video from Netflix. Like `https://www.netflix.com/watch/70189007`.
2 => Enter the script to Chrome's console.
let netflixStoppedOn = '';

let mainInterval = setInterval(() => {
    breaker(mainInterval);
}, 1000);

function breaker(interval){
    let subtitleFirstParent = document.getElementsByClassName("player-timedtext")[0];
    let subtitleSpans = subtitleFirstParent.children[0]?.children;
    if(subtitleSpans !== undefined) {
        let subtitle = '';
        for(let i = 0; i < subtitleSpans.length; i++) {
            subtitle += subtitleSpans[i].innerText;
        }
        
        if(subtitle.length >= 45 && subtitle !== netflixStoppedOn){
            const video = document.getElementsByTagName("video")[0];
            video.pause();
            netflixStoppedOn = subtitle;

            clearInterval(interval);
            setTimeout(() => {
                video.play();
                mainInterval = setInterval(() => {
                    breaker(mainInterval);
                }, 1000);
            }, 1700);
        }
    }
}

About

Breaker for users to read long subtitles while watching Netflix.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published