kboghdady / youTube_ads_4_pi-hole

YouTube script to add the new Ads list for Pi-hole
2.45k stars 266 forks source link

Initial Run #56

Closed ashleycawley closed 4 years ago

ashleycawley commented 4 years ago

Is it normal for the first run of the script to take ages? Is the first run the slowest and then subsequent runs then a lot faster?

Admitedly I know I'm running on it on a slow system (Raspberry Pi B from 2011 - 700MHz CPU) but it seems to run DietPi + PiHole nicely.

It has been running for close to an hour now, I cancelled it a while ago because I convinced myself it had got in a never ending loop, however after re-running I don't think that was the case because now I'm seeing lots of "... already exists in blacklist, no need to add!" so I'm guessing I've only slow things down.

I'd be intregued to know the answer to my question at the top though.

Thanks for all of your time and efforts on this wonderful project.

denzfarid commented 4 years ago

@ashleycawley yes, because for 1st run, this script add blocklist from this file https://github.com/kboghdady/youTube_ads_4_pi-hole/blob/master/youtubelist.txt

if you run it manualy and cancel, maybe some list in file youtubelist.txt already insert to database (sqlite)

use crontab for update, i run crontab every midnight for updated list, because this file (auto update) every day https://github.com/kboghdady/youTube_ads_4_pi-hole/blob/master/youtubelist.txt

dnt forget add pihole -g ; sudo pihole restartdns in youtube.sh see https://github.com/kboghdady/youTube_ads_4_pi-hole/issues/46

ashleycawley commented 4 years ago

Thanks for the heads-up.

I understood that it would be adding all of those lines to the blacklist and I appreciate that file is 22,904 lines in length, just what I didn't expect is that it would take in excess of 1 hour for it to add those enteries into the blacklist.

If this is the case on some systems I think the read me should be adjusted so that it does not recommend entering in a cron-task for every hour as that would be too frequent and the previous task wouldn't have finished in time (certainly not in case I'm witnessing).

If there was a plain-text pihole blacklist file which could simply be appended to, it shouldn't take anywhere near that long, although I appreciated duplicates would need to be checked for.

Why is it slow to work, does the pihole -b -nr command itself introduce some delay?

Your suggestion of running it just once a day sounds like a good idea.

dnt forget add pihole -g ; sudo pihole restartdns in youtube.sh

Is that still required? I notice on line 38 of youtube.sh currently it has: sudo pihole restartdns

If that isn't suffecient then why hasn't it been adjusted yet?

What does: pihole -g ; sudo pihole restartdns do?

Thanks for your time and help.

kboghdady commented 4 years ago

hi @ashleycawley
running with old pi definitely is an issue. I would suggest not to use the youtube.sh, and start using the black.list file to be added to your gravity list and have a cron job to update the list using pihole -g