gatecrasher777/ytcog

debug logs will be logged on console even though debug mode was set the "false"

gaojie429 opened this issue · 5 comments

As the title says, I can't disable debug log. It happened after I update ytcog to v2.3.1.

For most objects <object>.debugOn = 'false'; is the default state, so you should not have to set it unless you want debug info.

Download in index.js is the only pseudo object that writes directly to console (with download progress) without any reference to debug. Perhaps that is an issue. If so, I can make those console writes subject to the debug parameter as well.

Any more information on this? I can only replicate when using ytcog.dl() method, in which case, the console logs are intended.

Yes, I use exactly ytcog.dl() to get videos.
I didn't know this console log was intended.

Well then, how can I disable console log?
debug : false didn't work for me in this version.

Here is my code.

let options = {
  id: '<ID>',
  path: '<PATH>',
  filename: 'temp',
  container: 'mp4',
  videoQuality: 'none',
  audioQuality: 'highest',
  mediaBitrate: 'highest',
  videoFormat: -1,
  audioFormat: -1,
  metadata: 'author,title,published',
  overwrite: 'yes',
}
await ytcog.dl(options);```

To download silently:

        const ytcog = require('ytcog');

	const session = new ytcog.Session();
        await session.fetch();
        const video = new ytcog.Video(session, { 
             id: '<ID>',
             path: '<PATH>',
             filename: 'temp',
             container: 'mp4',
             videoQuality: 'none',
            audioQuality: 'highest',
            mediaBitrate: 'highest',
            videoFormat: -1,
            audioFormat: -1,
            metadata: 'author,title,published',
            overwrite: 'yes',
	});
	await video.download();

I could download videos without any log using this code.
Thank you!