@DL6ER
Yes, I've tried it. The run command did not work proberly.
I was able to create the .sh install script, but the run command failed. I'm using Mac OS Terminal and connect to the Pi via ssh. This is, what it says:
"root@raspberrypi:~# chmod +x /etc/pihole/youtube-adblock-install.sh
root@raspberrypi:~# run /etc/pihole/youtube-adblock-install.sh
-bash: run: Kommando nicht gefunden."
The third line means "-bash: run: Did not find command."
Awesome script, when I run it I get this error on the youtube-ads.sh
Blockquote
syntax error at -e line 1, at EOF
Missing right curly or square bracket at -e line 1, at end of line
Execution of -e aborted due to compilation errors.
Is there a mistake in /etc/pihole/youtube-ads.sh ?
Line 10: grep r*.googlevideo.com /var/log/pihole.log | awk '{print }'| grep -v '^googlevideo.com\|redirector' | sort -nr | uniq >> /var/www/html/youtube-ads-list.txt
Isn't anything missing after the awk'{print }'? Because it pastes the whole log there and not just the hostnames.
My idea was to just add the "$6" so it takes the hosts: grep r*.googlevideo.com /var/log/pihole.log | awk '{print$6}'| grep -v '^googlevideo.com\|redirector' | sort -nr | uniq >> /var/www/html/youtube-ads-list.txt
This is the original line from the script, but since the $ aren't escaped, the echo command tries to evaluate them. In short, the script line should be
Something I found out:
It works on PC, but the YouTube-App on my iPhone doesn't work anymore (doesn't load any video).
I think the App can't handle not avaiable ads.
Huh, I'm on raspbian also. Maybe you used single quotes? Or maybe a paste messed something up when I went though it the other day...that's probably the most likely reason.
I found the same problem, though, where it doesn't work for mobile devices...ended up disabling it all since I already have a browser extension that handles it on PC. Wish I had more time to dig into it.
I do get the following error:
Traceback (most recent call last):
File "/etc/dnsdumpster/dnsdumpster/ADS_youtube.py", line 35, in
print("\n\n\nRetrieved XLS hosts? {} (accessible in 'xls_data')".format(xls_retrieved))
NameError: name 'xls_retrieved' is not defined
I made the adjustments @idgers suggested:
changed the following lines:
echo "perl -i -ne 'print if ! $x{$_}++' /var/www/html/youtube-ads-list.txt" >> /etc/pihole/youtube-ads.sh
echo "grep r*.googlevideo.com /var/log/pihole.log | awk '{print $6}'| grep -v '^googlevideo.com|redirector' | sort -nr | uniq >> /var/www/html/youtube-ads-list.txt" >> /etc/pihole/youtube-ads.sh
so, i remember fixing something, but unsure now what
but you are welcome to my copy of dnsdumpster folder ... getting an error from dnsdumpster site (but it happens if you go to dnsdumpster and query googlevideo.com regardless)