Skip to content

Can't get video info even passed with cookie #1009

@noobSam1122

Description

@noobSam1122

Question

I want to get the info of the member-only video and I followed the doc to get the cookie and pass it to Innertube, the result is saying I don't have permission and most of the value are undefined

Other details

env: nodejs v20.12.2
os: windows 10

const { Innertube } = require('youtubei.js');
const { inspect } = require('util');
async function test() {
    const innertube = await Innertube.create({
        user_agent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36',
        client_type: 'iOS',
        cookie:`<MY_COOKIE>`
    });
    const videoInfo = await innertube.getBasicInfo('nG5p6S_Kd-Y');


    console.log(videoInfo);
}
VideoInfo {
  basic_info: {
    id: 'nG5p6S_Kd-Y',
    channel_id: 'UCazV3A3_1-Mtd6E_auw_ifg',
    title: 'AWS 中文入门开发教学 - S3 - 基本的使用【1级会员】',
    duration: 630,
    keywords: undefined,
    is_owner_viewing: false,
    short_description: 'AWS 中文入门开发教学 - S3 - 基本的使用【1级会员】',
    thumbnail: [ [Thumbnail], [Thumbnail], [Thumbnail], [Thumbnail], [Thumbnail] ],
    allow_ratings: true,
    view_count: 1065,
    author: '小马技术',
    is_private: false,
    is_live: false,
    is_live_content: false,
    is_live_dvr_enabled: false,
    is_upcoming: false,
    is_crawlable: true,
    is_post_live_dvr: false,
    is_low_latency_live_stream: false,
    live_chunk_readahead: undefined,
    embed: {
      iframe_url: 'https://www.youtube.com/embed/nG5p6S_Kd-Y',
      flash_url: undefined,
      flash_secure_url: undefined,
      width: 1280,
      height: 720
    },
    channel: {
      id: 'UCazV3A3_1-Mtd6E_auw_ifg',
      name: '小马技术',
      url: 'http://www.youtube.com/@deeplearncloud'
    },
    is_unlisted: false,
    is_family_safe: true,
    category: 'Education',
    has_ypc_metadata: false,
    start_timestamp: null,
    end_timestamp: null,
    url_canonical: null,
    tags: null,
    like_count: undefined,
    is_liked: undefined,
    is_disliked: undefined
  },
  annotations: undefined,
  storyboards: undefined,
  endscreen: undefined,
  captions: undefined,
  cards: undefined,
  streaming_data: undefined,
  playability_status: {
    status: 'UNPLAYABLE',
    reason: "This video is available to this channel's members on level: 小宝马I (or any higher level). Join this channel to get access to members-only content and other exclusive perks.",
    embeddable: true,
    audio_only_playability: null,
    error_screen: PlayerLegacyDesktopYpcOffer {
      type: 'PlayerLegacyDesktopYpcOffer',
      title: 'Members-only content',
      thumbnail: 'https://yt3.ggpht.com/ytc/AIdro_kry-66PUMaH161wJzup0cEbTorJoUXAoU3cA0a193slA=s176-c-k-c0x00ffffff-no-rj',
      offer_description: "This video is available to this channel's members on level: 小宝马I (or any higher level). Join this channel to get access to members-only content and other exclusive perks.",
      offer_id: 'sponsors_only_video'
    }
  },
  player_config: undefined,
  primary_info: undefined,
  secondary_info: undefined,
  playlist: undefined,
  game_info: undefined,
  merchandise: undefined,
  related_chip_cloud: undefined,
  watch_next_feed: undefined,
  player_overlays: undefined,
  comments_entry_point_header: undefined,
  livechat: undefined,
  autoplay: undefined,
  heat_map: undefined
}

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions