iOS Filman.cc url extractor

url extractor dla Filman.cc w safari iOS dla apki 'Userscripts'

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name     iOS Filman.cc url extractor
// @description url extractor dla Filman.cc w safari iOS dla apki 'Userscripts'
// @version  1
// @grant    none
// @match  https://filman.cc/*
// @match  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);
        }
    }
});