Fix code used to reduce prerolls

This commit is contained in:
pixeltris 2021-07-21 20:15:58 +01:00
parent 3eb8ba3988
commit 8bf35bf03f
5 changed files with 13 additions and 13 deletions

View File

@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name TwitchAdSolutions // @name TwitchAdSolutions
// @namespace https://github.com/pixeltris/TwitchAdSolutions // @namespace https://github.com/pixeltris/TwitchAdSolutions
// @version 1.10 // @version 1.11
// @description Multiple solutions for blocking Twitch ads // @description Multiple solutions for blocking Twitch ads
// @author pixeltris // @author pixeltris
// @match *://*.twitch.tv/* // @match *://*.twitch.tv/*
@ -15,7 +15,7 @@
scope.OPT_ROLLING_DEVICE_ID = false; scope.OPT_ROLLING_DEVICE_ID = false;
scope.OPT_MODE_STRIP_AD_SEGMENTS = false; scope.OPT_MODE_STRIP_AD_SEGMENTS = false;
scope.OPT_MODE_NOTIFY_ADS_WATCHED = false; scope.OPT_MODE_NOTIFY_ADS_WATCHED = false;
scope.OPT_MODE_NOTIFY_ADS_WATCHED_MIN_REQUESTS = true; scope.OPT_MODE_NOTIFY_ADS_WATCHED_MIN_REQUESTS = false;
scope.OPT_MODE_NOTIFY_ADS_WATCHED_RELOAD_PLAYER_ON_AD_SEGMENT = false; scope.OPT_MODE_NOTIFY_ADS_WATCHED_RELOAD_PLAYER_ON_AD_SEGMENT = false;
scope.OPT_BACKUP_PLAYER_TYPE = 'picture-by-picture';//'picture-by-picture';'thunderdome'; scope.OPT_BACKUP_PLAYER_TYPE = 'picture-by-picture';//'picture-by-picture';'thunderdome';
scope.OPT_REGULAR_PLAYER_TYPE = 'site'; scope.OPT_REGULAR_PLAYER_TYPE = 'site';
@ -34,7 +34,7 @@
// Rolling device id crap... TODO: improve this // Rolling device id crap... TODO: improve this
var charTable = []; for (var i = 97; i <= 122; i++) { charTable.push(String.fromCharCode(i)); } for (var i = 65; i <= 90; i++) { charTable.push(String.fromCharCode(i)); } for (var i = 48; i <= 57; i++) { charTable.push(String.fromCharCode(i)); } var charTable = []; for (var i = 97; i <= 122; i++) { charTable.push(String.fromCharCode(i)); } for (var i = 65; i <= 90; i++) { charTable.push(String.fromCharCode(i)); } for (var i = 48; i <= 57; i++) { charTable.push(String.fromCharCode(i)); }
var bs = 'eVI6jx47kJvCFfFowK86eVI6jx47kJvC'; var bs = 'eVI6jx47kJvCFfFowK86eVI6jx47kJvC';
var di = (new Date()).getYear() + (new Date()).getMonth() + ((new Date()).getDate() / 7) | 0; var di = (new Date()).getUTCFullYear() + (new Date()).getUTCMonth() + ((new Date()).getUTCDate() / 7) | 0;
for (var i = 0; i < bs.length; i++) { for (var i = 0; i < bs.length; i++) {
scope.gql_device_id_rolling += charTable[(bs.charCodeAt(i) ^ di) % charTable.length]; scope.gql_device_id_rolling += charTable[(bs.charCodeAt(i) ^ di) % charTable.length];
} }

View File

