deividgdt / ytadsblocker

YTadsblocker is a script to block all the Youtube's advertisement in Pi-Hole
GNU General Public License v3.0
89 stars 12 forks source link

Service is not scanning domains #17

Closed diepnt90 closed 2 years ago

diepnt90 commented 2 years ago

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.
diepnt90 commented 2 years ago

after reinstalling, it could detect ads but after 1 hour after i watched youtube, no more domains of ads were added

[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... [i] Inserting subdomain: r1.sn-42u-i5oel.googlevideo.com [i] Inserting subdomain: r1.sn-42u-i5ol6.googlevideo.com [i] Inserting subdomain: r2.sn-42u-i5old.googlevideo.com [i] Inserting subdomain: r2.sn-42u-i5ole.googlevideo.com [i] Inserting subdomain: r3.sn-42u-i2is.googlevideo.com [i] Inserting subdomain: r3.sn-42u-i5ol7.googlevideo.com [i] Inserting subdomain: r4.sn-42u-i5oe7.googlevideo.com [i] Inserting subdomain: r4.sn-42u-i5oer.googlevideo.com [i] Inserting subdomain: r5.sn-42u-i5ol6.googlevideo.com [i] Inserting subdomain: r5.sn-42u-i5old.googlevideo.com [i] Inserting subdomain: r6.sn-42u-i2is.googlevideo.com [i] Inserting subdomain: r6.sn-42u-i5ole.googlevideo.com [i] Inserting subdomain: r6.sn-42u-i5olz.googlevideo.com [i] Inserting subdomain: r7.sn-42u-i5oee.googlevideo.com [i] Inserting subdomain: r8.sn-42u-i5oe7.googlevideo.com [i] Wait until we update gravity................... Done. [✓] OK. 15 subdomains added [i] Deleting temp...OK. Temp deleted. [✓] Youtube Ads Blocker: INSTALLED...

diepnt90 commented 2 years ago

hmm no more videos were added :(

tail -f /var/log/ytadsblocker.log [2021-10-13 14:37:14] Adding the subdomain: r4.sn-42u-i5oe7.googlevideo.com [2021-10-13 14:37:15] Adding the subdomain: r4.sn-42u-i5oer.googlevideo.com [2021-10-13 14:37:15] Adding the subdomain: r5.sn-42u-i5ol6.googlevideo.com [2021-10-13 14:37:15] Adding the subdomain: r5.sn-42u-i5old.googlevideo.com [2021-10-13 14:37:15] Adding the subdomain: r6.sn-42u-i2is.googlevideo.com [2021-10-13 14:37:15] Adding the subdomain: r6.sn-42u-i5ole.googlevideo.com [2021-10-13 14:37:15] Adding the subdomain: r6.sn-42u-i5olz.googlevideo.com [2021-10-13 14:37:15] Adding the subdomain: r7.sn-42u-i5oee.googlevideo.com [2021-10-13 14:37:15] Adding the subdomain: r8.sn-42u-i5oe7.googlevideo.com [2021-10-13 14:37:42] Youtube Ads Blocker has been installed. Welcome!

So I uninstalled and reinstall and could see it scanned and added more domains. it means that this service does not scan frequently :(

HugoFroh commented 2 years ago

Hello diepnt90, I had the same problem, but I found a solution. After the installation, go to the file "/lib/systemd/system/ytadsblocker.service" as root and add the parameter "-a" in the call to ytadsblocker.sh. Check whether the change has also been adopted in the file. Reboot the system. Otherwise ytadsblocker.service will not be started. I have attached the picture before and after before . after Check if the service runs with "systemctl status ytadsblocker" Should look like this: service I wish you success.

deividgdt commented 2 years ago

Hi @HugoFroh,

I've made the change that you suggested. The script is now working.

Version 3.7.3 has been released.

Thanks

deividgdt commented 2 years ago

I'm closing this issue. Thanks to everyone!

diepnt90 commented 2 years ago

Thank you all @deividgdt @HugoFroh