This repository has been archived by the owner on Jul 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BsWatch7.user.js
58 lines (49 loc) · 1.71 KB
/
BsWatch7.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
// ==UserScript==
// @name BsWatch - File 7
// @icon https://bs.to/opengraph.jpg
// @namespace http://www.greasespot.net/
// @include /^https:\/\/vivo\.sx\/.+$/
// @version 1.5
// @description Vivo Direct-Link
// @author Kartoffeleintopf
// @run-at document-start
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js
// @require https://raw.githubusercontent.com/Kartoffeleintopf/BsWatch/master/Scripts/cookiecontroll.js
// @require https://raw.githubusercontent.com/Kartoffeleintopf/BsWatch/master/Scripts/init.js
// @downloadURL https://raw.githubusercontent.com/Kartoffeleintopf/BsWatch/master/BsWatch7.user.js
// ==/UserScript==
makeBlackPage();
//disable scrollbars .. for ... reasons
document.documentElement.style.overflow = 'hidden'; // firefox, chrome
//When document loaded
$(document).ready(function () {
//Start the redirect process
setTimeout(startRedirect, 1000);
});
//Click on the Video so the mp4 link appears
function startRedirect() {
var elem = document.getElementsByClassName('needsclick');
if (elem.length != 0) {
elem[0].click();
interval = setTimeout(openVideo, 100);
} else {
window.location = 'https://bs.to/?error';
}
}
var interval;
var timer = 0;
//Get the mp4 link
function openVideo() {
timer++;
var elem = document.getElementsByTagName('video');
if (elem.length != 0) {
var vidLink = elem[0].getAttribute("src");
window.location = vidLink;
} else {
if (timer < 100) {
interval = setTimeout(openVideo, 100);
} else {
window.location = 'https://bs.to/?error';
}
}
}