I'm David.
- π± Iβm currently studying Computer Science and Engineering
- π¬ Ask me about Linux, Raspberry, Pihole, Centreon, Nagios, Cybersecurity
- π« How to reach me: https://deividgdt.github.io/info/
YTadsblocker is a script to block all the Youtube's advertisement in Pi-Hole
License: GNU General Public License v3.0
I'm David.
Just installed YTAdsblock on my Rasperry. Unfortunately it says during the installation:
Target: hosts-file.net (ad_servers.txt)
Status: Not found
List download failed: No cached list available
in my Pi hole Blocklist Section it shows the ad_servers.txt but if i click on that its unavailable too (Not found)
is there a fix or a workaround available? Thanks in advance
I'm having some issues loading videos on both my television and desktop. I'm a little new to all this, how do I remove the Git clone please?
Thank you
This will not work when the querylogging is off.
I propose that you use something like:
echo " select domain from queries where domain like '%.googlevideo.com'and status in (2, 3,14,12,13) group by domain" | /usr/bin/sqlite3 /etc/pihole/pihole-FTL.db | grep 'r[0-9]{1,2}[^-].*.googlevideo.com'
Sorry if I misunderstood, but if you're trying to filter all the subdomains that match a regular expression, isn't it easier to add that regular expression as a filter directly in Pi-Hole (Domains/RegEx filter)?
Pi-Hole Documentation: https://docs.pi-hole.net/regex/overview/
Hello,
I have the same issue that #7 now.
If I uninstall, then install, scripts is able to read log file and add domains.
After start, no more domains are added, even they are showed on QueryLog.
I did some tests but could not figure out whats is going on.
IΒ΄m using PiHole + Unbound
Can you help-me ?
Query Log:
2021-08-28 20:09:56 AAAA r6---sn-25ge7ns7.googlevideo.com 192.168.x.x OK (forwarded to localhost#5335)
INSECURE CNAME (486.2ms)
2021-08-28 20:09:56 A r6---sn-25ge7ns7.googlevideo.com 192.168.x.x OK (forwarded to localhost#5335)
INSECURE CNAME (147.2ms)
Manually running:
pi@piaware:/var/log $ export YT_DOMAINS=$(cat /var/log/pihole.log | egrep --only-matching "r([0-9]{1,2})[^-].*.googlevideo.com" | sort | uniq)
pi@piaware:/var/log $ echo $YT_DOMAINS
r1.sn-apn7en7e.googlevideo.com r1.sn-apn7en7l.googlevideo.com r2.sn-25ge7nzs.googlevideo.com r2.sn-5hneknee.googlevideo.com r2.sn-apn7en7e.googlevideo.com r2.sn-apn7en7l.googlevideo.com r3.sn-5hnekn7z.googlevideo.com r3.sn-8vq54vox2u-apnl.googlevideo.com r3.sn-apn7en7e.googlevideo.com r3.sn-apn7en7l.googlevideo.com r3.sn-h5q7knez.googlevideo.com r3.sn-hpa7kn76.googlevideo.com r4.sn-25ge7nsd.googlevideo.com r4.sn-apn7en7e.googlevideo.com r4.sn-apn7en7l.googlevideo.com r5.sn-apn7en7e.googlevideo.com r5.sn-apn7en7l.googlevideo.com r6.sn-25ge7ns7.googlevideo.com
pi@piaware:/var/log $
LOG:
Aug 28 20:09:55 dnsmasq[816]: query[A] r1---sn-apn7en7l.googlevideo.com from 192.168.x.x
Aug 28 20:09:55 dnsmasq[816]: forwarded r1---sn-apn7en7l.googlevideo.com to 127.0.0.1
Aug 28 20:09:55 dnsmasq[816]: reply r1---sn-apn7en7l.googlevideo.com is
Aug 28 20:09:55 dnsmasq[816]: reply r1.sn-apn7en7l.googlevideo.com is blocked during CNAME inspection
Aug 28 20:09:55 dnsmasq[816]: query[AAAA] r1---sn-apn7en7l.googlevideo.com from 192.168.x.x
Aug 28 20:09:55 dnsmasq[816]: forwarded r1---sn-apn7en7l.googlevideo.com to 127.0.0.1
Aug 28 20:09:55 dnsmasq[816]: reply r1---sn-apn7en7l.googlevideo.com is
Aug 28 20:09:55 dnsmasq[816]: reply r1.sn-apn7en7l.googlevideo.com is blocked during CNAME inspection
Aug 28 20:09:56 dnsmasq[816]: query[A] r1---sn-apn7en7e.googlevideo.com from 192.168.x.x
Aug 28 20:09:56 dnsmasq[816]: forwarded r1---sn-apn7en7e.googlevideo.com to 127.0.0.1
Aug 28 20:09:56 dnsmasq[816]: query[AAAA] r1---sn-apn7en7e.googlevideo.com from 192.168.x.x
Aug 28 20:09:56 dnsmasq[816]: forwarded r1---sn-apn7en7e.googlevideo.com to 127.0.0.1
Aug 28 20:09:56 dnsmasq[816]: reply r1---sn-apn7en7e.googlevideo.com is
Aug 28 20:09:56 dnsmasq[816]: reply r1.sn-apn7en7e.googlevideo.com is blocked during CNAME inspection
Aug 28 20:09:56 dnsmasq[816]: reply r1---sn-apn7en7e.googlevideo.com is
Aug 28 20:09:56 dnsmasq[816]: reply r1.sn-apn7en7e.googlevideo.com is blocked during CNAME inspection
Aug 28 20:09:56 dnsmasq[816]: query[A] r6---sn-25ge7ns7.googlevideo.com from 192.168.x.x
Aug 28 20:09:56 dnsmasq[816]: forwarded r6---sn-25ge7ns7.googlevideo.com to 127.0.0.1
Aug 28 20:09:56 dnsmasq[816]: query[AAAA] r6---sn-25ge7ns7.googlevideo.com from 192.168.x.x
Aug 28 20:09:56 dnsmasq[816]: forwarded r6---sn-25ge7ns7.googlevideo.com to 127.0.0.1
Aug 28 20:09:56 dnsmasq[816]: reply r6---sn-25ge7ns7.googlevideo.com is
Aug 28 20:09:56 dnsmasq[816]: reply r6.sn-25ge7ns7.googlevideo.com is 209.85.230.252
Aug 28 20:09:56 dnsmasq[816]: reply r6---sn-25ge7ns7.googlevideo.com is
Aug 28 20:09:56 dnsmasq[816]: reply r6.sn-25ge7ns7.googlevideo.com is 2a00:1450:4007:6::c
Aug 28 20:10:05 dnsmasq[816]: query[A] r3---sn-apn7en7l.googlevideo.com from 192.168.x.x
Aug 28 20:10:05 dnsmasq[816]: forwarded r3---sn-apn7en7l.googlevideo.com to 127.0.0.1
Aug 28 20:10:05 dnsmasq[816]: query[AAAA] r3---sn-apn7en7l.googlevideo.com from 192.168.x.x
Aug 28 20:10:05 dnsmasq[816]: forwarded r3---sn-apn7en7l.googlevideo.com to 127.0.0.1
Aug 28 20:10:05 dnsmasq[816]: reply r3---sn-apn7en7l.googlevideo.com is
Aug 28 20:10:05 dnsmasq[816]: reply r3.sn-apn7en7l.googlevideo.com is blocked during CNAME inspection
Aug 28 20:10:06 dnsmasq[816]: reply r3---sn-apn7en7l.googlevideo.com is
Aug 28 20:10:06 dnsmasq[816]: reply r3.sn-apn7en7l.googlevideo.com is blocked during CNAME inspection
Aug 28 20:10:06 dnsmasq[816]: query[A] r4---sn-apn7en7l.googlevideo.com from 192.168.x.x
Aug 28 20:10:06 dnsmasq[816]: forwarded r4---sn-apn7en7l.googlevideo.com to 127.0.0.1
Aug 28 20:10:06 dnsmasq[816]: query[AAAA] r4---sn-apn7en7l.googlevideo.com from 192.168.x.x
Aug 28 20:10:06 dnsmasq[816]: forwarded r4---sn-apn7en7l.googlevideo.com to 127.0.0.1
Aug 28 20:10:06 dnsmasq[816]: reply r4---sn-apn7en7l.googlevideo.com is
Aug 28 20:10:06 dnsmasq[816]: reply r4.sn-apn7en7l.googlevideo.com is blocked during CNAME inspection
Aug 28 20:10:06 dnsmasq[816]: reply r4---sn-apn7en7l.googlevideo.com is
Aug 28 20:10:06 dnsmasq[816]: reply r4.sn-apn7en7l.googlevideo.com is blocked during CNAME inspection
Aug 28 20:10:06 dnsmasq[816]: query[A] r4---sn-apn7en7e.googlevideo.com from 192.168.x.x
Aug 28 20:10:06 dnsmasq[816]: forwarded r4---sn-apn7en7e.googlevideo.com to 127.0.0.1
Aug 28 20:10:06 dnsmasq[816]: query[AAAA] r4---sn-apn7en7e.googlevideo.com from 192.168.x.x
Aug 28 20:10:06 dnsmasq[816]: forwarded r4---sn-apn7en7e.googlevideo.com to 127.0.0.1
Aug 28 20:10:06 dnsmasq[816]: reply r4---sn-apn7en7e.googlevideo.com is
Aug 28 20:10:06 dnsmasq[816]: reply r4.sn-apn7en7e.googlevideo.com is blocked during CNAME inspection
Aug 28 20:10:06 dnsmasq[816]: reply r4---sn-apn7en7e.googlevideo.com is
Aug 28 20:10:06 dnsmasq[816]: reply r4.sn-apn7en7e.googlevideo.com is blocked during CNAME inspection
Aug 28 20:10:16 dnsmasq[816]: query[A] r4---sn-apn7en7e.googlevideo.com from 192.168.x.x
Aug 28 20:10:16 dnsmasq[816]: forwarded r4---sn-apn7en7e.googlevideo.com to 127.0.0.1
Aug 28 20:10:16 dnsmasq[816]: query[AAAA] r4---sn-apn7en7e.googlevideo.com from 192.168.x.x
Aug 28 20:10:16 dnsmasq[816]: forwarded r4---sn-apn7en7e.googlevideo.com to 127.0.0.1
Aug 28 20:10:16 dnsmasq[816]: reply r4---sn-apn7en7e.googlevideo.com is
Aug 28 20:10:16 dnsmasq[816]: reply r4.sn-apn7en7e.googlevideo.com is blocked during CNAME inspection
Aug 28 20:10:16 dnsmasq[816]: reply r4---sn-apn7en7e.googlevideo.com is
Aug 28 20:10:16 dnsmasq[816]: reply r4.sn-apn7en7e.googlevideo.com is blocked during CNAME inspection
Aug 28 20:10:23 dnsmasq[816]: query[A] r1---sn-apn7en7l.googlevideo.com from 192.168.x.x
Aug 28 20:10:23 dnsmasq[816]: forwarded r1---sn-apn7en7l.googlevideo.com to 127.0.0.1
Aug 28 20:10:23 dnsmasq[816]: reply r1---sn-apn7en7l.googlevideo.com is
Aug 28 20:10:23 dnsmasq[816]: reply r1.sn-apn7en7l.googlevideo.com is blocked during CNAME inspection
Aug 28 20:10:23 dnsmasq[816]: query[AAAA] r1---sn-apn7en7l.googlevideo.com from 192.168.x.x
Aug 28 20:10:23 dnsmasq[816]: forwarded r1---sn-apn7en7l.googlevideo.com to 127.0.0.1
Aug 28 20:10:23 dnsmasq[816]: reply r1---sn-apn7en7l.googlevideo.com is
Aug 28 20:10:23 dnsmasq[816]: reply r1.sn-apn7en7l.googlevideo.com is blocked during CNAME inspection
Aug 28 20:10:23 dnsmasq[816]: query[A] r1---sn-apn7en7e.googlevideo.com from 192.168.x.x
Aug 28 20:10:23 dnsmasq[816]: forwarded r1---sn-apn7en7e.googlevideo.com to 127.0.0.1
Aug 28 20:10:23 dnsmasq[816]: reply r1---sn-apn7en7e.googlevideo.com is
Aug 28 20:10:23 dnsmasq[816]: reply r1.sn-apn7en7e.googlevideo.com is blocked during CNAME inspection
Aug 28 20:10:23 dnsmasq[816]: query[AAAA] r1---sn-apn7en7e.googlevideo.com from 192.168.x.x
Aug 28 20:10:23 dnsmasq[816]: forwarded r1---sn-apn7en7e.googlevideo.com to 127.0.0.1
Aug 28 20:10:23 dnsmasq[816]: reply r1---sn-apn7en7e.googlevideo.com is
Aug 28 20:10:23 dnsmasq[816]: reply r1.sn-apn7en7e.googlevideo.com is blocked during CNAME inspection
Aug 28 20:10:33 dnsmasq[816]: query[A] r1---sn-apn7en7e.googlevideo.com from 192.168.x.x
Aug 28 20:10:33 dnsmasq[816]: forwarded r1---sn-apn7en7e.googlevideo.com to 127.0.0.1
Aug 28 20:10:33 dnsmasq[816]: reply r1---sn-apn7en7e.googlevideo.com is
Aug 28 20:10:33 dnsmasq[816]: reply r1.sn-apn7en7e.googlevideo.com is blocked during CNAME inspection
Aug 28 20:10:33 dnsmasq[816]: query[AAAA] r1---sn-apn7en7e.googlevideo.com from 192.168.x.x
Aug 28 20:10:33 dnsmasq[816]: forwarded r1---sn-apn7en7e.googlevideo.com to 127.0.0.1
Aug 28 20:10:33 dnsmasq[816]: reply r1---sn-apn7en7e.googlevideo.com is
Aug 28 20:10:33 dnsmasq[816]: reply r1.sn-apn7en7e.googlevideo.com is blocked during CNAME inspection
ytadsblocker LOG
[2021-08-28 19:49:51] Checking /var/log/pihole.log...
[2021-08-28 19:49:54] No new subdomains to added.
[2021-08-28 19:54:54] Checking /var/log/pihole.log...
[2021-08-28 19:54:58] No new subdomains to added.
[2021-08-28 19:59:58] Checking /var/log/pihole.log...
[2021-08-28 20:00:01] No new subdomains to added.
[2021-08-28 20:05:01] Checking /var/log/pihole.log...
[2021-08-28 20:05:05] No new subdomains to added.
[2021-08-28 20:10:05] Checking /var/log/pihole.log...
[2021-08-28 20:10:08] No new subdomains to added.
[2021-08-28 20:15:08] Checking /var/log/pihole.log...
[2021-08-28 20:15:12] No new subdomains to added.
After installing, I run service ytadsblocker status
to ensure that the service is running. That returns
β ytadsblocker.service - Youtube ads blocker service for Pi-hole
Loaded: loaded (/lib/systemd/system/ytadsblocker.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2022-09-16 22:22:09 EDT; 4min 10s ago
Process: 11770 ExecStart=/home/pi/ytadsblocker/ytadsblocker.sh -a start (code=exited, status=1/FAILURE)
Main PID: 11770 (code=exited, status=1/FAILURE)
CPU: 221ms
Sep 16 22:22:08 raspberrypi systemd[1]: Started Youtube ads blocker service for Pi-hole.
Sep 16 22:22:09 raspberrypi ytadsblocker.sh[11770]: Youtube Ads Blocker Started
Sep 16 22:22:09 raspberrypi ytadsblocker.sh[11770]: Check the /var/log/ytadsblocker.log file to get further information.
Sep 16 22:22:09 raspberrypi ytadsblocker.sh[11770]: [β] The YTADSBLOCKER group ID does not exists in the database.
Sep 16 22:22:09 raspberrypi systemd[1]: ytadsblocker.service: Main process exited, code=exited, status=1/FAILURE
Sep 16 22:22:09 raspberrypi systemd[1]: ytadsblocker.service: Failed with result 'exit-code'.
I checked /var/log/ytadsblocker.log, which says
./ytadsblocker.sh: line 96: sqlite3: command not found
[2022-09-16 18:50:55] Youtube Ads Blocker Started
./ytadsblocker.sh: line 112: sqlite3: command not found
[2022-09-16 18:52:00] Youtube Ads Blocker Started
./ytadsblocker.sh: line 112: sqlite3: command not found
[2022-09-16 20:24:04] Youtube Ads Blocker Started
./ytadsblocker.sh: line 112: sqlite3: command not found
[2022-09-16 20:29:20] Youtube Ads Blocker Started
/home/pi/ytadsblocker/ytadsblocker.sh: line 112: sqlite3: command not found
[2022-09-16 20:29:59] Youtube Ads Blocker Started
/home/pi/ytadsblocker/ytadsblocker.sh: line 112: sqlite3: command not found
[2022-09-16 20:41:31] Youtube Ads Blocker Started
/home/ytadsblocker/ytadsblocker.sh: line 112: sqlite3: command not found
./ytadsblocker.sh: line 118: sqlite3: command not found
./ytadsblocker.sh: line 118: sqlite3: command not found
[2022-09-16 21:00:02] Youtube Ads Blocker Started
/home/scripts/ytadsblocker/ytadsblocker.sh: line 112: sqlite3: command not found
[2022-09-16 21:44:17] Youtube Ads Blocker Started
/ytadsblocker/ytadsblocker.sh: line 112: sqlite3: command not found
[2022-09-16 21:48:08] Youtube Ads Blocker Started
/ytadsblocker/ytadsblocker.sh: line 112: sqlite3: command not found
[2022-09-16 21:52:26] Youtube Ads Blocker Started
/ytadsblocker/ytadsblocker.sh: line 112: sqlite3: command not found
[2022-09-16 21:59:39] Youtube Ads Blocker Started
To solve this problem, I went into the Pihole admin UI ([pihole IP]/admin/groups.php) and created a group with the ID "YTADSBLOCKER"
I restarted the service and got the following:
β ytadsblocker.service - Youtube ads blocker service for Pi-hole
Loaded: loaded (/lib/systemd/system/ytadsblocker.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2022-09-16 22:30:56 EDT; 2s ago
Main PID: 11896 (ytadsblocker.sh)
Tasks: 6 (limit: 415)
CPU: 2.322s
CGroup: /system.slice/ytadsblocker.service
ββ11896 /bin/bash /home/pi/ytadsblocker/ytadsblocker.sh -a start
ββ11912 /bin/bash /home/pi/ytadsblocker/ytadsblocker.sh -a start
ββ11913 cat /var/log/pihole.log
ββ11914 grep -E --only-matching
ββ11915 sort
ββ11916 uniq
Sep 16 22:30:56 raspberrypi systemd[1]: Started Youtube ads blocker service for Pi-hole.
Sep 16 22:30:57 raspberrypi ytadsblocker.sh[11896]: Youtube Ads Blocker Started
Sep 16 22:30:57 raspberrypi ytadsblocker.sh[11896]: Check the /var/log/ytadsblocker.log file to get further information.
/var/log/ytadsblocker.log returned the following:
[2022-09-16 22:30:57] Youtube Ads Blocker Started
[2022-09-16 22:30:57] Checking /var/log/pihole.log...
[2022-09-16 22:32:02] No new subdomains to added.
[2022-09-16 22:37:02] Checking /var/log/pihole.log...
[2022-09-16 22:38:06] No new subdomains to added.
This appeared to be normal behavior, but YT ads were not being blocked. So I added my device to the YTADSBLOCKER group through the Pihole admin interface. Ads were still being served, so I updated to the aggressive installation. Ads continue to be served, with ytadsblocker.log returning " No new subdomains to added."
ubuntu 22 with Pi-hole v5.14.2 FTL v5.20 Web Interface v5.18 gives me error it doesn't install correctly
https://prnt.sc/dq-Bfj9ByB1h
Desde hace un tiempo he investigado pihole, es posible realizar un sistema de limpieza publicitario completo mediante DNS? es decir la raspberry abre la pΓ‘gina la limpia con Ublock y reenvia el html al dispositivo?
Worked well for a couple hours, now I cannot use this method :( I like this script you have made though! How would I get this to work?
Hi Dev
First thank you for your amazing project. I have tried and working fine on cenos7 with pihole v5.3.1 installed. But only for script ytadsblocker_legacy.sh, also for script ytadsblocker.sh service error. If you have time, you can check it out a bit. And I also see some problems with youtube ads. You can consider fixing that problem by changing blocking mode on pihole http https ssl response statuscode 200, which in my opinion would be better. Skipping ads will be faster, avoiding the error of being stuck where ads can appear. Finally thank you very much
Hi,
I follow the guide but the service is not active as below
[i] Youtube Ads Blocker will be installed.
Log file: /var/log/ytadsblocker.log
Subdomains added to: /etc/pihole/gravity.db
[i] If you move the script to a different place, please execute it again with the option 'install'
[i] Installing the service...OK. Service installed.
[i] Configuring the database: /etc/pihole/gravity.db ...
[i] Searching for googlevideo.com subdomains...
[w] No subdomains to add at the moment.
[i] Deleting temp...OK. Temp deleted.
[β] Youtube Ads Blocker: INSTALLED...
[i] To start the service execute as follows: systemctl start ytadsblocker
[i] Enabling the service to start it automatically with the OS.OK.
root@raspberrypi:~/ytadsblocker# systemctl start ytadsblocker
root@raspberrypi:~/ytadsblocker# service ytadsblocker status
β ytadsblocker.service - Youtube ads blocker service for Pi-hole
Loaded: loaded (/lib/systemd/system/ytadsblocker.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Wed 2021-10-13 10:38:32 BST; 30s ago
Process: 12207 ExecStart=/root/ytadsblocker/ytadsblocker.sh start (code=exited, status=0/SUCCESS)
Process: 12217 ExecStop=/root/ytadsblocker/ytadsblocker.sh stop (code=exited, status=0/SUCCESS)
Main PID: 12207 (code=exited, status=0/SUCCESS)
Oct 13 10:38:31 raspberrypi systemd[1]: Started Youtube ads blocker service for Pi-hole.
Oct 13 10:38:31 raspberrypi ytadsblocker.sh[12207]: That option does not exists. Usage: ./ytadsblocker.sh -a [ install ( -m aggressive
Oct 13 10:38:32 raspberrypi ytadsblocker.sh[12217]: That option does not exists. Usage: ./ytadsblocker.sh -a [ install ( -m aggressive
Oct 13 10:38:32 raspberrypi systemd[1]: ytadsblocker.service: Succeeded.
Installed Pi-hole V6 Beta Testing. Bare metal, not docker.
Today updated and ytadsblocker does not work any more:
Error: stepping, UNIQUE constraint failed: group.name (19)
Tried to reinstall ytadsblocker.
All blocked domains dissapeared from the database. And does not shows the ytadsblocker group.
./ytadsblocker.sh: line 139: echo: write error: No space left on device
I tried to install it, but why is there a statement that there is no memery available, even though there are still 5GB more free space on my device.
Whenever I run the service, it will fail after a while. Sometimes it runs for 30 minutes sometimes it stops immediately after starting the service. But I can't really figure out, why that happens. I always get the error message:
Jul 02 17:13:06 homebridge systemd[1]: ytadsblocker.service: Main process exited, code=exited, status=5/NOTINSTALLED
Jul 02 17:13:06 homebridge systemd[1]: ytadsblocker.service: Failed with result 'exit-code'.
I appreciate any help I can get.
Hi
Script was worink well in Docker no I getthe following Error :
Reinstalling the service..../ytadsblocker.sh: line 223: systemctl: command not found
I was not able to fix it
root@pihole:/ytadsblocker# ./ytadsblocker.sh -a install
./ytadsblocker.sh -a start &
\ / / __ / / / /_ / / / / __ )/ / / | / __ / /
\ / / / / / / / / / / / / / __ / _/ / /| | / / / /_ \
/ / // / // / / / / // / // / / / ___ |/ // // /
//_/_/ ____ _____________________ |/_____///
/ __ )/ / / __ / / //// / __ \
/ __ / / / / / / / / ,< / __/ / // /
/ // / // // / // /| |/ // _, _/
///_/_// |/_____// || v3.7.3 by @deividgdt
[i] Youtube Ads Blocker will be installed.
Log file: /var/log/ytadsblocker.log
Subdomains added to: /etc/pihole/gravity.db
[w] Youtube Ads Blocker already installed...
[i] Reinstalling the service..../ytadsblocker.sh: line 223: systemctl: command not found
[3] 6812
root@pihole:/ytadsblocker# Youtube Ads Blocker Started
Check the /var/log/ytadsblocker.log file to get further information.
Many thanks fr your help
I'm using pi hole dockerized version as I have several docker containers in my Raspberry. How do I run this script? from outside the container? should I enter the container and execute the script?
I've tried reading the source code but still, I cannot guess what to do.
Thanks!
Hi!!
I would like to automate the installation of this amazing tool but I've found I can not do it because the install process will stop waiting for the response about "[i] Do you want to activate the aggressive mode? be careful, Youtube could stop working (Y/N): " indefinitely...
Is there any possibility the answer for that can be sent as a parameter to the install command?
Or is there any way I can bypass it and give a default value?
Please change egrep wtih grep -E . On Arch linux i have made this self:
--- ytadsblocker.sh_orig 2024-07-29 15:37:37.160320989 +0200
+++ ytadsblocker.sh 2024-07-29 15:38:09.187105799 +0200
@@ -170,10 +170,10 @@
done
echo "[$(date "+%F %T")] Searching Googlevideo's subdomains in the logs..." >> ${YTADSBLOCKER_LOG}
- ALL_DOMAINS=$(cat ${TEMPDIR}/pihole.log* | egrep --only-matching "${PATTERN}" | sort | uniq)
+ ALL_DOMAINS=$(cat ${TEMPDIR}/pihole.log* | grep -E --only-matching "${PATTERN}" | sort | uniq)
if [ ! -z "${ALL_DOMAINS}" ]; then
- N_DOM=$(cat ${TEMPDIR}/pihole.log* | egrep --only-matching "${PATTERN}" | sort | uniq | wc --lines)
+ N_DOM=$(cat ${TEMPDIR}/pihole.log* | grep -E --only-matching "${PATTERN}" | sort | uniq | wc --lines)
echo "[$(date "+%F %T")] We have found $N_DOM subdomain/s..." >> ${YTADSBLOCKER_LOG}
for YTD in $ALL_DOMAINS; do
echo "[$(date "+%F %T")] Adding the subdomain: ${YTD}" >> ${YTADSBLOCKER_LOG}
@@ -247,7 +247,7 @@
while true; do
echo "[$(date "+%F %T")] Checking ${PI_LOG}..." >> ${YTADSBLOCKER_LOG}
- YT_DOMAINS=$(cat ${PI_LOG} | egrep --only-matching "${PATTERN}" | sort | uniq)
+ YT_DOMAINS=$(cat ${PI_LOG} | grep -E --only-matching "${PATTERN}" | sort | uniq)
NEW_DOMAINS=
CHECK_NEW_DOMAIN=
@@ -333,7 +333,7 @@
function VersionChecker() {
- NEW_VERSION=$(curl --http1.0 --silent $YTADSBLOCKER_GIT | egrep --line-regexp "YTADSBLOCKER_VERSION=\"[1-9]{1,2}\.[0-9]{1,2}\"" | cut --fields=2 --delimiter="=" | sed 's,",,g')
+ NEW_VERSION=$(curl --http1.0 --silent $YTADSBLOCKER_GIT | grep -E --line-regexp "YTADSBLOCKER_VERSION=\"[1-9]{1,2}\.[0-9]{1,2}\"" | cut --fields=2 --delimiter="=" | sed 's,",,g')
if [[ "${YTADSBLOCKER_VERSION}" != "${NEW_VERSION}" ]]; then
echo "[$(date "+%F %T")] There is a new version: ${NEW_VERSION}. Current version: ${YTADSBLOCKER_VERSION}" >> ${YTADSBLOCKER_LOG}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.