Suggestion: Enabling YouTube Ads Depending on Channel

Various discussions related to Adblock Plus development
Jonkki

Re: Suggestion: Enabling YouTube Ads Depending on Channel

Post by Jonkki »

So... where are we with this?
I can't wait to whitelist selected channels on youtube :).
SoGrah
Posts: 8
Joined: Mon Jan 06, 2014 10:41 am

Re: Suggestion: Enabling YouTube Ads Depending on Channel

Post by SoGrah »

Ye ditto this, Youtube advertising has been great for a lot of channels, sure, but when the ad is longer than the video thy are just asking for retaliation. Not a fan of the new 'aesthetic' posters some websites are brining in either. It's like, if I wanna banner, I can just go to posterlounge. :lol: (But sure, I'm all for supporting those that derserve it. as in by white listing as opposed to disabling.)
Last edited by SoGrah on Fri Jan 17, 2014 10:20 am, edited 1 time in total.
Dubious

Re: Suggestion: Enabling YouTube Ads Depending on Channel

Post by Dubious »

Dr.Bones wrote:Thanks a Bunch schippi!

I actually wanted to support TotalBiscuit :). Your script inserted into Tampermonkey did the trick. I just needed a while to figure out to whitelist stuff in ABP you just add a filter :oops: . The only thing i needed to change was the last line to actually change the href property of the window.location element. For some reason it would work manually but not in a tampermonkey script. The script below is the one that worked for me. All credits go to schippi

Code: Select all

// ==UserScript==
// @name        Youtube opt in Ads per channel
// @namespace   schippi
// @include     http://www.youtube.com/watch*
// @include     https://www.youtube.com/watch*
// @version     1
// ==/UserScript==

