Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InnertubeError: Something went wrong at VideoDescriptionInfocardsSection! #426

Closed
4 tasks done
chen-rn opened this issue Jul 3, 2023 · 4 comments · Fixed by #428
Closed
4 tasks done

InnertubeError: Something went wrong at VideoDescriptionInfocardsSection! #426

chen-rn opened this issue Jul 3, 2023 · 4 comments · Fixed by #428
Labels
bug Something isn't working

Comments

@chen-rn
Copy link

chen-rn commented Jul 3, 2023

Steps to reproduce

i am calling an endpoint to get the user's uploaded videos like follows


		const c = await innerTube.getChannel(channelId)
		const url = c.metadata.vanity_channel_url
		console.log(url)

		const endpoint = await innerTube.resolveURL(`${url}/videos`)
		const page_data_raw = await innerTube.call(endpoint)

		const videoIds =
			page_data_raw.data.contents.twoColumnBrowseResultsRenderer.tabs[1].tabRenderer.content.richGridRenderer.contents
				.filter((content) => {
					return content.richItemRenderer
				})
				.map((content) => {
					return content.richItemRenderer.content.videoRenderer.videoId
				})

		// Transform the videos into the desired format
		return Promise.all(
			videoIds.map(async (videoId) => {
				// Get the basic info for the video
				const videoInfo = await innerTube.getInfo(videoId)
                                   ...

Failure Logs

InnertubeError: Something went wrong at VideoDescriptionInfocardsSection!
This is a bug, please report it at https://github.com/LuanRT/YouTube.js/issues
    at Parser._Parser_printError (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:9945:16)
    at Parser.parseItem (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:9790:89)
    at Parser.parseArray (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:9800:29)
    at new StructuredDescriptionContent (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:4954:33)
    at Parser.parseItem (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:9786:24)
    at new EngagementPanelSectionList (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:4966:36)
    at Parser.parseItem (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:9786:24)
    at /Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:9753:25
    at Array.map (<anonymous>)
    at Parser.parseResponse (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:9752:100) {
  info: {
    stack: 'Error: Type mismatch, got VideoDescriptionInfocardsSection but expected one of VideoDescriptionHeader, ExpandableVideoDescriptionBody, VideoDescriptionMusicSection\n' +
      '    at Parser.parseItem (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:9782:21)\n' +
      '    at Parser.parseArray (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:9800:29)\n' +
      '    at new StructuredDescriptionContent (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:4954:33)\n' +
      '    at Parser.parseItem (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:9786:24)\n' +
      '    at new EngagementPanelSectionList (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:4966:36)\n' +
      '    at Parser.parseItem (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:9786:24)\n' +
      '    at /Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:9753:25\n' +
      '    at Array.map (<anonymous>)\n' +
      '    at Parser.parseResponse (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:9752:100)\n' +
      '    at new MediaInfo (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:12003:144)'
  },
  date: 2023-07-03T08:20:31.292Z,
  version: '5.2.0'
}

Expected behavior

it seems like everything is functional, but the error said to report to the issue

Current behavior

it's functional

Version

Default

Anything else?

version: '5.2.0'

Checklist

  • I am running the latest version.
  • I checked the documentation and found no answer.
  • I have searched the existing issues and made sure this is not a duplicate.
  • I have provided sufficient information.
@chen-rn chen-rn added the bug Something isn't working label Jul 3, 2023
@LuanRT
Copy link
Owner

LuanRT commented Jul 3, 2023

Just a tip, you don't have to parse the InnerTube response yourself. Simply change that Innertube#call line to Innertube.call(endpoint, { parse: true }); and then you'll have an easier time getting specific nodes.

Actually, the library supports fetching any tab from any page, including the channel one. So the entirety of that code could be rewritten as follows:

const channel = await innertube.getChannel(channelId);
const videos_tab = await channel.getVideos();

const videoIds = video_tab.videos.map((video) => video.id);

// ...

See: https://github.com/LuanRT/YouTube.js#getchannelid

@chen-rn
Copy link
Author

chen-rn commented Jul 3, 2023

gotchaa! thank you!

@chen-rn
Copy link
Author

chen-rn commented Jul 5, 2023

note!

I saw that the VideoDescriptionInfo... one is fixed, there seems to a similar bug at CommentSimpleBox

InnertubeError: Something went wrong at CommentsSimplebox!
This is a bug, please report it at https://github.com/LuanRT/YouTube.js/issues
    at Parser._Parser_printError (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:9964:16)
    at Parser.parseItem (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:9809:89)
    at new CommentsEntryPointHeader (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:4274:47)
    at Parser.parseItem (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:9805:24)
    at Parser.parseArray (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:9819:29)
    at new ItemSection (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:5755:36)
    at Parser.parseItem (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:9805:24)
    at Parser.parseArray (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:9819:29)
    at new TwoColumnWatchNextResults (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:8713:35)
    at Parser.parseItem (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:9805:24) {
  info: {
    stack: 'Error: Type mismatch, got CommentsSimplebox but expected CommentsEntryPointTeaser\n' +
      '    at Parser.parseItem (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:9803:19)\n' +
      '    at new CommentsEntryPointHeader (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:4274:47)\n' +
      '    at Parser.parseItem (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:9805:24)\n' +
      '    at Parser.parseArray (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:9819:29)\n' +
      '    at new ItemSection (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:5755:36)\n' +
      '    at Parser.parseItem (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:9805:24)\n' +
      '    at Parser.parseArray (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:9819:29)\n' +
      '    at new TwoColumnWatchNextResults (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:8713:35)\n' +
      '    at Parser.parseItem (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:9805:24)\n' +
      '    at Parser.parse (/Users/chenwang/Documents/projects/sekai-node/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:9846:39)'
  },
  date: 2023-07-05T01:49:01.582Z,
  version: '5.2.1'
}

@LuanRT
Copy link
Owner

LuanRT commented Jul 5, 2023

@chen-rn
Feel free to open a new issue for that one! These warnings almost always never cause any actual problem, it's just the parser reporting that YouTube may or may not have changed something (or that we messed up, which was the case for the previous one :)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants