-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathvlogdownloader.user.js
73 lines (67 loc) · 2.3 KB
/
vlogdownloader.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
// ==UserScript==
// @name vlogdownloader
// @version 2020.02.20
// @author ytzong
// @include http*://*.vlogdownloader.com/*
// @copyright 2019+
// @run-at document-end
// @require https://cdn.rawgit.com/jprichardson/string.js/master/dist/string.min.js
// @grant GM_addStyle
// ==/UserScript==
GM_addStyle('');
var pathname = location.pathname;
if (pathname == '/download.html') {
var url = $('a[data-aa="video"]').attr('data-video')
if (url.includes('http')) {
let str = location.href
let index = str.indexOf('?') + 1
str = str.slice(index, str.length)
str = '&' + str
let id = getUrlParameter('id')
let url91 = 'http://91porn.com/view_video.php?viewkey=' + id
location.href = url91 + '&url=' + encodeURIComponent(url)
//'https://rss.ytzong.com/player.htm?url=' + encodeURIComponent(url) + str
}
}
if (pathname == '/') {
var hash = location.hash;
if (hash.length > 1) {
if (hash.slice(0, 1) == '#') {
let id = hash.split('=')[1]
window.localStorage.setItem(id, id)
location.href = 'https://www.vlogdownloader.com/'
/*
window.setTimeout(function(){
let str = location.href
//str = S(str).replaceAll('_hd.php', '.php').s
let index = str.indexOf('&id=') + 1
str = str.slice(index, str.length)
str = '?' + str
let form = $('#vlog').attr('action')
form = form + str
$('#vlog').attr('action', form)
$('.btn-primary').click()
}, 2500)
*/
}
}
else {
let id = window.localStorage.key(0)
let url91 = 'http://www.91porn.com/view_video.php?viewkey=' + id
$('input[name="url"]').val(url91)
let form = $('#vlog').attr('action')
form = form + '?id=' + id
$('#vlog').attr('action', form)
$('.btn-primary').click()
window.localStorage.removeItem(id)
}
}
if (getUrlParameter('code') == '403') {
window.history.back()
}
function getUrlParameter(name) {
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
var results = regex.exec(location.search);
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
}