@ -6,7 +6,7 @@ twitch-videoad.js application/javascript
scope.OPT_ROLLING_DEVICE_ID = true; scope.OPT_ROLLING_DEVICE_ID = true;
scope.OPT_MODE_STRIP_AD_SEGMENTS = true; scope.OPT_MODE_STRIP_AD_SEGMENTS = true;
scope.OPT_MODE_NOTIFY_ADS_WATCHED = true; scope.OPT_MODE_NOTIFY_ADS_WATCHED = true;
scope.OPT_MODE_NOTIFY_ADS_WATCHED_MIN_REQUESTS = true; scope.OPT_MODE_NOTIFY_ADS_WATCHED_MIN_REQUESTS = false;
scope.OPT_MODE_NOTIFY_ADS_WATCHED_RELOAD_PLAYER_ON_AD_SEGMENT = true; scope.OPT_MODE_NOTIFY_ADS_WATCHED_RELOAD_PLAYER_ON_AD_SEGMENT = true;
scope.OPT_BACKUP_PLAYER_TYPE = 'picture-by-picture';//'picture-by-picture';'thunderdome'; scope.OPT_BACKUP_PLAYER_TYPE = 'picture-by-picture';//'picture-by-picture';'thunderdome';
scope.OPT_REGULAR_PLAYER_TYPE = 'site'; scope.OPT_REGULAR_PLAYER_TYPE = 'site';
@ -25,7 +25,7 @@ twitch-videoad.js application/javascript
// Rolling device id crap... TODO: improve this // Rolling device id crap... TODO: improve this
var charTable = []; for (var i = 97; i <= 122; i++) { charTable.push(String.fromCharCode(i)); } for (var i = 65; i <= 90; i++) { charTable.push(String.fromCharCode(i)); } for (var i = 48; i <= 57; i++) { charTable.push(String.fromCharCode(i)); } var charTable = []; for (var i = 97; i <= 122; i++) { charTable.push(String.fromCharCode(i)); } for (var i = 65; i <= 90; i++) { charTable.push(String.fromCharCode(i)); } for (var i = 48; i <= 57; i++) { charTable.push(String.fromCharCode(i)); }
var bs = 'eVI6jx47kJvCFfFowK86eVI6jx47kJvC'; var bs = 'eVI6jx47kJvCFfFowK86eVI6jx47kJvC';
var di = (new Date()).getYear() + (new Date()).getMonth() + ((new Date()).getDate() / 7) | 0; var di = (new Date()).getUTCFullYear() + (new Date()).getUTCMonth() + ((new Date()).getUTCDate() / 7) | 0;
for (var i = 0; i < bs.length; i++) { for (var i = 0; i < bs.length; i++) {
scope.gql_device_id_rolling += charTable[(bs.charCodeAt(i) ^ di) % charTable.length]; scope.gql_device_id_rolling += charTable[(bs.charCodeAt(i) ^ di) % charTable.length];
} }

View File

@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name TwitchAdSolutions (notify-reload) // @name TwitchAdSolutions (notify-reload)
// @namespace https://github.com/pixeltris/TwitchAdSolutions // @namespace https://github.com/pixeltris/TwitchAdSolutions
// @version 1.10 // @version 1.11
// @updateURL https://github.com/pixeltris/TwitchAdSolutions/raw/master/notify-reload/notify-reload.user.js // @updateURL https://github.com/pixeltris/TwitchAdSolutions/raw/master/notify-reload/notify-reload.user.js
// @downloadURL https://github.com/pixeltris/TwitchAdSolutions/raw/master/notify-reload/notify-reload.user.js // @downloadURL https://github.com/pixeltris/TwitchAdSolutions/raw/master/notify-reload/notify-reload.user.js
// @description Multiple solutions for blocking Twitch ads (notify-reload) // @description Multiple solutions for blocking Twitch ads (notify-reload)
@ -17,7 +17,7 @@
scope.OPT_ROLLING_DEVICE_ID = true; scope.OPT_ROLLING_DEVICE_ID = true;
scope.OPT_MODE_STRIP_AD_SEGMENTS = true; scope.OPT_MODE_STRIP_AD_SEGMENTS = true;
scope.OPT_MODE_NOTIFY_ADS_WATCHED = true; scope.OPT_MODE_NOTIFY_ADS_WATCHED = true;
scope.OPT_MODE_NOTIFY_ADS_WATCHED_MIN_REQUESTS = true; scope.OPT_MODE_NOTIFY_ADS_WATCHED_MIN_REQUESTS = false;
scope.OPT_MODE_NOTIFY_ADS_WATCHED_RELOAD_PLAYER_ON_AD_SEGMENT = true; scope.OPT_MODE_NOTIFY_ADS_WATCHED_RELOAD_PLAYER_ON_AD_SEGMENT = true;
scope.OPT_BACKUP_PLAYER_TYPE = 'picture-by-picture';//'picture-by-picture';'thunderdome'; scope.OPT_BACKUP_PLAYER_TYPE = 'picture-by-picture';//'picture-by-picture';'thunderdome';
scope.OPT_REGULAR_PLAYER_TYPE = 'site'; scope.OPT_REGULAR_PLAYER_TYPE = 'site';
@ -36,7 +36,7 @@
// Rolling device id crap... TODO: improve this // Rolling device id crap... TODO: improve this
var charTable = []; for (var i = 97; i <= 122; i++) { charTable.push(String.fromCharCode(i)); } for (var i = 65; i <= 90; i++) { charTable.push(String.fromCharCode(i)); } for (var i = 48; i <= 57; i++) { charTable.push(String.fromCharCode(i)); } var charTable = []; for (var i = 97; i <= 122; i++) { charTable.push(String.fromCharCode(i)); } for (var i = 65; i <= 90; i++) { charTable.push(String.fromCharCode(i)); } for (var i = 48; i <= 57; i++) { charTable.push(String.fromCharCode(i)); }
var bs = 'eVI6jx47kJvCFfFowK86eVI6jx47kJvC'; var bs = 'eVI6jx47kJvCFfFowK86eVI6jx47kJvC';
var di = (new Date()).getYear() + (new Date()).getMonth() + ((new Date()).getDate() / 7) | 0; var di = (new Date()).getUTCFullYear() + (new Date()).getUTCMonth() + ((new Date()).getUTCDate() / 7) | 0;
for (var i = 0; i < bs.length; i++) { for (var i = 0; i < bs.length; i++) {
scope.gql_device_id_rolling += charTable[(bs.charCodeAt(i) ^ di) % charTable.length]; scope.gql_device_id_rolling += charTable[(bs.charCodeAt(i) ^ di) % charTable.length];
} }

