# How to add blacklists from a file

**URL:** <https://discourse.pi-hole.net/t/how-to-add-blacklists-from-a-file/32221>\
**Category:** Help\
**Tags:** v5-0\
**Created:** [May 13, 2020, 2:26am UTC](https://discourse.pi-hole.net/t/how-to-add-blacklists-from-a-file/32221 "2020-05-13T02:26:18Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)\
**Post date:** [May 13, 2020, 3:17am UTC](https://discourse.pi-hole.net/t/how-to-add-blacklists-from-a-file/32221/7 "2020-05-13T03:17:19Z")

</div>

> [@MichaelTheCoder](#):
>
> it will output a list of urls

These are not URL's, these are domains. Let's take a look at what constitutes a URL:

`https://cnn.com/electionresults/index/2020`

_ **https** _ is the protocol

_ **`cnn.com`** _ is the domain

_ **everything after that** _ is a path on the domain.

In your list, everything is a domain, and these would be added to the blacklist.

```auto
r2---sn-ni5f-ttjz.googlevideo.com
r4---sn-vgqsknlz.googlevideo.com
r1---sn-ni5f-ttjs.googlevideo.com
r4---sn-ni5f-ttjz.googlevideo.com
r3---sn-ni5f-ttjz.googlevideo.com
r2---sn-ni5f-ttjs.googlevideo.com
r1---sn-ni5f-ttjz.googlevideo.com
r3---sn-ni5f-ttjs.googlevideo.com
r4---sn-ni5f-ttjs.googlevideo.com

```

> [@MichaelTheCoder](#):
>
> I want to add these domains into the blacklist using a script or cron, but I don't know how to write one.

Your best approach might be to use something that already works with Pi-hole V5. This thread may be of interest:

> [@YouTube script seems to be working very well](https://discourse.pi-hole.net/t/youtube-script-seems-to-be-working-very-well/31316):
>
> (copy of my original [Reddit post here](https://www.reddit.com/r/pihole/comments/g9ytt9/youtube_some_success_ymmv_please_test/)) After a day and a half or so of running, the auto-populated list is at 122 hostnames and the number of ads I have see I can count on one hand. Only one since this morning and YouTube has been running all day. You may well see ads appear, but if they are from a new googlevideo hostname, it will be added to the list when you run the script again. Mine is cron'd to run every few minutes and has been working well. [original post] A year and a half ago I [mad…](https://www.reddit.com/r/pihole/comments/9w5swx/i_think_ive_managed_to_block_youtube_ads_with/)

---

_[View the full topic](https://discourse.pi-hole.net/t/how-to-add-blacklists-from-a-file/32221)._
