okay so i've been messing around with this for a couple of hours. i had first ran across the original script written by schippi that seemed to work for a long five minutes before it quite showing the ads on channels. have no clue why, or if it was an utter fluke that it ran for a short period. so i managed to find this site. i'm now trying the rewrite by vorondil "Expose Youtube Uploader Name in URL", i swapped out the script. now i have tried for example @@||youtube.com/*channel=ashens$document and @@||youtube.com/*user=ashens$document (though i know the new script calls for channel). well. if i load a channel, click the link, nada just pops up with the video and no ad. out of curiosity i hit F5 to refresh and it showed the script loaded and running and the ad now works. now i'm no coder, i don't pretend to be, and have had very little experience in teaching myself. but i'm curious why the script is only running on refresh rather than loading on the link. i really just want to support a handful of channels that i enjoy, as i would hope someone would do the same for myself. any ideas, maybe i'm not getting something or using this incorrectly. by the way i'm on chrome using tampermonkey. **oh and i have tried using the auto reload tab in tempermonkey as well.
edit: this does seem to work with videos that have in stream pop up ads, the little box that appears on screen during playback. i'll notice the script kick in and reload the page and show those ads. however it will only work for videos that have a commercial playing before the video if you refresh. eh. sorry for the length. just happened to notice that on a different channel i was watching that i had happened to add.
I created an account just to suggest this.
I've been really wanting this feature for a long time now.
I hadn't bothered suggesting it in the past because, frankly, it seemed like a no-brainer feature that the devs probably thought of already.
I really, really hope I'll find this feature in a near-future Adblock release.
Vorondil wrote: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.
// ==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.
Tried using this one through tampermonkey in Chrome, with "channel=https://www.youtube.com/user/TotalHalibut", then adding the following to the AdBlock Plus filter "@@||youtube.com/*user=TotalHalibut$document". After doing this, whenever I load a video on Youtube, it constantly refreshes, each time adding an extra segment onto the URL, eventually leading to an error about the /watch URL being too long. Am I doing something wrong, or has Youtube changed something?
i updated the from 1.2 to 1.3. to be easier to setup, squished the constant refresh bug (it could only happen if you changed from userURL to userName) and added a brief explanation on how to change "settings"
// ==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.3
// @grant none
// ==/UserScript==
// Credits go to Schippi and Dubious for doing the base work which I've modified here.
var setup = "user";
// only this /\ is to be edited depending on what you want.
// change "user" to "channel" if you wish to use the safer method of not unlocking ads for channels with same name
var url = window.location.href;
if ( url.search( "user=" ) == -1)
{
if ( document.getElementById( "watch7-user-header" ) != null )
{
var channelNameContainer = document.getElementsByClassName("yt-user-name")[0];
var channelName = channelNameContainer.innerHTML;
if(setup == "user")
{
channelName = channelName.replace( ' ', '' );
window.location.href = url + "&user=" + channelName;
};
if(setup == "channel")
{
var channelURL = channelNameContainer.getAttribute("href");
channelURL = channelURL.replace( '/channel/', '' );
window.location.href = url + "&user=" + channelURL;
};
}
}
So, I put that new code in, and am I right in saying you don't have to put a specific channel name in anywhere in that code? Without adding any channel names and leaving as is, the constant refresh stopped, and the channel name is now displayed at the top as something like "https://www.youtube.com/watch?v=zymf7o5 ... cal%20Brit". However, I can't seem to work out how to then add the filter to addblock plus.
DaJamsta123 wrote:So, I put that new code in, and am I right in saying you don't have to put a specific channel name in anywhere in that code? Without adding any channel names and leaving as is, the constant refresh stopped, and the channel name is now displayed at the top as something like "https://www.youtube.com/watch?v=zymf7o5 ... cal%20Brit". However, I can't seem to work out how to then add the filter to addblock plus.
that's the exception rule you have to add to adblock:
I think what I may have been doing wrong (which was partially pointed out in the video description) was that I was using MagicActions for Youtube, which had the block ads thing enabled.
One more question though, if I want to do this for other channels, do I just have to add another filter to AddBlock?
DaJamsta123 wrote:One more question though, if I want to do this for other channels, do I just have to add another filter to AddBlock?
not filter, whitelist entry. (i think that's what you meant anyway ^^)
for example if you now wanted to whitelist my youtube channel (just kidding. nobody watches my channel anyway ) you would have to add
to adblock and then you would allow ads on both channels, totalbiscuit and mine.
you can repeat this process for any channel you want to unlock ads for.
Adding this to the filter tab in AdBlock Plus seems to work, maybe it calls it something different because I'm in Chrome. There is another tab called Whitelisted Domains, but I should think that's just for normal URL's to be whitelisted. Oh wlee, what I have works, so thanks
DaJamsta123 wrote:Adding this to the filter tab in AdBlock Plus seems to work, maybe it calls it something different because I'm in Chrome. There is another tab called Whitelisted Domains, but I should think that's just for normal URL's to be whitelisted. Oh wlee, what I have works, so thanks
sorry, just looked at my adblock and you're right. they named it "filter" while in reality it is supposed to be called whitelist or exception...
I don't think we need this "full" "whitelist". We just need a filter list to only allow the image ads on the right side (above the suggested videos) and the in-video ads (those which pop up after a specific amount of time). Only the pre-video ads-videos are annoying and should be blocked. That's a start, but it needs a bit more to get my idea "working":
Ok so I just posted a thread asking why disabling adblock for one video disables it for all, and if there's a way to change that, but I was directed here and my thread was locked.
I originally just wanted to know how to enable ads PER VIDEO not PER CHANNEL, but I'm guessing the former is impossible?
Regarding the latter, I've read just now the entirety of this thread, and as someone who doesn't code, doesn't have greasemonkey or tampermonkey or know what those are, I remain extremely confused.
Assuming a solution has been found - and it appears one has been - can someone PLEASE just write up a step-by-step process on how to do this? I'll install, copy/paste, whatever I have to, but I'm sorry I'm stupid but I can't for the life of me figure out what to do to achieve this. Any help would be GREATLY APPRECIATED!!!
EDIT: I just clicked someones "greasyfork" link and there appears to be a step by step process. I'll check that now but again any additional help would be great.