LinkedIn Learning videos download directly from listing out (basic version for videos only)

LinkedIn Learning videos download directly from listing out (basic version for videos only).

// ==UserScript==
// @name         LinkedIn Learning videos download directly from listing out (basic version for videos only)
// @namespace    http://lyndasub.mybanzou.net/
// @version      0.1.2
// @description  LinkedIn Learning videos download directly from listing out (basic version for videos only).
// @author       ▷Please ask me for scripts that can download subtitles, translate subtitles directly, and batch download videos from LinkedIn Learning.▷ banzou01@gmail.com
// @match        https://www.linkedin.com/learning/*/*u=*
// @include      about:blank
// @icon         data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAARc0lEQVR4Ae1baWxbV3qNEzfBOLFWW9ROiZIoyRbldVpkgE7RPy0w86PTYAoMipk2sRNbIrWQkhwn7rRwmqL9M546oq19t6xd4p6xMk6Cpo5NSpQoUXyWlzTbTJYCaZx1JCfOPcV337vkI0UKcjztj7ENnNxHvvcEn/Odb7nXyn0AHribcd/dTJ643xPgngPu1YB7RfBeF7ib68C9LhAT/U33/YH/AbBJzTnsgDFJevAvpt7I+P7ItfLvjy0bCN8buVzx6NiyIYzBZcOjHEHDo4MR7KfnBoOGfRuAYTBoIFQOLFYY2v2GfUd/bdhX4zFU1k1XGGo8hihYPAaDCuV10xVlFo9BrHQtUF7n5vfE56Imd4XO4jGIla5LnnaXVx6fzjg+Jj0oRBACbCLyfzwsHfvusOTbPyRd3j8khfYRzoZCe8+GpL2DIWmPgt1nliTCroEgR+VgMFQ5EAwZ+oISoaIvKO1UYUfvgkQoJ/QsSGU9AUnfuxAqOz0b2mF5SSo/5JHKD78YKqvySBzVHknP4ZZKTDKKTW6pyOgOFZncIR2Hi1ZJV+OWCmpcIW2NK5RfS3BL+bVOKa/WGcol1LtC2fXOUE6983JOndOXZ3EfIxGEE7gA5HqK/HeHLxN57Dsbwt4hCXtpPRvCnsEl7D4Twa6BJVSeWULlQJDD0B9ERX8QOwl9i9hB6F1EOccCynsCKOtZ4CjtDoCgJ5yaRZl5GmWHPCg97EFpl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IHi9coWm+JFoknwXE99TvxbVY174b9QyfHTQnLmDbUTf/Bwt+kBHu83SSY6eWFdXCxJY2ZlWIySc+MffWvH9bDtAoQ44gpRZAuScTEQJYfUxDUD7HiBD+XmP1Mo3ViwxFAHm6E8fW8jFWipyvawjEIaiMuREBxNjLf0ajLepAJIXOBOMdiSkOCM8BConIX1qQ3MBKxFXkxc8QK7lFLUD4CIuOrmm8XUOeTnTkUx1h47AwRFZAiBMWoEkmr/7MBYh3LK7MAeEiuDb6URZeY3kRdbEqAgjSYo28R13gxOss/ahbznt+YhuJoiATb40lHPPMGpGi7idygNIG1QJE/rKqqIvoqiK85rn17oVTREmB9Gdc8s6On9puTIAoQjF1IhztBCmUsAYkSIE15ESEaV1b/Hz8u7XfK+6J7DPkOeDEBaQ941Jsb19r/Rhy6xEX96jX834fK0D4+wT/LqDr8Ok1zZfOa5q9v9M0+1Yzmr0rBA2Hb5W+i4b6nndFY/WuZIafV9+LvJdpjVxrrL7VjBMXVtKeca0kN9pXkpvs4TWlybZKoO/EtfjMn6NnozAV/Vn8PPUzjfxnfZFyxPZSzrMefdRviAC4f3dvICXX6v1pVrO3P7PZO5n5gneCw0rrJRW8E5n8O+U+PWf1TmSd8o5nRb0T/V7WC5cm6H4WvUvP03riwkT6MddESpNtIuVIHCT8fmo8pen2kHrEPpZ2xNG+7aj9bw3/5k4lzuFflKSLV1/F5n3t/mRduz+/tNNX+P8Cq69Q+/x0ofbnzv9zFBy3FRQffzH3T5pfTCKusb8rLP6nCVKFfpv6Dxk88okEEELcNav4bfG7hrCIvFjvCSCUuFvXew64WyMveN9zgFDibl3/F+XcMTeAcNL6AAAAAElFTkSuQmCC
// @grant        GM_xmlhttpRequest
// @grant        GM_setClipboard
// ==/UserScript==

