Add config for twitch client ID

This commit is contained in:
Calvin Montgomery 2016-09-18 21:35:08 -07:00
parent edff85dfb0
commit 83987afd73
3 changed files with 17 additions and 2 deletions

View file

@ -243,3 +243,7 @@ channel-storage:
service-socket:
enabled: false
socket: 'service.sock'
# Twitch Client ID for the data API (used for VOD lookups)
# https://github.com/justintv/Twitch-API/blob/master/authentication.md#developer-setup
twitch-client-id: null

View file

@ -2,7 +2,7 @@
"author": "Calvin Montgomery",
"name": "CyTube",
"description": "Online media synchronizer and chat",
"version": "3.21.3",
"version": "3.21.4",
"repository": {
"url": "http://github.com/calzoneman/sync"
},

View file

@ -123,7 +123,8 @@ var defaults = {
},
"google-drive": {
"html5-hack-enabled": false
}
},
"twitch-client-id": null
};
/**
@ -379,6 +380,16 @@ function preprocessConfig(cfg) {
"information on registering an API key.");
}
if (cfg["twitch-client-id"]) {
require("cytube-mediaquery/lib/provider/twitch-vod").setClientID(
cfg["twitch-client-id"]);
} else {
Logger.errlog.log("Warning: No Twitch Client ID set. Twitch VOD links will " +
"not work. See twitch-client-id in config.template.yaml and " +
"https://github.com/justintv/Twitch-API/blob/master/authentication.md#developer-setup" +
"for more information on registering a client ID");
}
return cfg;
}