기 타 [팁] 유튜브 광고 차단
2023.12.03 20:59
Youtube 광고가 미쳤는지 좀 긴 영상보다보면 10분마다 한번씩 뜨는 경우가 있더군요..
30분에 한번씩 뜰때까지만 해도 그냥 광고 보이면 5초뒤에 건너띄기 눌러서 보고 그랬었는데 ...
10분만다 뜨니 짜증이 나더군요... 어쩔수 없이 광고 건너띄는 방법을 찾아 봅니다.
아래 소스를 즐겨찾기에 넣어두시고 유튜브 들어가서 한번씩 눌러주면 됩니다. 주소창에 복사해서 붙여넣고 맨앞에 javascript:를 넣은후 즐겨찾기로 끌어 오시면 즐겨찾기 추가한후 알아보기 쉽게 이름 바꿔주면 유튜브 접속후 해당 즐겨찾기를 한번 눌러주면 됩니다.
혹은 유튜브 접속후 F12 눌러 콘솔탭에서 해당 소스를 붙여놓고 실행시키는 방법도 있습니다.
(function()
{
const adblocker = true;
const removePopup = true;
const debug = true;
const domainsToRemove = [
'*.youtube-nocookie.com/*'
];
const jsonPathsToRemove = [
'playerResponse.adPlacements',
'playerResponse.playerAds',
'adPlacements',
'playerAds',
'playerConfig',
'auxiliaryUi.messageRenderers.enforcementMessageViewModel'
];
const observerConfig = {
childList: true,
subtree: true
};
const keyEvent = new KeyboardEvent("keydown", {
key: "k",
code: "KeyK",
keyCode: 75,
which: 75,
bubbles: true,
cancelable: true,
view: window
});
let mouseEvent = new MouseEvent("click", {
bubbles: true,
cancelable: true,
view: window,
});
let unpausedAfterSkip = 0;
if (debug) console.log("Remove Adblock Thing: Remove Adblock Thing: Script started");
window.__ytplayer_adblockDetected = false;
if(adblocker) addblocker();
if(removePopup) popupRemover();
if(removePopup) observer.observe(document.body, observerConfig);
function popupRemover() {
removeJsonPaths(domainsToRemove, jsonPathsToRemove);
setInterval(() => {
const fullScreenButton = document.querySelector(".ytp-fullscreen-button");
const modalOverlay = document.querySelector("tp-yt-iron-overlay-backdrop");
const popup = document.querySelector(".style-scope ytd-enforcement-message-view-model");
const popupButton = document.getElementById("dismiss-button");
const video1 = document.querySelector("#movie_player > video.html5-main-video");
const video2 = document.querySelector("#movie_player > .html5-video-container > video");
const bodyStyle = document.body.style;
bodyStyle.setProperty('overflow-y', 'auto', 'important');
if (modalOverlay) {
modalOverlay.removeAttribute("opened");
modalOverlay.remove();
}
if (popup) {
if (debug) console.log("Remove Adblock Thing: Popup detected, removing...");
if(popupButton) popupButton.click();
popup.remove();
unpausedAfterSkip = 2;
fullScreenButton.dispatchEvent(mouseEvent);
setTimeout(() => {
fullScreenButton.dispatchEvent(mouseEvent);
}, 500);
if (debug) console.log("Remove Adblock Thing: Popup removed");
}
if (!unpausedAfterSkip > 0) return;
unPauseVideo(video1);
unPauseVideo(video2);
}, 1000);
}
function addblocker()
{
setInterval(() =>
{
const skipBtn = document.querySelector('.videoAdUiSkipButton,.ytp-ad-skip-button');
const ad = [...document.querySelectorAll('.ad-showing')][0];
const sidAd = document.querySelector('ytd-action-companion-ad-renderer');
const displayAd = document.querySelector('div#root.style-scope.ytd-display-ad-renderer.yt-simple-endpoint');
const sparklesContainer = document.querySelector('div#sparkles-container.style-scope.ytd-promoted-sparkles-web-renderer');
const mainContainer = document.querySelector('div#main-container.style-scope.ytd-promoted-video-renderer');
const feedAd = document.querySelector('ytd-in-feed-ad-layout-renderer');
const mastheadAd = document.querySelector('.ytd-video-masthead-ad-v3-renderer');
const sponsor = document.querySelectorAll("div#player-ads.style-scope.ytd-watch-flexy, div#panels.style-scope.ytd-watch-flexy");
const nonVid = document.querySelector(".ytp-ad-skip-button-modern");
if (ad)
{
const video = document.querySelector('video');
video.playbackRate = 10;
video.volume = 0;
video.currentTime = video.duration;
skipBtn?.click();
}
sidAd?.remove();
displayAd?.remove();
sparklesContainer?.remove();
mainContainer?.remove();
feedAd?.remove();
mastheadAd?.remove();
sponsor?.forEach((element) => {
if (element.getAttribute("id") === "panels") {
element.childNodes?.forEach((childElement) => {
if (childElement.data.targetId && childElement.data.targetId !=="engagement-panel-macro-markers-description-chapters")
childElement.remove();
});
} else {
element.remove();
}
});
nonVid?.click();
}, 50)
}
function unPauseVideo(video)
{
if (!video) return;
if (video.paused) {
document.dispatchEvent(keyEvent);
unpausedAfterSkip = 0;
if (debug) console.log("Remove Adblock Thing: Unpaused video using 'k' key");
} else if (unpausedAfterSkip > 0) unpausedAfterSkip--;
}
function removeJsonPaths(domains, jsonPaths)
{
const currentDomain = window.location.hostname;
if (!domains.includes(currentDomain)) return;
jsonPaths.forEach(jsonPath => {
const pathParts = jsonPath.split('.');
let obj = window;
let previousObj = null;
let partToSetUndefined = null;
for (const part of pathParts) {
if (obj.hasOwnProperty(part)) {
previousObj = obj;
partToSetUndefined = part;
obj = obj[part];
} else {
break;
}
}
if (previousObj && partToSetUndefined !== null) {
previousObj[partToSetUndefined] = undefined;
}
});
}
const observer = new MutationObserver(() =>
{
removeJsonPaths(domainsToRemove, jsonPathsToRemove);
});
})();
위 소스는 해외유저가 github에 공개된 소스 입니다.
https://github.com/TheRealJoelmatic/RemoveAdblockThing/releases
매번 유튜브 들어가서 한번씩 눌러주는게 귀찮다면
Run Javascript 같은 별도의 확장 프로그램 이나 Tampermonkey 같은 확장프로그램을 이용하시는 방법도 있습니다.
댓글 [14]
-
DarknessAngel 2023.12.04 17:28
-
시원한보리차한잔 2023.12.05 09:37
이거 하고도 잘 보다가 광고차단 문구 뜨면
브라우저 옵션에서 개인정보보호 및 보안쪽에서 인터넷검색기록 삭제 가서 쿠키 싹다 지우기 해보고 하시면 됩니다.
-
체리마키아또 2023.12.05 10:59
크롬 사용하시면 수동으로 확장 프로그램 이용하는 방법도 있어요
https://github.com/barla-x88/SkipYouTubeAd
위 주소에서 파일을 받아 압축풀고
크롬 확장프로그램관리 > 개발자 모드 ON > 압축해제된 확장 프로그램을 로드 > 압축푼 폴더 선택
-
CoSSe 2023.12.08 19:08
다운받아 수동확장으로 해보니 전처럼 AdGuard확장도 쓸수있고
광고없이 깔끔하게 Youtube 영상보기 가능합니다
정보 감사합니다 ~~ 추천
-
번개 2023.12.05 22:52
유튜브보다 보면 정말 짜증날 정도로 광고떠서 사람 미치게하는군요
-
Nick 2023.12.07 16:56
제 경우 파폭에 ublock 애드온 쓰는데 anti adblock필터 몇 개랑 수동으로 '내필터' 란에
! 2023-10-13 https://www.youtube.com
www.youtube.com##tp-yt-paper-dialog.ytd-popup-container.style-scope
www.youtube.com##.opened를 추가해주니 광고차단 문구도 안뜨고 쾌적하게 사용중입니다.
-
yobee2024 2023.12.08 03:46
저는 Edge 쓰고 있어요.
크롬은 무슨 방법을 써도 안되길래..
구글링해서 찾아봤더니~
uBlock Origin이란 확장프로그램 추가해서 쓰니까
유튜브 광고 전혀 안뜨고 잘 쓰고 있습니다.
-
정소추 2023.12.08 21:10
tampermonkey도 좋습니다. 구독료가 올라서 어쩔수없네요
-
하늘은높고구름은뭉게구름 2023.12.09 19:13
edge 브라우저 사용 중입니다.
위에 알려주신대로 했더니 유튜브 광고가 안 뜨네요.
아주 신세계 입니다.
감사합니다. ^^
-
초보캠퍼 2023.12.10 05:47
크롬 애드블록 쓰는데 광고 안떠요...
폰도 애드블록 쓰는데 안뜨구요....
-
하늘은높고구름은뭉게구름 2023.12.11 12:29
광고 안 나와서 아주 좋습니다.
감사합니다. ^^*
욕심이 생겼습니다.
자주 클릭을 해야해서 시간을 좀 더 늘리고 싶은데요.
위의 명령어 중에서 시간을 늘리는 부분이 있는지요.
죄송합니다. 편하면 더 편한 걸 찾습니다. ^^*
-
미남산타 2023.12.13 18:23
위에 본문 내용 스크립트 소스를 파일로 만들었습니다.
-
하늘은높고구름은뭉게구름 2023.12.13 19:36
고맙습니다. ^^*
-
꿈이있는세상 2024.03.14 09:54
감사하게 잘 사용하겠습니다.
번호 | 제목 | 글쓴이 | 조회 | 추천 | 등록일 |
---|---|---|---|---|---|
[공지] | 강좌 작성간 참고해주세요 | gooddew | - | - | - |
384 | 기 타| WindowsXPE147 수정버전 사용법 입니다... [27] | 노랑개굴 | 2043 | 50 | 03-11 |
383 | 기 타| 구글 드라이브 다운로드 초과했을 때 다운로드 방법 [41] | suk | 26759 | 49 | 11-19 |
382 | 기 타| 그 동안 본인이 업로드한 강좌를 보내드립니다. [181] | 고양이2 | 12728 | 45 | 11-06 |
381 | 기 타| 2024 새로운 시작, Rainmeter, 위젯, 바탕화면, 퍼포먼스 [16] | 모네곰 | 2725 | 38 | 02-01 |
380 | 기 타| RSImageX 기본 파일 구성 [19] | suk | 2664 | 33 | 02-14 |
379 | 기 타| BCD편집으로 USB에 PE 2개 넣기 [41] | lakeside | 7179 | 32 | 05-22 |
» | 기 타| [팁] 유튜브 광고 차단 [14] | 천경지위 | 8174 | 28 | 12-03 |
377 | 기 타| 모든 영상을 순간으로 MP4 확장자로 변환. [18] | 모네곰 | 2569 | 28 | 12-30 |
376 | 기 타| [팁] PE에서 wim 부팅하는데 필요한 boot.sdi [12] | suk | 3779 | 27 | 04-24 |
375 | 기 타| 바로 가기 만들기 [7] | bangul | 2292 | 23 | 04-22 |
374 | 기 타| USB 디스크 인식 오류시 복구 방법 [18] | gooddew | 4193 | 22 | 08-17 |
373 | 기 타| CMD BAT 를 UTF8 모드로 사용 [13] | 입니다 | 1684 | 22 | 01-16 |
372 | 기 타| 단위를 올바로 씁시다 [18] | asklee | 9212 | 21 | 10-20 |
371 | 기 타| 애드가드(Adguard) 다음카카오TV 재생불가 필터 추가하세요. [24] | 절제자 | 4734 | 20 | 01-04 |
370 | 기 타| 우리집 와이파이 비밀번호 초간단 확인하기 [7] | gooddew | 5707 | 20 | 08-22 |
369 | 기 타| Dubox Cloud 스토리지에서 1TB를 무료로 제공합니다. [30] | VenusGirl | 3893 | 20 | 07-01 |
368 | 기 타| bat로 포터블 만들기 간단 팁 [9] | 슈머슈마 | 2737 | 20 | 11-12 |
367 | 기 타| [정보] 윈도우10 쓰는 사람 필독 [10] | ♣OSISO™ | 8863 | 19 | 01-25 |
366 | 기 타| GRUB 부팅 USB 만들기. 쉽게 써보려고 노력...; [35] | 서기다 | 8379 | 18 | 03-08 |
365 | 기 타| 자신의 음악성향에 맞게 EQ(이퀼라이저) 설정하기 [10] | UCLA | 5771 | 18 | 12-02 |
10분정돈 약과입니다
스샷 보시면 24시간짤 스킵 불가 광고도 있습니다