您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
This is a script for Yandex TV and Mail.ru TV programmes that adds raw text for easier copying into any app as a plain text
// ==UserScript== // @name Raw text copier for TV programmes // @namespace https://tv.yandex.ru/ // @version 0.2 // @description This is a script for Yandex TV and Mail.ru TV programmes that adds raw text for easier copying into any app as a plain text // @author Kenya-West // @include https://tv.mail.ru* // @include https://tv.yandex.ru* // @grant none // ==/UserScript== setInterval(function () { main() }, 500) function main() { let textarea; document.querySelector("#textarea__rawtext") ? textarea = document.querySelector("#textarea__rawtext") : textarea = createTextarea(); textarea ? textarea.value = getInfo() : null; function createTextarea() { const textarea = document.createElement("textarea"); textarea.id = "textarea__rawtext"; textarea.classList = ["cols__column cols__column_small_14"]; textarea.style.height = 300; const parent = document.querySelector(".cols__column_sidebar > .cols__inner"); const ad = document.querySelector(".cols__column_sidebar > .cols__inner > .sticky-springs"); if (ad && parent) document.querySelector(".cols__column_sidebar > .cols__inner").insertBefore(textarea, ad); return textarea; } function getInfo() { let rawText = ""; document.querySelectorAll(".p-channels__items > .p-channels__item").forEach((element) => { rawText = rawText + element.querySelector(".p-channels__item__info .p-channels__item__info__title__link").innerText.replace(/LIVE$/gi, "") + "\n\n"; element.querySelectorAll(".p-programms__items > .p-programms__item").forEach((item) => { let info = ""; info = item.querySelector(".p-programms__item__time__value").innerText; info = info + " " + item.querySelector(".p-programms__item__name__link").innerText; rawText = rawText + info + "\n"; }); rawText = rawText + "\n\n"; }); return rawText; } }