Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding EXCLUDE_CATEGORIES environment variable #26

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions PlutoIPTV/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ if (process.argv[2]) {
versions = versions.concat(process.argv[2].split(","));
}

let excludedCategories = []
if (process.env.EXCLUDE_CATEGORIES) {
excludedCategories = process.env.EXCLUDE_CATEGORIES.split(",")
}

const plutoIPTV = {
grabJSON: function (callback) {
callback = callback || function () {};
Expand Down Expand Up @@ -330,7 +335,10 @@ function processChannels(version, list) {
channels.forEach((channel) => {
let deviceId = uuid1();
let sid = uuid4();
if (

if (excludedCategories.includes(channel.category)) {
console.log(`[DEBUG] Skipping channel ${channel.name} from excluded category '${channel.category}'`);
} else if (
channel.isStitched &&
!channel.slug.match(/^announcement|^privacy-policy/)
) {
Expand Down Expand Up @@ -380,9 +388,9 @@ function processChannels(version, list) {
${m3uUrl}

`;
console.log("[INFO] Adding " + channel.name + " channel.");
console.log("[INFO] Adding " + channel.name + " channel");
} else {
console.log("[DEBUG] Skipping 'fake' channel " + channel.name + ".");
console.log("[DEBUG] Skipping 'fake' channel " + channel.name);
}
});

Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@ Simpley provide a comma separated list of words without spaces with the `VERSION

docker run -d --restart unless-stopped --name pluto-for-channels -p 8080:80 -e VERSIONS=Dad,Bob,Joe jonmaddox/pluto-for-channels

### Optionally exclude channel categories

By using the `EXCLUDE_CATEGORIES` environment variable when starting the docker container,
you can tell it to exclude channel categories from the .m3u

Provide a comma separated list of categories:

EXCLUDE_CATEGORIES=Kids,En Español,Music,Gaming + Anime

If running via docker on the command line:

docker run -d --restart unless-stopped --name pluto-for-channels -p 8080:80 -e "EXCLUDE_CATEGORIES=Kids,En Español,Music,Gaming + Anime" jonmaddox/pluto-for-channels


## Add Source to Channels

Expand Down