您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
產生 HLS 連結
// ==UserScript== // @name PILI HLS // @namespace http://tampermonkey.net/ // @version 0.1 // @description 產生 HLS 連結 // @author 阿皇仔 // @match https://play.pili.com.tw/filmPlay/* // @icon https://www.google.com/s2/favicons?domain=pili.com.tw // @grant none // @run-at document-end // ==/UserScript== /* jshint esversion: 8 */ (async function() { 'use strict'; // Your code here... var fileId = document.URL.match(/https?:\/\/.+?\/filmPlay\/(.+)/).at(1); var idToken = document.cookie.match(/idToken=(.+?);/).at(1); var data = await fetch("https://play.pili.com.tw/api/file/getFilmInfo", { method: "POST", headers: { "content-type": "application/json;charset=utf-8", "idtoken": idToken }, body: JSON.stringify({ fileId: fileId, platform: "web" }), credentials: "include" }).then(response => { return response.json(); }).then(result => { return result; }); var fileUrl = data.fileUrl; var purpleBtn = document.querySelectorAll(".b-action > .btn.btn-purple.btn-round").item(0); var myBtn = document.createElement("a"); myBtn.className = purpleBtn.className; myBtn.href = fileUrl; myBtn.innerText = "HLS下載"; purpleBtn.parentNode.insertBefore(myBtn, purpleBtn); })();