merge upstream

This commit is contained in:
rainbownapkin 2022-06-26 20:38:05 +00:00
commit e7adec32d7
12 changed files with 1457 additions and 7136 deletions

20
.gitignore vendored Normal file
View file

@ -0,0 +1,20 @@
*.swp
cfg.json
config.yaml
chandump
chanlogs
*.log
node_modules
*.crt
*.cert
*.key
torlist
www/cache
google-drive-subtitles
lib/
integration-test-config.json
conf/*.toml
www/js/cytube-google-drive.user.js
www/js/cytube-google-drive.meta.js
www/js/player.js
tor-exit-list.json

7345
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -2,14 +2,14 @@
"author": "Calvin Montgomery", "author": "Calvin Montgomery",
"name": "CyTube", "name": "CyTube",
"description": "Online media synchronizer and chat", "description": "Online media synchronizer and chat",
"version": "3.82.8", "version": "3.82.11",
"repository": { "repository": {
"url": "http://github.com/calzoneman/sync" "url": "http://github.com/calzoneman/sync"
}, },
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@calzoneman/jsli": "^2.0.1", "@calzoneman/jsli": "^2.0.1",
"@cytube/mediaquery": "0.0.25", "@cytube/mediaquery": "github:CyTube/mediaquery#4f803961d72a4fc7a1e09c0babaf8ea685013b1b",
"bcrypt": "^5.0.1", "bcrypt": "^5.0.1",
"bluebird": "^3.7.2", "bluebird": "^3.7.2",
"body-parser": "^1.19.0", "body-parser": "^1.19.0",
@ -27,14 +27,14 @@
"lodash": "^4.17.21", "lodash": "^4.17.21",
"morgan": "^1.10.0", "morgan": "^1.10.0",
"mysql": "^2.18.1", "mysql": "^2.18.1",
"nodemailer": "^6.5.0", "nodemailer": "^6.6.1",
"prom-client": "^13.1.0", "prom-client": "^13.1.0",
"proxy-addr": "^2.0.6", "proxy-addr": "^2.0.6",
"pug": "^3.0.2", "pug": "^3.0.2",
"redis": "^3.1.1", "redis": "^3.1.1",
"sanitize-html": "^2.3.3", "sanitize-html": "^2.7.0",
"serve-static": "^1.14.1", "serve-static": "^1.14.1",
"socket.io": "^4.1.3", "socket.io": "^4.5.0",
"source-map-support": "^0.5.19", "source-map-support": "^0.5.19",
"toml": "^3.0.0", "toml": "^3.0.0",
"uuid": "^8.3.2", "uuid": "^8.3.2",
@ -60,7 +60,7 @@
"babel-plugin-add-module-exports": "^1.0.4", "babel-plugin-add-module-exports": "^1.0.4",
"coffeescript": "^1.9.2", "coffeescript": "^1.9.2",
"eslint": "^7.32.0", "eslint": "^7.32.0",
"mocha": "^10.0.0", "mocha": "^9.2.2",
"sinon": "^10.0.0" "sinon": "^10.0.0"
}, },
"babel": { "babel": {

View file

@ -19,7 +19,6 @@ TYPE_MAP =
tc: TwitchClipPlayer tc: TwitchClipPlayer
cm: VideoJSPlayer cm: VideoJSPlayer
window.loadMediaPlayer = (data) -> window.loadMediaPlayer = (data) ->
try try
if window.PLAYER if window.PLAYER
@ -119,7 +118,6 @@ window.handleMediaUpdate = (data) ->
PLAYER.seekTo(time) PLAYER.seekTo(time)
PLAYER.latchseek() PLAYER.latchseek()
) )
window.removeOld = (replace) -> window.removeOld = (replace) ->
$('#soundcloud-volume-holder').remove() $('#soundcloud-volume-holder').remove()

View file

@ -16,7 +16,6 @@ AnonymousCheck.prototype.onUserPreJoin = function (user, data, cb) {
} }
if(anonymousBanned && user.isAnonymous()) { if(anonymousBanned && user.isAnonymous()) {
//if(anonymousBanned && user.account.globalRank <= 0) {
user.socket.on("disconnect", function () { user.socket.on("disconnect", function () {
if (!user.is(Flags.U_IN_CHANNEL)) { if (!user.is(Flags.U_IN_CHANNEL)) {
cb("User disconnected", ChannelModule.DENY); cb("User disconnected", ChannelModule.DENY);

View file

@ -710,7 +710,6 @@ PlaylistModule.prototype.handleMoveMedia = function (user, data) {
return lock.release(); return lock.release();
} }
} else { } else {
if (!self.items.insertAfter(from, data.after)) { if (!self.items.insertAfter(from, data.after)) {
self.channel.refCounter.unref("PlaylistModule::handleMoveMedia"); self.channel.refCounter.unref("PlaylistModule::handleMoveMedia");
return lock.release(); return lock.release();

View file

@ -80,7 +80,10 @@ VoteskipModule.prototype.update = function () {
const { counts } = this.poll.toUpdateFrame(false); const { counts } = this.poll.toUpdateFrame(false);
const { total, eligible, noPermission, afk } = this.calcUsercounts(); const { total, eligible, noPermission, afk } = this.calcUsercounts();
const need = Math.ceil(eligible * this.channel.modules.options.get("voteskip_ratio")); const need = Math.max(
1, // Require at least one vote, see #944
Math.ceil(eligible * this.channel.modules.options.get("voteskip_ratio"))
);
if (counts[0] >= need) { if (counts[0] >= need) {
const info = `${counts[0]}/${eligible} skipped; ` + const info = `${counts[0]}/${eligible} skipped; ` +
`eligible voters: ${eligible} = total (${total}) - AFK (${afk}) ` + `eligible voters: ${eligible} = total (${total}) - AFK (${afk}) ` +

View file

@ -30,10 +30,6 @@ const SOURCE_CONTENT_TYPES = new Set([
'video/webm' 'video/webm'
]); ]);
const LIVE_ONLY_CONTENT_TYPES = new Set([
'application/dash+xml'
]);
export function lookup(url, opts) { export function lookup(url, opts) {
if (!opts) opts = {}; if (!opts) opts = {};
if (!opts.hasOwnProperty('timeout')) opts.timeout = 10000; if (!opts.hasOwnProperty('timeout')) opts.timeout = 10000;
@ -183,11 +179,6 @@ function validateSources(sources, data) {
`unacceptable source contentType "${source.contentType}"` `unacceptable source contentType "${source.contentType}"`
); );
if (LIVE_ONLY_CONTENT_TYPES.has(source.contentType) && !data.live)
throw new ValidationError(
`contentType "${source.contentType}" requires live: true`
);
if (!SOURCE_QUALITIES.has(source.quality)) if (!SOURCE_QUALITIES.has(source.quality))
throw new ValidationError(`unacceptable source quality "${source.quality}"`); throw new ValidationError(`unacceptable source quality "${source.quality}"`);

View file

@ -420,8 +420,6 @@ label[for="emotealphabox"]{
background-color: rgba(129, 20, 21, 0.1); background-color: rgba(129, 20, 21, 0.1);
} }
.server-msg-reconnect { .server-msg-reconnect {
border: 1px solid #009900; border: 1px solid #009900;
line-height: 2; line-height: 2;

1187
www/js/playerjs-0.0.12.js Normal file

File diff suppressed because it is too large Load diff

View file

@ -582,8 +582,6 @@ $("#mediaurl").keyup(function(ev) {
} }
}) })
.appendTo($("#addfromurl-title")).show("blind");//append and show .appendTo($("#addfromurl-title")).show("blind");//append and show
} }
} else { } else {
$("#addfromurl-title").hide("blind"); $("#addfromurl-title").hide("blind");
@ -1001,7 +999,6 @@ EMOTELISTMODAL.find(".emotelist-alphabetical").change(function () {
}); });
EMOTELISTMODAL.find(".emotelist-alphabetical").prop("checked", USEROPTS.emotelist_sort); EMOTELISTMODAL.find(".emotelist-alphabetical").prop("checked", USEROPTS.emotelist_sort);
$("#fullscreenbtn").click(function () { $("#fullscreenbtn").click(function () {
var elem = document.querySelector("#videowrap .embed-responsive"); var elem = document.querySelector("#videowrap .embed-responsive");
// this shit is why frontend web development sucks // this shit is why frontend web development sucks

View file

@ -1623,10 +1623,6 @@ function formatChatMessage(data, last) {
addClassToNameAndTimestamp: data.msgclass addClassToNameAndTimestamp: data.msgclass
}; };
} }
//break if toke command [DEPRICATED] No longer in use as chozobot is no longer used
/*if(data.msg.charAt() === '!'){
return;
}*/
// Phase 1: Determine whether to show the username or not // Phase 1: Determine whether to show the username or not
var skip = data.username === last.name; var skip = data.username === last.name;
if(data.meta.addClass === "server-whisper") if(data.meta.addClass === "server-whisper")
@ -1661,7 +1657,6 @@ function formatChatMessage(data, last) {
if(!data.meta.addClass === "shout"){ if(!data.meta.addClass === "shout"){
assignColors(data.username); assignColors(data.username);
} }
console.log(data.meta.addClass);
if (data.meta.superadminflair) { if (data.meta.superadminflair) {
$("<strong/>").addClass("username").attr('onclick',"chatpaste('" + data.username + "')").text(data.username + $("<strong/>").addClass("username").attr('onclick',"chatpaste('" + data.username + "')").text(data.username +
@ -1693,7 +1688,6 @@ function formatChatMessage(data, last) {
if (data.meta.addClass && data.meta.addClassToNameAndTimestamp) { if (data.meta.addClass && data.meta.addClassToNameAndTimestamp) {
name.addClass(data.meta.addClass); name.addClass(data.meta.addClass);
} }
// Add the message itself // Add the message itself
var message = $("<span/>").appendTo(div); var message = $("<span/>").appendTo(div);