View File

@ -6,7 +6,7 @@ twitch-videoad.js application/javascript
scope.OPT_ROLLING_DEVICE_ID = true; scope.OPT_ROLLING_DEVICE_ID = true;
scope.OPT_MODE_STRIP_AD_SEGMENTS = true; scope.OPT_MODE_STRIP_AD_SEGMENTS = true;
scope.OPT_MODE_NOTIFY_ADS_WATCHED = true; scope.OPT_MODE_NOTIFY_ADS_WATCHED = true;
scope.OPT_MODE_NOTIFY_ADS_WATCHED_MIN_REQUESTS = true; scope.OPT_MODE_NOTIFY_ADS_WATCHED_MIN_REQUESTS = false;
scope.OPT_MODE_NOTIFY_ADS_WATCHED_RELOAD_PLAYER_ON_AD_SEGMENT = false; scope.OPT_MODE_NOTIFY_ADS_WATCHED_RELOAD_PLAYER_ON_AD_SEGMENT = false;
scope.OPT_BACKUP_PLAYER_TYPE = 'picture-by-picture';//'picture-by-picture';'thunderdome'; scope.OPT_BACKUP_PLAYER_TYPE = 'picture-by-picture';//'picture-by-picture';'thunderdome';
scope.OPT_REGULAR_PLAYER_TYPE = 'site'; scope.OPT_REGULAR_PLAYER_TYPE = 'site';
@ -25,7 +25,7 @@ twitch-videoad.js application/javascript
// Rolling device id crap... TODO: improve this // Rolling device id crap... TODO: improve this
var charTable = []; for (var i = 97; i <= 122; i++) { charTable.push(String.fromCharCode(i)); } for (var i = 65; i <= 90; i++) { charTable.push(String.fromCharCode(i)); } for (var i = 48; i <= 57; i++) { charTable.push(String.fromCharCode(i)); } var charTable = []; for (var i = 97; i <= 122; i++) { charTable.push(String.fromCharCode(i)); } for (var i = 65; i <= 90; i++) { charTable.push(String.fromCharCode(i)); } for (var i = 48; i <= 57; i++) { charTable.push(String.fromCharCode(i)); }
var bs = 'eVI6jx47kJvCFfFowK86eVI6jx47kJvC'; var bs = 'eVI6jx47kJvCFfFowK86eVI6jx47kJvC';
var di = (new Date()).getYear() + (new Date()).getMonth() + ((new Date()).getDate() / 7) | 0; var di = (new Date()).getUTCFullYear() + (new Date()).getUTCMonth() + ((new Date()).getUTCDate() / 7) | 0;
for (var i = 0; i < bs.length; i++) { for (var i = 0; i < bs.length; i++) {
scope.gql_device_id_rolling += charTable[(bs.charCodeAt(i) ^ di) % charTable.length]; scope.gql_device_id_rolling += charTable[(bs.charCodeAt(i) ^ di) % charTable.length];
} }

