-
Notifications
You must be signed in to change notification settings - Fork 10
/
douban.user.js
128 lines (109 loc) · 3.49 KB
/
douban.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
// ==UserScript==
// @name Douban
// @version 2023.10.21
// @author ytzong
// @description Douban
// @include http*://www.douban.com/doulist/*
// @include http*://m.douban.com/subject_collection/*
// @include http*://movie.douban.com/explore
// @include http*://movie.douban.com/subject/*
// @copyright 2020+
// @run-at document-end
// @grant GM_addStyle
//// @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js
// ==/UserScript==
GM_addStyle('.yt-year, .yt-type, .yt-country {background-color:yellow}')
let pathname = location.pathname
if (pathname.includes('/subject/')) {
let votes = document.querySelector('span[property="v:votes"]').textContent
if (parseInt(votes) < 1000) {
window.close()
}
}
if (pathname.includes('/subject_collection/')) {
GM_addStyle('.TalionNav-static, .items + div{display:none!important}')
window.setTimeout(function () {
$('.interest-done').each(function () {
$(this).parents('.movie').parent().parent().parent().hide()
})
$('div').each(function () {
//if ($(this).text().includes('打开App')) $(this).parent().hide()
})
}, 2000)
}
function isInView(el) {
let box = el.getBoundingClientRect();
return box.top < window.innerHeight && box.bottom >= 0;
}
if (pathname.includes('/explore')) {
GM_addStyle(`
#content{padding-bottom:250px}
`)
window.setInterval(function () {
hideExplore()
}, 1000)
window.addEventListener("scroll", function () {
var footer = document.getElementById("footer");
var visible = isInView(footer);
if (visible) {
document.querySelector('.explore-more button').click()
}
})
}
function hideExplore() {
let blacks = [
'短片'
, '动画'
, '纪录片'
, '音乐'
, '戏曲'
, '歌舞'
, '脱口秀'
, '家庭'
, '/ 英国 /'
, '/ UK 英国 /'
]
jQuery('.drc-subject-info-subtitle').each(function () {
let shoudHide = 0
let des = jQuery(this).text()
for (let b of blacks) {
if (des.includes(b.trim())) shoudHide = 1
}
if (!des.startsWith('199') && !des.startsWith('2')) {
shoudHide = 1
}
if (shoudHide == 1) jQuery(this).parents('li').hide()
})
if (!jQuery('.drc-checkbox-simulation').hasClass('checked')) {
jQuery('.simulation').click()
}
// if (jQuery('.base-selector-title').eq(-1).text() == '排序') {
// jQuery('.base-selector-title').eq(-1).click()
// }
}
if (pathname.includes('/doulist/')) {
let blacks = [
'印度'
, '动画'
//,'同性'
]
jQuery('.abstract').each(function () {
jQuery(this).contents().not('a, span, br').wrap('<span>')
jQuery(this).children('span').eq(-1).addClass('yt-year')
jQuery(this).children('span').eq(-2).addClass('yt-country')
jQuery(this).children('span').eq(-3).addClass('yt-type')
let shoudHide = 0
let des = jQuery(this).text()
//if (!des.includes('年份: 198')) shoudHide = 1
for (let b of blacks) {
if (des.includes(b.trim())) shoudHide = 1;
}
let whites = [
'美国'
]
for (let w of whites) {
if (!des.includes(w.trim())) shoudHide = 1;
}
if (shoudHide == 1) jQuery(this).parents('.doulist-item').hide()
})
}