-
Notifications
You must be signed in to change notification settings - Fork 1
/
s.to C Stream Hosters.user.js
136 lines (127 loc) · 4.57 KB
/
s.to C Stream Hosters.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
// ==UserScript==
// @name s.to C Stream Hosters
// @author https://github.com/Skeeve
// @updateURL https://github.com/Skeeve/TamperMonkey-User-Scripts/raw/master/s.to%20C%20Stream%20Hosters.user.js
// @downloadURL https://github.com/Skeeve/TamperMonkey-User-Scripts/raw/master/s.to%20C%20Stream%20Hosters.user.js
// @namespace http://tampermonkey.net/
// @version 10
// @description try to take over the world!
// @author You
// @icon https://www.google.com/s2/favicons?sz=64&domain=launchreliantcleaverriver.com
// @grant GM_xmlhttpRequest
//
// @match http://streamcloud.eu/*/.html
// @match https://openload.co/embed/*
// @match https://streamango.com/embed/*
// @match https://streamtape.com/*
// @match https://vidoza.net/*
// @match https://vidoza.org/*
// @match https://vivo.sx/*
// @match https://voe.sx/*
// @match https://gounlimited.to/*
// @match https://oload.stream/*
// @match https://upstream.to/*
// @match https://streamtape.com/*
// @match https://launchreliantcleaverriver.com/*
// @match https://dood.pm/*
// @match https://reputationsheriffkennethsand.com/*
// @match https://fittingcentermondaysunday.com/*
// @match https://fraudclatterflyingcar.com/*
// @match https://bigclatterhomesguideservice.com/*
//
// ==/UserScript==
(function() {
'use strict';
// My default location for storing stuff
var TARGET='/Volumes/Multimedia/Mediatheken/Serien';
// A tag used to signal to jDownloader what to do with the links
var TAG4JD='#S-TO#';
// Separator between information parts
var SEP='__';
// flashgot link of jDownloader
var JDOWNLOADER="http://127.0.0.1:9666/flashgot";
// Used to signal to the script that the window can be closed
var DONE='*DONE*';
function toJDownloader (link) {
// The name is stored in the window name in the form of
// SERIES $SEP SEASON# $SEP EPISODE# $SEP TITLE $SEP SEASONDIR
if ( window.name === DONE ) {
window.close();
return;
}
var sinfo= window.name.split(SEP);
if (sinfo.length == 1) {
// Oops. It's missing. Search in the hash part
sinfo= decodeURIComponent(document.location.hash.substr(1)).split(SEP);
if (sinfo.length == 1) {
alert("Oops!");
return;
}
}
var pckg= "";
var saveto="";
// So if we have something matching the pattern
if ( sinfo.length >=4 ) {
// The pckg becomes the Series
pckg= sinfo[0];
// The link gets tagged and will get the new filename in the form
// EPISODE# " - " TITLE
link+= TAG4JD + fill0(sinfo[2], 2) + " - " + sinfo[3];
// This will be the dwnload target
// $TARGET "/Season " SEASON# "/"
saveto= TARGET + "/" + sinfo[0] + "/" + sinfo[4] + " " +sinfo[1] + "/";
}
// collect the data to send to JD
var data= {
"passwords" : "",
"source": "",
"package": pckg,
"urls": link,
"dir": saveto,
"submit": "submit"
};
console.debug(JDOWNLOADER, data);
// alert(JSON.stringify(data));
// Send the data
GM_xmlhttpRequest({
method: "POST",
url: JDOWNLOADER,
data: objEncodeURIComponent(data),
headers: {
"Content-Type": "application/x-www-form-urlencoded"
},
onload: function(response) {
if ( response.status === 200 ) {
document.querySelector('body').textContent="DONE!";
window.name=DONE;
window.location.reload();
console.log("Would close now");
}
else {
console.log(response);
}
},
});
}
function objEncodeURIComponent(obj) {
var str = [];
for (var p in obj) {
if (obj.hasOwnProperty(p)) {
str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
}
}
return str.join("&");
}
// Prepend some zeros
function fill0(x, num) {
x= ""+x;
return "0".repeat(Math.max(2-x.length,0)) + x;
}
var m = document.body.innerHTML.match(/"hls"\s*:\s*"(.*?)"/);
if (m !== null && m.length > 1) {
toJDownloader(m[1]);
} else {
// Send current page - after some preparing - to jDownloader
toJDownloader(document.location.href.replace(/#.*$/, ''));
}
})();