YouTube.js icon indicating copy to clipboard operation
YouTube.js copied to clipboard

[ 2.0.0 ]: InnerTubeError : SimpleCardContent not found

Open USERSATOSHI opened this issue 2 years ago • 0 comments

Steps to reproduce

import InnerTube from "youtubei.js";
const client = await InnerTube.default.create();

import { createWriteStream, writeFileSync } from "fs";

const p = await client
    .getPlaylist( "PL9D0yESpQWpZ3BemclNFXnBrMmrdsXrrG" );

p.videos.forEach(async  x =>
{
    const id = x.id;
    console.log(x.title)
    writeFileSync( id + ".mp3", "" );
    const ws = createWriteStream( id + ".mp3" );
    const stream = await client.download(id,{type:"audio"});
    stream.pipe( ws );

})

this is the basic code i came up with for reproducing this error

Failure Logs

InnertubeError: SimpleCardContent not found!
This is a bug, please report it at https://github.com/LuanRT/YouTube.js/issues
    at Function.formatError (d:\projects-next\mediaplayer\node_modules\youtubei.js\dist\src\parser\index.js:260:33)
    at Function.parseItem (d:\projects-next\mediaplayer\node_modules\youtubei.js\dist\src\parser\index.js:214:22)
    at Function.parse (d:\projects-next\mediaplayer\node_modules\youtubei.js\dist\src\parser\index.js:256:53)
    at new Card (d:\projects-next\mediaplayer\node_modules\youtubei.js\dist\src\parser\classes\Card.js:12:40)
    at Function.parseItem (d:\projects-next\mediaplayer\node_modules\youtubei.js\dist\src\parser\index.js:209:32)
    at Function.parse (d:\projects-next\mediaplayer\node_modules\youtubei.js\dist\src\parser\index.js:245:37)
    at new CardCollection (d:\projects-next\mediaplayer\node_modules\youtubei.js\dist\src\parser\classes\CardCollection.js:12:38)
    at Function.parseItem (d:\projects-next\mediaplayer\node_modules\youtubei.js\dist\src\parser\index.js:209:32)
    at Function.parseResponse (d:\projects-next\mediaplayer\node_modules\youtubei.js\dist\src\parser\index.js:160:27)
    at new VideoInfo (d:\projects-next\mediaplayer\node_modules\youtubei.js\dist\src\parser\youtube\VideoInfo.js:68:38) {
  info: {
    image: { thumbnails: [Array] },
    title: { simpleText: 'キツネノマド (Queen Fox)' },
    actionButton: { simpleCardButtonRenderer: [Object] },
    trackingParams: 'CCEQ1TYiEwjh-O6WmKv5AhV3_TgGHeOlAmE=',
    displayDomain: { simpleText: 'youtube.com' },
    showLinkIcon: true,
    callToAction: { simpleText: 'Click HERE!' },
    command: {
      clickTrackingParams: 'CCEQ1TYiEwjh-O6WmKv5AhV3_TgGHeOlAmEyBWNhcmRz',
      commandMetadata: [Object],
      urlEndpoint: [Object]
    }
  },
  date: 2022-08-03T17:24:54.905Z,
  version: '2.0.0'
}

Expected behavior

expected the function to save audio in file

Current behavior

InnertubeError: SimpleCardContent not found!

Version

Edge

Anything else?

image

Checklist

  • [X] I am running the latest version.
  • [X] I checked the documentation and found no answer.
  • [X] I have searched the existing issues and made sure this is not a duplicate.
  • [X] I have provided sufficient information.

USERSATOSHI avatar Aug 03 '22 17:08 USERSATOSHI