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: service-socket:
enabled: false enabled: false
socket: 'service.sock' 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", "author": "Calvin Montgomery",
"name": "CyTube", "name": "CyTube",
"description": "Online media synchronizer and chat", "description": "Online media synchronizer and chat",
"version": "3.21.3", "version": "3.21.4",
"repository": { "repository": {
"url": "http://github.com/calzoneman/sync" "url": "http://github.com/calzoneman/sync"
}, },

View File

@ -123,7 +123,8 @@ var defaults = {
}, },
"google-drive": { "google-drive": {
"html5-hack-enabled": false "html5-hack-enabled": false
} },
"twitch-client-id": null
}; };
/** /**
@ -379,6 +380,16 @@ function preprocessConfig(cfg) {
"information on registering an API key."); "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; return cfg;
} }