Skip to content

Commit ee983a9

Browse files
fix: yt OAuth class not found, credentialManager being undefinded
1 parent 1593394 commit ee983a9

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,7 +1566,14 @@ import WorkerManager from './managers/workerManager.js'
15661566

15671567
if (clusterEnabled && cluster.isPrimary) {
15681568
if (config.sources?.youtube?.getOAuthToken) {
1569+
// dynamicly import OAuth (if enabled)
1570+
const OAuth = (await import('./sources/youtube/OAuth.js').catch((e) => {
1571+
logger('error', 'youtube', `\x1b[1m\x1b[31mOAuth class not found Error: ${e.message}\x1b[0m`)
1572+
process.exit(1)
1573+
})).default
1574+
15691575
const mockNodelink = { options: config }
1576+
mockNodelink.credentialManager = new CredentialManager(mockNodelink)
15701577
const validator = new OAuth(mockNodelink)
15711578
await validator.validateCurrentTokens()
15721579

0 commit comments

Comments
 (0)