Skip to content

Instantly share code, notes, and snippets.

@markx
Last active January 25, 2024 05:52
Show Gist options
  • Save markx/6c3b374699dae76a7f8e55f716c649e8 to your computer and use it in GitHub Desktop.
Save markx/6c3b374699dae76a7f8e55f716c649e8 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name oledvod mpv
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.olevod.com/static/player/plyr3.html
// @match https://www.olevod.com/static/player/videojs.html
// @grant GM_webRequest
// @grant GM_openInTab
// ==/UserScript==
'use strict';
let found = false;
function listener(info, message, details) {
console.log("!!!", info, message, details);
console.log("@@@", found);
// https://europe.olemovienews.com/ts2/20230228/GcHbghlC/mp4/GcHbghlC.mp4/index-v1-a1.m3u8
const url = details.url.replace(/(.*)\/^(?!hls).+?\.m3u8$/, '$1/master.m3u8')
if (found) {
console.log("!!!!!!!!", "already found", url);
return;
}
found = true
console.log("!!!found video: ", url);
GM_openInTab(`mpv://${url}`)
}
GM_webRequest([
{ selector: '*.m3u8', action: { cancel: true } },
], listener);
// ==UserScript==
// @name pangzi-mpv
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Play pangzitv videos with MPV.
// @author You
// @match https://pangzitv.com/h5-new/2.html
// @grant GM_webRequest
// @grant GM_notification
// @grant GM_setClipboard
// @grant GM_openInTab
// ==/UserScript==
'use strict';
let found = new Set()
function listener(info, message, details) {
const url = details.url
if (found.has(url)) {
return;
}
found.add(details.url)
GM_openInTab(`mpv://${url}`)
}
GM_webRequest([
{ selector: '*pzvcdn.com/*.m3u8', action: {cancel: true} },
], listener);
// ==UserScript==
// @name xiaobao-mpv
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Play xiaobaotv videos with MPV.
// @author You
// @match https://xiaobaotv.net/player/*
// @grant GM_webRequest
// @grant GM_notification
// @grant GM_setClipboard
// @grant GM_openInTab
// ==/UserScript==
'use strict';
let found = false
function listener(info, message, details) {
const url = details.url
console.log("!!!!!!!!!!!!!!!", url)
if (found) {
return;
}
found = true
GM_openInTab(`mpv://${url}`)
}
GM_webRequest([
{ selector: '*.m3u8', action: {cancel: true} },
], listener);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment