Filman.cc url extractor

url extractor for Filman.cc

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name     Filman.cc url extractor
// @description url extractor for Filman.cc
// @version  1
// @grant    none
// @include  https://filman.cc/*
// @include  https://www.filman.cc/*
// @namespace https://greasyfork.org/users/1079192
// ==/UserScript==

window.addEventListener('load', function () {
    const links = document.getElementById('links');
    if (links !== null) {
        const header = links.children[0];
        const rows = links.children[1];
        let colsDefinitions = undefined;
        if (header.childElementCount > 1) {
            colsDefinitions = header.children[header.childElementCount - 1];
        } else {
            colsDefinitions = header.children[0];
        }
        const newCol = document.createElement('th');
        newCol.classList.add('header');
        newCol.innerHTML = 'URL';
        colsDefinitions.appendChild(newCol);


        for (let row of rows.children) {
            let link_data = undefined;
            try {
                link_data = JSON.parse(atob(row.getElementsByClassName('link-to-video')[0].children[0].getAttribute('data-iframe')));
            } catch (error) {
                link_data = 'NO DATA';
            }
            const newCol = document.createElement('td');
            const link = document.createElement('input');
            link.value = link_data.src;
            link.onclick = function () {
                this.select();
                navigator.clipboard.writeText(this.value);
            };
            newCol.appendChild(link);
            row.appendChild(newCol);
        }
    }
});