mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-13 15:06:59 +03:00
19 lines
471 B
JavaScript
19 lines
471 B
JavaScript
var config = require('../config.js');
|
|
|
|
// YouTube API
|
|
const YouTubeAPI = require("youtube-api");
|
|
|
|
var exportObject;
|
|
// If in test mode, return a mocked youtube object
|
|
// otherwise return an authenticated youtube api
|
|
if (config.mode === "test") {
|
|
exportObject = require("../../test/youtubeMock.js");
|
|
} else {
|
|
YouTubeAPI.authenticate({
|
|
type: "key",
|
|
key: config.youtubeAPIKey
|
|
});
|
|
exportObject = YouTubeAPI;
|
|
}
|
|
|
|
module.exports = exportObject; |