var u = window.location.href;
if(u.search("user=") == -1){
	var cont = document.getElementById("watch7-user-header").innerHTML;
	var user=cont.replace(/.+\/user\//i,'').replace(/\?(?:.|\s)*/m,''); 
	window.location.href = u+"&user="+user;
}
And dont forget to add the filter to AdBlock Plus!
Funny enough I found you guys with the same goal (supporting TB).
Below is my modified script, which now supports both vanilla Youtube and FeatherBeta Youtube
https://www.youtube.com/feather_beta
FYI, don't forget to add the ABP filter as well
Start Script:

Code: Select all

// ==UserScript==
// @name        Youtube opt in Ads per channel
// @namespace   schippi
// @include     http://www.youtube.com/watch*
// @include     https://www.youtube.com/watch*
// @version     1.1
// ==/UserScript==

var u = window.location.href;
if(u.search("user=") == -1){
	if (!! document.getElementById("ud")) {
		var user = document.getElementById("ud").getElementsByTagName("a")[0].getAttribute("href").split("/")[2];
        window.location.href = u+"&user="+user;
    }
    else if (!! document.getElementById("watch7-user-header")) {
		var cont = document.getElementById("watch7-user-header").innerHTML;
		var user=cont.replace(/.+\/user\//i,'').replace(/\?(?:.|\s)*/m,''); 
        window.location.href = u+"&user="+user;
    }
	else {
        alert('script failed');
	}
}
CheckingAround

Re: Suggestion: Enabling YouTube Ads Depending on Channel

Post by CheckingAround »

Dubious wrote:
Dr.Bones wrote:Thanks a Bunch schippi!

I actually wanted to support TotalBiscuit :). Your script inserted into Tampermonkey did the trick. I just needed a while to figure out to whitelist stuff in ABP you just add a filter :oops: . The only thing i needed to change was the last line to actually change the href property of the window.location element. For some reason it would work manually but not in a tampermonkey script. The script below is the one that worked for me. All credits go to schippi

Code: Select all

// ==UserScript==
// @name        Youtube opt in Ads per channel
// @namespace   schippi
// @include     http://www.youtube.com/watch*
// @include     https://www.youtube.com/watch*
// @version     1
// ==/UserScript==

var u = window.location.href;
if(u.search("user=") == -1){
	var cont = document.getElementById("watch7-user-header").innerHTML;
	var user=cont.replace(/.+\/user\//i,'').replace(/\?(?:.|\s)*/m,''); 
	window.location.href = u+"&user="+user;
}
And dont forget to add the filter to AdBlock Plus!
Funny enough I found you guys with the same goal (supporting TB).
Below is my modified script, which now supports both vanilla Youtube and FeatherBeta Youtube
https://www.youtube.com/feather_beta
FYI, don't forget to add the ABP filter as well
Start Script:

Code: Select all

// ==UserScript==
// @name        Youtube opt in Ads per channel
// @namespace   schippi
// @include     http://www.youtube.com/watch*
// @include     https://www.youtube.com/watch*
// @version     1.1
// ==/UserScript==

var u = window.location.href;
if(u.search("user=") == -1){
	if (!! document.getElementById("ud")) {
		var user = document.getElementById("ud").getElementsByTagName("a")[0].getAttribute("href").split("/")[2];
        window.location.href = u+"&user="+user;
    }
    else if (!! document.getElementById("watch7-user-header")) {
		var cont = document.getElementById("watch7-user-header").innerHTML;
		var user=cont.replace(/.+\/user\//i,'').replace(/\?(?:.|\s)*/m,''); 
        window.location.href = u+"&user="+user;
    }
	else {
        alert('script failed');
	}
}
It works in Feather, but something seems to be wrong for normal pages. I get a massive line of text after the channel name:

Code: Select all

https://www.youtube.com/watch?v=3SZhsFmK5CY&user=LetsPlay%22%20class=%22yt-user-photo%20%20yt-uix-sessionlink%22%20data-sessionlink=%22ei=53MgU_utD4WkmQXY34GYBg&feature=watch%22%3E%20%20%20%20%3Cspan%20class=%22video-thumb%20%20yt-thumb%20yt-thumb-48%20g-hovercard%22%20data-ytid=%22UCkxctb0jr8vwa4Do6c6su0Q%22%3E%20%20%20%20%20%20%3Cspan%20class=%22yt-thumb-square%22%3E%20%20%20%20%20%20%20%20%3Cspan%20class=%22yt-thumb-clip%22%3E%20%20%20%20%20%20%20%20%20%20%3Cimg%20src=%22https://yt3.ggpht.com/-f70aQff_iKE/AAAAAAAAAAI/AAAAAAAAAAA/-R40EvoOKf0/s48-c-k-no/photo.jpg%22%20alt=%22LetsPlay%22%20width=%2248%22%20height=%2248%22%3E%20%20%20%20%20%20%20%20%20%20%3Cspan%20class=%22vertical-align%22%3E%3C/span%3E%20%20%20%20%20%20%20%20%3C/span%3E%20%20%20%20%20%20%3C/span%3E%20%20%20%20%3C/span%3E%3C/a%3E%3Ca%20href=%22/user/LetsPlay%22%20class=%22g-hovercard%20yt-uix-sessionlink%20yt-user-name%20%22%20data-sessionlink=%22ei=53MgU_utD4WkmQXY34GYBg&feature=watch%22%20dir=%22ltr%22%20data-ytid=%22UCkxctb0jr8vwa4Do6c6su0Q%22%20data-name=%22watch%22%3ELetsPlay%3C/a%3E%20%20%3Cimg%20src=%22https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif%22%20class=%22yt-uix-tooltip%20yt-channel-title-icon-verified%22%20alt=%22%22%20title=%22Verified%22%3E%3Cspan%20class=%22yt-user-separator%22%3E%C2%B7%3C/span%3E%3Ca%20class=%22yt-uix-sessionlink%20yt-user-videos%22%20href=%22/user/LetsPlay/videos%22%20data-sessionlink=%22ei=53MgU_utD4WkmQXY34GYBg&feature=watch%22%3E329%20videos%3C/a%3E%3Cbr%3E%3Cspan%20id=%22watch7-subscription-container%22%3E%3Cspan%20class=%22%20yt-uix-button-subscription-container%20with-preferences%22%3E%3Cbutton%20type=%22button%22%20aria-role=%22button%22%20onclick=%22;return%20false;%22%20class=%22yt-uix-subscription-button%20yt-can-buffer%20hover-enabled%20yt-uix-button%20yt-uix-button-subscribed-branded%20yt-uix-button-size-default%20yt-uix-button-has-icon%22%20aria-busy=%22false%22%20aria-live=%22polite%22%20data-subscription-id=%22lSjlou52qJ5TTqK2d8i9H6flgcIYu5cKL2k5tyCsu1o%22%20data-sessionlink=%22ei=53MgU_utD4WkmQXY34GYBg&ved=CBoQmys&feature=watch%22%20data-style-type=%22branded%22%20data-is-subscribed=%22True%22%20data-channel-external-id=%22UCkxctb0jr8vwa4Do6c6su0Q%22%20role=%22button%22%3E%3Cspan%20class=%22yt-uix-button-icon-wrapper%22%3E%3Cimg%20class=%22yt-uix-button-icon%20yt-uix-button-icon-subscribe%22%20src=%22https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif%22%20alt=%22%22%20title=%22%22%3E%3C/span%3E%3Cspan%20class=%22yt-uix-button-content%22%3E%3Cspan%20class=%22subscribe-label%22%20aria-label=%22Subscribe%22%3ESubscribe%3C/span%3E%3Cspan%20class=%22subscribed-label%22%20aria-label=%22Unsubscribe%22%3ESubscribed%3C/span%3E%3Cspan%20class=%22unsubscribe-label%22%20aria-label=%22Unsubscribe%22%3EUnsubscribe%3C/span%3E%20%3C/span%3E%3C/button%3E%3Cbutton%20type=%22button%22%20class=%22yt-uix-subscription-preferences-button%20yt-uix-button%20yt-uix-button-default%20yt-uix-button-size-default%20yt-uix-button-has-icon%20yt-uix-button-empty%22%20onclick=%22;return%20false;%22%20data-subscription-id=%22lSjlou52qJ5TTqK2d8i9H6flgcIYu5cKL2k5tyCsu1o%22%20data-channel-external-id=%22UCkxctb0jr8vwa4Do6c6su0Q%22%20role=%22button%22%3E%3Cspan%20class=%22yt-uix-button-icon-wrapper%22%3E%3Cimg%20class=%22yt-uix-button-icon%20yt-uix-button-icon-subscription-preferences%22%20src=%22https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif%22%20alt=%22%22%20title=%22%22%3E%3C/span%3E%3C/button%3E%3Cspan%20class=%22yt-subscription-button-subscriber-count-branded-horizontal%22%3E2,323,492%3C/span%3E%20%20%3Cspan%20class=%22yt-subscription-button-disabled-mask%22%20title=%22%22%3E%3C/span%3E%20%20%20%20%3Cdiv%20class=%22yt-uix-overlay%20%22%20data-overlay-style=%22primary%22%20data-overlay-shape=%22tiny%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%20class=%22yt-dialog%20hid%20%22%3E%20%20%20%20%3Cdiv%20class=%22yt-dialog-base%22%3E%20%20%20%20%20%20%3Cspan%20class=%22yt-dialog-align%22%3E%3C/span%3E%20%20%20%20%20%20%3Cdiv%20class=%22yt-dialog-fg%22%3E%20%20%20%20%20%20%20%20%3Cdiv%20class=%22yt-dialog-fg-content%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%20class=%22yt-dialog-header%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ch2%20class=%22yt-dialog-title%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Subscription%20preferences%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C/h2%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C/div%3E%20%20%20%20%20%20%20%20%20%20%3Cdiv%20class=%22yt-dialog-loading%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%20class=%22yt-dialog-waiting-content%22%3E%20%20%20%20%3Cdiv%20class=%22yt-spinner-img%22%3E%3C/div%3E%3Cdiv%20class=%22yt-dialog-waiting-text%22%3ELoading...%3C/div%3E%20%20%3C/div%3E%20%20%20%20%20%20%20%20%20%20%3C/div%3E%20%20%20%20%20%20%20%20%20%20%3Cdiv%20class=%22yt-dialog-content%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%20class=%22subscription-preferences-overlay-content-container%22%3E%20%20%20%20%3Cdiv%20class=%22subscription-preferences-overlay-loading%20%22%3E%20%20%20%20%20%20%20%20%3Cp%20class=%22yt-spinner%22%3E%20%20%20%20%20%20%3Cimg%20class=%22yt-spinner-img%22%20src=%22https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif%22%20alt=%22Loading%20icon%22%20title=%22%22%3E%20%20%20%20%3Cspan%20class=%22yt-spinner-message%22%3ELoading...%20%20%20%20%3C/span%3E%20%20%3C/p%3E%20%20%20%20%3C/div%3E%20%20%20%20%3Cdiv%20class=%22subscription-preferences-overlay-content%22%3E%20%20%20%20%3C/div%3E%20%20%3C/div%3E%20%20%20%20%20%20%20%20%20%20%3C/div%3E%20%20%20%20%20%20%20%20%20%20%3Cdiv%20class=%22yt-dialog-working%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%20id=%22yt-dialog-working-overlay%22%3E%20%20%3C/div%3E%20%20%3Cdiv%20id=%22yt-dialog-working-bubble%22%3E%20%20%20%20%3Cdiv%20class=%22yt-dialog-waiting-content%22%3E%20%20%20%20%20%20%3Cdiv%20class=%22yt-spinner-img%22%3E%3C/div%3E%3Cdiv%20class=%22yt-dialog-waiting-text%22%3EWorking...%3C/div%3E%20%20%20%20%3C/div%3E%20%20%3C/div%3E%20%20%20%20%20%20%20%20%20%20%3C/div%3E%20%20%20%20%20%20%20%20%3C/div%3E%20%20%20%20%20%20%3C/div%3E%20%20%20%20%3C/div%3E%20%20%3C/div%3E%20%20%3C/div%3E%3C/span%3E%3C/span%3E%3Cdiv%20id=%22watch7-views-info%22%3E%20%20%20%20%20%20%3Cspan%20class=%22watch-view-count%20%22%3E%20%20%20%20369,165%20%20%3C/span%3E%20%20%3Cdiv%20class=%22video-extras-sparkbars%22%3E%20%20%20%20%3Cdiv%20class=%22video-extras-sparkbar-likes%22%20style=%22width:%2098.9315152132%%22%3E%3C/div%3E%20%20%20%20%3Cdiv%20class=%22video-extras-sparkbar-dislikes%22%20style=%22width:%201.06848478681%%22%3E%3C/div%3E%20%20%3C/div%3E%20%20%3Cspan%20class=%22video-extras-likes-dislikes%22%3E%20%20%20%20%20%20%3Cimg%20id=%22watch-stats-like%22%20class=%22icon-watch-stats-like%22%20src=%22https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif%22%20alt=%22Like%22%3E%20%20%3Cspan%20class=%22likes-count%22%3E9,722%3C/span%3E%20%20%20%20   %20%20%20%20%20%20%3Cimg%20id=%22watch-stats-dislike%22%20class=%22icon-watch-stats-dislike%22%20src=%22https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif%22%20alt=%22Dislike%22%3E%20%20%3Cspan%20class=%22dislikes-count%22%3E105%3C/span%3E%20%20%3C/span%3E%3C/div%3E
Dr. Pariolo
Posts: 1
Joined: Tue Mar 18, 2014 5:39 am

Re: Suggestion: Enabling YouTube Ads Depending on Channel

Post by Dr. Pariolo »

CheckingAround wrote:
Dubious wrote:
Dr.Bones wrote:Thanks a Bunch schippi!

I actually wanted to support TotalBiscuit :). Your script inserted into Tampermonkey did the trick. I just needed a while to figure out to whitelist stuff in ABP you just add a filter :oops: . The only thing i needed to change was the last line to actually change the href property of the window.location element. For some reason it would work manually but not in a tampermonkey script. The script below is the one that worked for me. All credits go to schippi

Code: Select all

// ==UserScript==
// @name        Youtube opt in Ads per channel
// @namespace   schippi
// @include     http://www.youtube.com/watch*
// @include     https://www.youtube.com/watch*
// @version     1
// ==/UserScript==

var u = window.location.href;
if(u.search("user=") == -1){
	var cont = document.getElementById("watch7-user-header").innerHTML;
	var user=cont.replace(/.+\/user\//i,'').replace(/\?(?:.|\s)*/m,''); 
	window.location.href = u+"&user="+user;
}
And dont forget to add the filter to AdBlock Plus!
Funny enough I found you guys with the same goal (supporting TB).
Below is my modified script, which now supports both vanilla Youtube and FeatherBeta Youtube
https://www.youtube.com/feather_beta
FYI, don't forget to add the ABP filter as well
Start Script:

Code: Select all

// ==UserScript==
// @name        Youtube opt in Ads per channel
// @namespace   schippi
// @include     http://www.youtube.com/watch*
// @include     https://www.youtube.com/watch*
// @version     1.1
// ==/UserScript==

var u = window.location.href;
if(u.search("user=") == -1){
	if (!! document.getElementById("ud")) {
		var user = document.getElementById("ud").getElementsByTagName("a")[0].getAttribute("href").split("/")[2];
        window.location.href = u+"&user="+user;
    }
    else if (!! document.getElementById("watch7-user-header")) {
		var cont = document.getElementById("watch7-user-header").innerHTML;
		var user=cont.replace(/.+\/user\//i,'').replace(/\?(?:.|\s)*/m,''); 
        window.location.href = u+"&user="+user;
    }
	else {
        alert('script failed');
	}
}
It works in Feather, but something seems to be wrong for normal pages. I get a massive line of text after the channel name:

Code: Select all

https://www.youtube.com/watch?v=3SZhsFmK5CY&user=LetsPlay%22%20class=%22yt-user-photo%20%20yt-uix-sessionlink%22%20data-sessionlink=%22ei=53MgU_utD4WkmQXY34GYBg&feature=watch%22%3E%20%20%20%20%3Cspan%20class=%22video-thumb%20%20yt-thumb%20yt-thumb-48%20g-hovercard%22%20data-ytid=%22UCkxctb0jr8vwa4Do6c6su0Q%22%3E%20%20%20%20%20%20%3Cspan%20class=%22yt-thumb-square%22%3E%20%20%20%20%20%20%20%20%3Cspan%20class=%22yt-thumb-clip%22%3E%20%20%20%20%20%20%20%20%20%20%3Cimg%20src=%22https://yt3.ggpht.com/-f70aQff_iKE/AAAAAAAAAAI/AAAAAAAAAAA/-R40EvoOKf0/s48-c-k-no/photo.jpg%22%20alt=%22LetsPlay%22%20width=%2248%22%20height=%2248%22%3E%20%20%20%20%20%20%20%20%20%20%3Cspan%20class=%22vertical-align%22%3E%3C/span%3E%20%20%20%20%20%20%20%20%3C/span%3E%20%20%20%20%20%20%3C/span%3E%20%20%20%20%3C/span%3E%3C/a%3E%3Ca%20href=%22/user/LetsPlay%22%20class=%22g-hovercard%20yt-uix-sessionlink%20yt-user-name%20%22%20data-sessionlink=%22ei=53MgU_utD4WkmQXY34GYBg&feature=watch%22%20dir=%22ltr%22%20data-ytid=%22UCkxctb0jr8vwa4Do6c6su0Q%22%20data-name=%22watch%22%3ELetsPlay%3C/a%3E%20%20%3Cimg%20src=%22https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif%22%20class=%22yt-uix-tooltip%20yt-channel-title-icon-verified%22%20alt=%22%22%20title=%22Verified%22%3E%3Cspan%20class=%22yt-user-separator%22%3E%C2%B7%3C/span%3E%3Ca%20class=%22yt-uix-sessionlink%20yt-user-videos%22%20href=%22/user/LetsPlay/videos%22%20data-sessionlink=%22ei=53MgU_utD4WkmQXY34GYBg&feature=watch%22%3E329%20videos%3C/a%3E%3Cbr%3E%3Cspan%20id=%22watch7-subscription-container%22%3E%3Cspan%20class=%22%20yt-uix-button-subscription-container%20with-preferences%22%3E%3Cbutton%20type=%22button%22%20aria-role=%22button%22%20onclick=%22;return%20false;%22%20class=%22yt-uix-subscription-button%20yt-can-buffer%20hover-enabled%20yt-uix-button%20yt-uix-button-subscribed-branded%20yt-uix-button-size-default%20yt-uix-button-has-icon%22%20aria-busy=%22false%22%20aria-live=%22polite%22%20data-subscription-id=%22lSjlou52qJ5TTqK2d8i9H6flgcIYu5cKL2k5tyCsu1o%22%20data-sessionlink=%22ei=53MgU_utD4WkmQXY34GYBg&ved=CBoQmys&feature=watch%22%20data-style-type=%22branded%22%20data-is-subscribed=%22True%22%20data-channel-external-id=%22UCkxctb0jr8vwa4Do6c6su0Q%22%20role=%22button%22%3E%3Cspan%20class=%22yt-uix-button-icon-wrapper%22%3E%3Cimg%20class=%22yt-uix-button-icon%20yt-uix-button-icon-subscribe%22%20src=%22https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif%22%20alt=%22%22%20title=%22%22%3E%3C/span%3E%3Cspan%20class=%22yt-uix-button-content%22%3E%3Cspan%20class=%22subscribe-label%22%20aria-label=%22Subscribe%22%3ESubscribe%3C/span%3E%3Cspan%20class=%22subscribed-label%22%20aria-label=%22Unsubscribe%22%3ESubscribed%3C/span%3E%3Cspan%20class=%22unsubscribe-label%22%20aria-label=%22Unsubscribe%22%3EUnsubscribe%3C/span%3E%20%3C/span%3E%3C/button%3E%3Cbutton%20type=%22button%22%20class=%22yt-uix-subscription-preferences-button%20yt-uix-button%20yt-uix-button-default%20yt-uix-button-size-default%20yt-uix-button-has-icon%20yt-uix-button-empty%22%20onclick=%22;return%20false;%22%20data-subscription-id=%22lSjlou52qJ5TTqK2d8i9H6flgcIYu5cKL2k5tyCsu1o%22%20data-channel-external-id=%22UCkxctb0jr8vwa4Do6c6su0Q%22%20role=%22button%22%3E%3Cspan%20class=%22yt-uix-button-icon-wrapper%22%3E%3Cimg%20class=%22yt-uix-button-icon%20yt-uix-button-icon-subscription-preferences%22%20src=%22https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif%22%20alt=%22%22%20title=%22%22%3E%3C/span%3E%3C/button%3E%3Cspan%20class=%22yt-subscription-button-subscriber-count-branded-horizontal%22%3E2,323,492%3C/span%3E%20%20%3Cspan%20class=%22yt-subscription-button-disabled-mask%22%20title=%22%22%3E%3C/span%3E%20%20%20%20%3Cdiv%20class=%22yt-uix-overlay%20%22%20data-overlay-style=%22primary%22%20data-overlay-shape=%22tiny%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%20class=%22yt-dialog%20hid%20%22%3E%20%20%20%20%3Cdiv%20class=%22yt-dialog-base%22%3E%20%20%20%20%20%20%3Cspan%20class=%22yt-dialog-align%22%3E%3C/span%3E%20%20%20%20%20%20%3Cdiv%20class=%22yt-dialog-fg%22%3E%20%20%20%20%20%20%20%20%3Cdiv%20class=%22yt-dialog-fg-content%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%20class=%22yt-dialog-header%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ch2%20class=%22yt-dialog-title%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Subscription%20preferences%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C/h2%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C/div%3E%20%20%20%20%20%20%20%20%20%20%3Cdiv%20class=%22yt-dialog-loading%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%20class=%22yt-dialog-waiting-content%22%3E%20%20%20%20%3Cdiv%20class=%22yt-spinner-img%22%3E%3C/div%3E%3Cdiv%20class=%22yt-dialog-waiting-text%22%3ELoading...%3C/div%3E%20%20%3C/div%3E%20%20%20%20%20%20%20%20%20%20%3C/div%3E%20%20%20%20%20%20%20%20%20%20%3Cdiv%20class=%22yt-dialog-content%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%20class=%22subscription-preferences-overlay-content-container%22%3E%20%20%20%20%3Cdiv%20class=%22subscription-preferences-overlay-loading%20%22%3E%20%20%20%20%20%20%20%20%3Cp%20class=%22yt-spinner%22%3E%20%20%20%20%20%20%3Cimg%20class=%22yt-spinner-img%22%20src=%22https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif%22%20alt=%22Loading%20icon%22%20title=%22%22%3E%20%20%20%20%3Cspan%20class=%22yt-spinner-message%22%3ELoading...%20%20%20%20%3C/span%3E%20%20%3C/p%3E%20%20%20%20%3C/div%3E%20%20%20%20%3Cdiv%20class=%22subscription-preferences-overlay-content%22%3E%20%20%20%20%3C/div%3E%20%20%3C/div%3E%20%20%20%20%20%20%20%20%20%20%3C/div%3E%20%20%20%20%20%20%20%20%20%20%3Cdiv%20class=%22yt-dialog-working%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%20id=%22yt-dialog-working-overlay%22%3E%20%20%3C/div%3E%20%20%3Cdiv%20id=%22yt-dialog-working-bubble%22%3E%20%20%20%20%3Cdiv%20class=%22yt-dialog-waiting-content%22%3E%20%20%20%20%20%20%3Cdiv%20class=%22yt-spinner-img%22%3E%3C/div%3E%3Cdiv%20class=%22yt-dialog-waiting-text%22%3EWorking...%3C/div%3E%20%20%20%20%3C/div%3E%20%20%3C/div%3E%20%20%20%20%20%20%20%20%20%20%3C/div%3E%20%20%20%20%20%20%20%20%3C/div%3E%20%20%20%20%20%20%3C/div%3E%20%20%20%20%3C/div%3E%20%20%3C/div%3E%20%20%3C/div%3E%3C/span%3E%3C/span%3E%3Cdiv%20id=%22watch7-views-info%22%3E%20%20%20%20%20%20%3Cspan%20class=%22watch-view-count%20%22%3E%20%20%20%20369,165%20%20%3C/span%3E%20%20%3Cdiv%20class=%22video-extras-sparkbars%22%3E%20%20%20%20%3Cdiv%20class=%22video-extras-sparkbar-likes%22%20style=%22width:%2098.9315152132%%22%3E%3C/div%3E%20%20%20%20%3Cdiv%20class=%22video-extras-sparkbar-dislikes%22%20style=%22width:%201.06848478681%%22%3E%3C/div%3E%20%20%3C/div%3E%20%20%3Cspan%20class=%22video-extras-likes-dislikes%22%3E%20%20%20%20%20%20%3Cimg%20id=%22watch-stats-like%22%20class=%22icon-watch-stats-like%22%20src=%22https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif%22%20alt=%22Like%22%3E%20%20%3Cspan%20class=%22likes-count%22%3E9,722%3C/span%3E%20%20%20%20   %20%20%20%20%20%20%3Cimg%20id=%22watch-stats-dislike%22%20class=%22icon-watch-stats-dislike%22%20src=%22https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif%22%20alt=%22Dislike%22%3E%20%20%3Cspan%20class=%22dislikes-count%22%3E105%3C/span%3E%20%20%3C/span%3E%3C/div%3E

same issue here. and id rather not use feather/html5 because youtube suite doesnt work with them. any ideas on how to fix this?
averageuser

Re: Suggestion: Enabling YouTube Ads Depending on Channel

Post by averageuser »

I don't really get what yall are doing with those scripts. I'm just an average user of adblock. But I came here to support this! I'd love to be able to support deserving youtube channels more. Again, this coming from an average user.
User avatar
Gingerbread Man
Posts: 1339
Joined: Fri Aug 12, 2011 5:28 am

Re: Suggestion: Enabling YouTube Ads Depending on Channel

Post by Gingerbread Man »

averageuser wrote:I don't really get what yall are doing with those scripts.
They're doing what the title of this thread says. Adblock Plus blocks content based on URL patterns. Since there's nothing in an average video URL that identifies the author, the user script puts that information there. You can then create an exception filter in Adblock Plus to allow all content from that author.
I don't know how to code

Re: Suggestion: Enabling YouTube Ads Depending on Channel

Post by I don't know how to code »

Just curious if someone could explain to me how to set this all up. I think I've done it right but still am not getting any ads even on the feather beta. I added the script by Dubious to tapermonkey as it is. Then added the URL "https://www.youtube.com/user/TotalHalibut" to the filter in ABP. I'm not sure if I have done it correctly but maybe someone can help me out I'd like to support specific channels so they can keep bringing me good content.
User avatar
Gingerbread Man
Posts: 1339
Joined: Fri Aug 12, 2011 5:28 am

Re: Suggestion: Enabling YouTube Ads Depending on Channel

Post by Gingerbread Man »

I don't know how to code wrote:Then added the URL "https://www.youtube.com/user/TotalHalibut" to the filter in ABP.
That's a blocking filter. What you want is an exception filter. So delete that one and add something like

Code: Select all

@@||youtube.com/*user=TotalHalibut$document
If you continue having problems post back here and let us know if in the address bar you see &user=TotalHalibut when viewing a video from that author. Last I checked, nonessential parts of the address like that one are hidden by default in Opera (and possibly other browsers). You may need to first select the address bar as if you were going to type in a new address.
Vorondil
Posts: 1
Joined: Wed Apr 02, 2014 4:36 pm

Re: Suggestion: Enabling YouTube Ads Depending on Channel

Post by Vorondil »

When using the above javascript in GreaseMonkey for Firefox, it added a humongous text string in the URL-field that did not work. My guess is that the peopz behind Youtube have changed something recently, they tend to do that...

Anyhow, after some messing around with the script code I managed to get it to work for me, and I figured I'd share it with y'all.
I'm usually more of a C++/C#-programmer, and took myself the liberty of writing the code in a style i felt more legible. If I've made any serious Javascript faux pas, feel free to comment or alter as desired.

Code: Select all

// ==UserScript==
// @name        Expose Youtube Uploader Name in URL
// @namespace   schippi
// @description Used to expose a Youtube uploaders displayname in the URL
// @include     http://www.youtube.com/watch*
// @include     https://www.youtube.com/watch*
// @version     1.2
// @grant       none
// ==/UserScript==

// Credits go to Schippi and Dubious for doing the base work which I've modified here.

var url = window.location.href;
if ( url.search( "channel=" ) == -1 )
{
    if ( document.getElementById( "watch7-user-header" ) != null )
    {
        var channelNameContainer = document.getElementsByClassName("yt-user-name")[0];
        //var channelName = channelNameContainer.innerHTML;
        //The above 'channelName' is not used below. Could be an option instead of 'channelURL', but often contain spaces, and might not be unique.
        
        var channelURL = channelNameContainer.getAttribute("href");
        channelURL = channelURL.replace( '/user/', '' );
        
        //window.location.href = url + "&channel=" + channelName; //alterative for name insertion rather than channel-url.
        window.location.href = url + "&channel=" + channelURL;
    }
}
Vorondil out.
RubberTank

Re: Suggestion: Enabling YouTube Ads Depending on Channel

Post by RubberTank »

Dr.Bones wrote:Thanks a Bunch schippi!

I actually wanted to support TotalBiscuit :).
Hah, that's weird! :D I'm here for the exact same reason. :D Wanna support the guy for giving us free quality content.
Guest

Re: Suggestion: Enabling YouTube Ads Depending on Channel

Post by Guest »

SNLThe_Office wrote:A helpful feature that AdBlock Plus could have would be the ability to enable ads before YouTube videos on certain channels. The user would be able to make a list of the channels that they are willing to see ads on, and AdBlock would block the ads on the other channels. This would be helpful for those who believe that certain channels deserve the monetary compensation they receive from AdWords and they are willing to watch ads for them while blocking the ads on the channels that the user would prefer not to see ads on.
Would it be possible for the ads on Youtube to be blocked without the creator of the video loosing ad revenue?
Specimen

Re: Suggestion: Enabling YouTube Ads Depending on Channel

Post by Specimen »

I don't get it. The script does not work for me. I can't understand what I could be doing wrong.
Specimen

Re: Suggestion: Enabling YouTube Ads Depending on Channel

Post by Specimen »

I mean the script does show me the Youtuber's name on the address but the whitelisting doesn't work.

I have the filter in ABP as follows:

@@|http://www.youtube.com/watch*user=GameGrumps

Is there anything wrong with it? Is it something else that's hindering the script?
User avatar
Gingerbread Man
Posts: 1339
Joined: Fri Aug 12, 2011 5:28 am

Re: Suggestion: Enabling YouTube Ads Depending on Channel

Post by Gingerbread Man »

Try

Code: Select all

@@||youtube.com/*user=GameGrumps$document
The $document option matches against the current URL (what you see in the address bar).
en/filters#options
Post Reply