iOS Filman.cc url extractor

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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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);
        }
    }
});