(function() {
    'use strict';

    function leftPad(number, targetLength) {
        var output = number + '';
        while (output.length < targetLength) {
            output = '0' + output;
        }
        return output;
    }

    function validateTitle(title) {
        var newTitle = title.replace(/[\\\/:*?"<>|\r\n]/g, '_');
        return newTitle.trim();
    }
    if (document.body.innerHTML.match('My Learning')) {
        let newWindow = unsafeWindow.open('', '_blank', 'toolbar=yes,scrollbars=yes,resizable=yes,top=10,left=10,width=640,height=800');
        newWindow.document.body.innerHTML = '<div id="myPanel" style="background-color:rgba(88,201,98,0.7); color: #1F792C; "><div style="width:30%; text-align: center; height:800px; background-color:rgba(88,201,98,0.4); float:right;"><div style="padding-top: 100px;"><a href="mailto:banzou01@gmail.com"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAI8AAAA7CAMAAAB15inCAAABoVBMVEUAAAC/IBvFIx3EIh7FIh2/IBj8uQP7vAT7vAT8vAP7vQT/vwDFIh7FIh7HIx77vATEIx3LJiDvgBj7uwT8vAPOKiPqQzXnSDDsQzbtUy78vAXqQzXfQDDrQjXsUi9gcHBgYGheY2deYmhgYGhgaGjrQjbqRDVfY2hfY2hfY2hgYGBfY2hfY2hgYHBkZG1fYmhfY2jrQzRfY2deYmhgYGhfY2hdYmi0Lji/txtfYmdgZGhgZGhgZWVeY2hfY2ddYmZfYmdgYGhChfSMTXzuugl/rzU1qFNfZGlfYmlgY2ZzYKO9KCvWuBNNqkk0qFNgY2hgYGBSednpQzWksydBqU5hY2lgampeY2lgaGhfZGdjY3FeY2hfY2lgaGheZGdgZ2hfY2heY2e+Nz5gYmhgYmhDhPTqQzPqQjS9XDxeYmhgYGVgY2ZgZGheYWhgYGjqQjXqQjXpQjXnQDgwp1BfYmjpQjXoQzXfQEBfYmdgY2leYmhfY2leZGhfY2lcY2ZgY2ddYmhmZnPqQzVgY2hgY2hBhfQzqVNAh+9BhPQzqFM0qFQibcUZAAAAi3RSTlMAML/vnyBQv//fjxD/31/Pv38gz1//3yBf75//EI//EGBvgEAgf8+//58R394QAd++769/Qf5g/5/vgEAwoO9w7iD/////n8/PUP//////oBD/oP//XwFfIY4BkK4BjyGecP9hYL+Q74CwMFFBjyFg788gIN7fkBDPUK/PgK9Qb2EBv4+Qv18gv+9w8OziVgAAAuNJREFUeAHszoMVxAAQBcAf83yx3X+FZxvJPu1UMGBUGGOMMSaIkiQreEbVdMO0QEaR7I3RGA9Zpr41AZmpvTfDA/OFvrcEFfvAcT3c8gP9IKT/RK6PK3ESpa8+WV6URZXhO1lVf/iJogYXvDZ69am6dXt1ods2AEVh+LzFeJEC8gl4waIbLjMzM9Ow3DE89XTnWA46MN7yF8OffALUcztRRR4vfSqe+BmowPMga7O7wQcWHluIZmFUXoRsaLTyNGV7jM1kqwfZnmbk5PSSLa0agLZojIyj4jx+JpJWnlTa9EguY6ssT3tHJ3LqIhUVekl/t4rKS/aosPSkevuyPLKZbJXt6R8YzPWEySHAaFhFtVl6UiNNpkdAo/Lb9IyND+Z6nKS/pCGZhARb5h/jhK1Sj5Q2PWbika0GB/M8jeQECppUlClbOEZ6w8C0EiNjM9kvRWUKAGbnlPmyHtmsuEe2KvAoJApbIKNeUlpcipHSMgCsUK8hDFHTZ+3RG1kt6pGtCjx+KsU9pFvT1uTIUOnR1v1s0IAleSm2Gacq8kgbm4WcrW2xFHjIHehNKZkCuxBPKwDsGQdmnzwAktGGJAAcxsRQuQdHx3mck9OnRT0xuqFnZ6YGTTzPIHlIEZiPqhpXblCr8eD0eQ7nxUsU9/j5Cnpn7m8pGc85shjGsQAccxd+/4X7UpjVeIDNrK2OgBKeK8ZUZHfNBtmLy0U9dhpV7TE2k61Q0hPP/4SIsgElPXZ5Pvdo2o2/eo+xmWxV2jMco1fNfX88L+l54hWGdFuLB9jUt7LwwE66YRZig1bS4xGs9DpamwdHb05h7YFCKk7j6CjkW1h59FMR1uIxsvYM+0m6HTbYHHMxslst6ZFfDWEbbHb+RA+GozR7p6K0B/skKf7oT/QAmkI9RQOsPNgTDBPa7U/1AKq2bl/vUVE+7eZGU2Fd7Z6f2/uKPB/wq/r4qbzn8xfUq1evXr169er99X0FhDMo++YgniwAAAAASUVORK5CYII=" width="150px">banzou01@gmail.com</a></div><div style="padding: 10px;">Please Donate Me!</div><a href="http://paypal.me/pendave" target="_blank"><img src="https://www.paypalobjects.com/webstatic/paypalme/images/social/pplogo384.png" width="100px">Paypal.me/pendave</a><hr>▲ Please ask me for scripts that can download subtitles, translate subtitles directly, and batch download videos from LinkedIn Learning.<br />Not FREE!<br />Accept Paypal.▲<hr></div><div id="myfloat" style="width:70%; height:779px; background-color:rgba(88,201,98,0.7); float:left; overflow-y: auto;"></div></div>';
        var newDiv = newWindow.document.body.querySelector('#myfloat');
        var chaptersNodes = document.querySelectorAll('section.classroom-toc-section');
        for (var n = 0; n < chaptersNodes.length; n++) {
            if (chaptersNodes[n].querySelector('button').getAttribute('aria-expanded') == "false") {
                chaptersNodes[n].querySelector('button').click();
            }
        }
        setTimeout(function() {
            if (!chaptersNodes[1].querySelector('span.classroom-toc-section__toggle-title').textContent.match(/1\.\s.+/)) {
                for (var h = 0; h < chaptersNodes.length; h++) {
                    chaptersNodes[h].querySelector('span.classroom-toc-section__toggle-title').textContent = h + '. ' + chaptersNodes[1].querySelector('span.classroom-toc-section__toggle-title').textContent.trim().replace(/\d+\.\s/, '');
                }
            } else {
                chaptersNodes[0].querySelector('span.classroom-toc-section__toggle-title').textContent = '0. ' + chaptersNodes[0].querySelector('span.classroom-toc-section__toggle-title').textContent.trim();
                if (!chaptersNodes[chaptersNodes.length - 1].querySelector('span.classroom-toc-section__toggle-title').textContent.match(/\d+\.\s.+/)) {
                    chaptersNodes[chaptersNodes.length - 1].querySelector('span.classroom-toc-section__toggle-title').textContent = chaptersNodes.length - 1 + '. ' + chaptersNodes[chaptersNodes.length - 1].querySelector('span.classroom-toc-section__toggle-title').textContent.trim();
                }
            }
            var videoNodes = document.querySelectorAll('a.classroom-toc-item__link');
            var videoTitleNodes = document.querySelectorAll('div.classroom-toc-item__title');
            for (var j = 0; j < videoNodes.length; j++) {
                var videoUrl = videoNodes[j].href;
                var videoTitle = validateTitle(videoTitleNodes[j].firstChild.wholeText.trim());
                console.log(videoTitle);
                console.log(j + ' / ' + videoTitleNodes.length + ' : ' + videoUrl);
                var idSrtPart = 'srtLoad' + j;
                var idVideoPart = 'videoLoad' + j;
                var idCopyName = 'copyName' + j;
                newDiv.innerHTML += '<div style="border-radius:10px; border: 1px solid white; padding: 3px; margin: 3px 2px;"><div id=' + idSrtPart + '></div><div id=' + idVideoPart + '>🎞️<button style="float: right;" id=' + idCopyName + '>✂ Video name</button></div></div>';
                let indexTimeArray = [];
                let textLineTransArray = [];
                var ret = GM_xmlhttpRequest({
                    method: "GET",
                    url: videoUrl,
                    onload: callback_function.bind({}, j, newDiv, videoTitle, indexTimeArray, textLineTransArray)
                });
            }
        }, 6000);

        function callback_function(num, newBuiltDiv, video_title, indexTimeArray, textLineTransArray, responseDetails) {
            let container = document.implementation.createHTMLDocument().documentElement;
            container.innerHTML = responseDetails.responseText;
            var codeNodes = container.querySelectorAll('code');
            for (var k = 0; k < codeNodes.length; k++) {
                if (codeNodes[k].textContent.match('learningApiTranscript')) {
                    var result = JSON.parse(codeNodes[k].textContent),
                        downloadVideoLinks = result['included'][2]['presentation']['videoPlay']['videoPlayMetadata']['progressiveStreams'],
                        downloadVideoLink;
                    for (var l = 0; l < downloadVideoLinks.length; l++) {
                        if (downloadVideoLinks[l]["height"] == 720) {
                            downloadVideoLink = downloadVideoLinks[l]["streamingLocations"][0]["url"];
                        }
                    }
                    var span = document.createElement('span');
                    span.download = leftPad(num, 2) + '. ' + video_title;
                    var linkText = document.createTextNode(leftPad(num, 2) + '. ' + video_title);
                    span.appendChild(linkText);
                    console.log('Callback with parameters (' + num + ').');
                    newBuiltDiv.querySelector('#srtLoad' + num).appendChild(span);
                    newBuiltDiv.querySelector('#videoLoad' + num).innerHTML += '<a href="' + downloadVideoLink + '" title="' + video_title + '" download="' + video_title + '.mp4" style="background-color: #46ED52;">' + leftPad(num, 2) + ' ⇩ video</a>';
                    newBuiltDiv.querySelector('#videoLoad' + num).innerHTML += '<span style="float: right; color: white;">' + downloadVideoLink.match(/\d{13}/g)[0] + ' </span>';
                }
            }
            var srtNodes = newBuiltDiv.querySelectorAll('div[id*="srtLoad"]');
            for (var q = 0; q < srtNodes.length; q++) {
                (function(q) {
                    newBuiltDiv.querySelector('#copyName' + q).onclick = function() {
                        GM_setClipboard(newBuiltDiv.querySelector('#srtLoad' + q + ' > span').innerText + '.mp4');
                        this.style.backgroundColor = '#46ED52';
                    };
                })(q);
            }
        }
    }
})();