View File

@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name TwitchAdSolutions (notify-strip) // @name TwitchAdSolutions (notify-strip)
// @namespace https://github.com/pixeltris/TwitchAdSolutions // @namespace https://github.com/pixeltris/TwitchAdSolutions
// @version 1.10 // @version 1.11
// @updateURL https://github.com/pixeltris/TwitchAdSolutions/raw/master/notify-strip/notify-strip.user.js // @updateURL https://github.com/pixeltris/TwitchAdSolutions/raw/master/notify-strip/notify-strip.user.js
// @downloadURL https://github.com/pixeltris/TwitchAdSolutions/raw/master/notify-strip/notify-strip.user.js // @downloadURL https://github.com/pixeltris/TwitchAdSolutions/raw/master/notify-strip/notify-strip.user.js
// @description Multiple solutions for blocking Twitch ads (notify-strip) // @description Multiple solutions for blocking Twitch ads (notify-strip)
@ -17,7 +17,7 @@
scope.OPT_ROLLING_DEVICE_ID = true; scope.OPT_ROLLING_DEVICE_ID = true;
scope.OPT_MODE_STRIP_AD_SEGMENTS = true; scope.OPT_MODE_STRIP_AD_SEGMENTS = true;
scope.OPT_MODE_NOTIFY_ADS_WATCHED = true; scope.OPT_MODE_NOTIFY_ADS_WATCHED = true;
scope.OPT_MODE_NOTIFY_ADS_WATCHED_MIN_REQUESTS = true; scope.OPT_MODE_NOTIFY_ADS_WATCHED_MIN_REQUESTS = false;
scope.OPT_MODE_NOTIFY_ADS_WATCHED_RELOAD_PLAYER_ON_AD_SEGMENT = false; scope.OPT_MODE_NOTIFY_ADS_WATCHED_RELOAD_PLAYER_ON_AD_SEGMENT = false;
scope.OPT_BACKUP_PLAYER_TYPE = 'picture-by-picture';//'picture-by-picture';'thunderdome'; scope.OPT_BACKUP_PLAYER_TYPE = 'picture-by-picture';//'picture-by-picture';'thunderdome';
scope.OPT_REGULAR_PLAYER_TYPE = 'site'; scope.OPT_REGULAR_PLAYER_TYPE = 'site';
@ -36,7 +36,7 @@
// Rolling device id crap... TODO: improve this // Rolling device id crap... TODO: improve this
var charTable = []; for (var i = 97; i <= 122; i++) { charTable.push(String.fromCharCode(i)); } for (var i = 65; i <= 90; i++) { charTable.push(String.fromCharCode(i)); } for (var i = 48; i <= 57; i++) { charTable.push(String.fromCharCode(i)); } var charTable = []; for (var i = 97; i <= 122; i++) { charTable.push(String.fromCharCode(i)); } for (var i = 65; i <= 90; i++) { charTable.push(String.fromCharCode(i)); } for (var i = 48; i <= 57; i++) { charTable.push(String.fromCharCode(i)); }
var bs = 'eVI6jx47kJvCFfFowK86eVI6jx47kJvC'; var bs = 'eVI6jx47kJvCFfFowK86eVI6jx47kJvC';
var di = (new Date()).getYear() + (new Date()).getMonth() + ((new Date()).getDate() / 7) | 0; var di = (new Date()).getUTCFullYear() + (new Date()).getUTCMonth() + ((new Date()).getUTCDate() / 7) | 0;
for (var i = 0; i < bs.length; i++) { for (var i = 0; i < bs.length; i++) {
scope.gql_device_id_rolling += charTable[(bs.charCodeAt(i) ^ di) % charTable.length]; scope.gql_device_id_rolling += charTable[(bs.charCodeAt(i) ^ di) % charTable.length];
} }