fent / node-ytdl-core

YouTube video downloader in javascript.
MIT License
4.51k stars 798 forks source link

The YouTube API key you provided was not a string. error please help #865

Closed Pad-Design closed 3 years ago

Pad-Design commented 3 years ago
    if (typeof key !== 'string') throw new Error('The YouTube API key you provided was not a string.');
                                 ^

Error: The YouTube API key you provided was not a string. at new YouTube (C:\Users\krmme\Desktop\muzuklu pee7\node_modules\simple-youtube-api\src\index.js:26:44) at Object. (C:\Users\krmme\Desktop\muzuklu pee7\komutlar\muzuk-yardim.js:6:17) at Module._compile (node:internal/modules/cjs/loader:1102:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1131:10) at Module.load (node:internal/modules/cjs/loader:967:32) at Function.Module._load (node:internal/modules/cjs/loader:807:14) at Module.require (node:internal/modules/cjs/loader:991:19) at require (node:internal/modules/cjs/helpers:92:18) at Object. (C:\Users\krmme\Desktop\muzuklu pee7\bot.js:522:19) at Module._compile (node:internal/modules/cjs/loader:1102:14)

Svallinn commented 3 years ago

That's not at all related to this library. Please read the stacktrace properly before making an issue. at new YouTube (C:\Users\krmme\Desktop\muzuklu pee7\node_modules\simple-youtube-api\src\index.js:26:44)

redbrain commented 3 years ago

As Synkky was saying, that's not a problem with ytdl-core, but rather with simple-youtube-api. To fix the error, make sure you're passing that library a valid API key. Alternately, change your code to use ytpl or ytsr, some API-key-less libraries for basic functions like searches or playlist parsing

Pad-Design commented 3 years ago

i have already writed my api-key correctly, also i tried regenerated.

redbrain commented 3 years ago

This is not an issue with ytdl-core, so don't expect to receive further support for it in this issue. If you'd like general JS support, consider joining our chat server.