-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathPlay Hosted Videos in Potplayer.user.js
64 lines (54 loc) · 2.29 KB
/
Play Hosted Videos in Potplayer.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// ==UserScript==
// @name Play Hosted Videos in Potplayer
// @namespace http://tampermonkey.net/
// @updateURL https://openuserjs.org/meta/grenzionky/Play_Masterani_in_Potplayer.meta.js
// @downloadURL https://openuserjs.org/src/scripts/grenzionky/Play_Masterani_in_Potplayer.user.js
// @version 1.3
// @license MIT
// @description Will automatically play videos in potplayer that are hosted on video hosting sites (if a site is missing request it, or pull the link)
// @author Abraham Gross
// @include *mp4upload.com*
// @include *streamango.com*
// @include *rapidvideo.com*
// @include *openload.co*
// @include *stream.moe*
// @include *vidstreaming.io*
// @include *masterani.me*
// @include *msembed.net*
// @include https://www.watchcartoononline.com/*
// @grant GM_openInTab
// @grant GM_xmlhttpRequest
// ==/UserScript==
/*
!!!IMPORTANT!!!
You must first set up potplayer for this to work:
add this to regedit (source: https://stackoverflow.com/a/31206594/5287133):
[HKEY_CLASSES_ROOT\potplayer\shell\open\command]
@="cmd /k ( set \"var=%1\" & call set var=%%var:potplayer://=%% & call C:\\PotPlayer\\PotPlayer.exe %%var%%)"
Or if you're not sure how to, here's a .reg file that will do it for you:
https://drive.google.com/file/d/1FcXvFzT1FDaN4AQBNKb4Qe9Dd0_WuD1g/view?usp=sharing
*/
(function() {
window.addEventListener("load", function(event) {
console.log(window.location.href);
if(window.location.href.includes("stream.moe")) {
var text = document.querySelector('#moe-framer').innerText;
var enc = text.substring(text.indexOf("atob('"));
openVideo(new DOMParser().parseFromString(atob(enc.substring(6, enc.indexOf("');"))), "text/html"));
} else if(window.location.href.includes("openload.co")) {
document.querySelector("#videooverlay").onclick = function(){openVideo(document);}
} else {
openVideo(document);
}
});
})();
function openVideo(document) {
var video = document.getElementsByTagName('video')[0];
try {
video = video.firstElementChild.src;
} catch(error) {
video = "potplayer://"+video.src;
}
console.log(video);
GM_openInTab(video, {loadInBackground: true}).close();
}