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

Cannot get Premiere & Schedule time from getSubscriptionsFeed #380

Closed
4 tasks done
RikiNozomu opened this issue Apr 11, 2023 · 1 comment · Fixed by #384
Closed
4 tasks done

Cannot get Premiere & Schedule time from getSubscriptionsFeed #380

RikiNozomu opened this issue Apr 11, 2023 · 1 comment · Fixed by #384
Labels
enhancement New feature or request

Comments

@RikiNozomu
Copy link

Describe your suggestion

I use getSubscriptionsFeed for get info.
However, I cannot receive any Premiere & Schedule time, I just got N/A from published field.
Please add this feature for us.

Below this example data which got from getSubscriptionsFeed

GridVideo {
  type: 'GridVideo',
  id: 'tVzlBQCu3Cw',
  title: Text {
    runs: [ [TextRun] ],
    text: '🔴Free talk : Happy birthday Event!! สุขสันต์วันเกิดไอหลาม เกิด13 ไลฟ์ 12 เปิดไลฟ์ฉลองวันเกิดมาคุยกัน'
  },
  thumbnails: [
    Thumbnail {
      url: 'https://i.ytimg.com/vi/tVzlBQCu3Cw/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLDs_NPZKoe4qpbbcRH49GwaMqWJRA',
      width: 336,
      height: 188
    },
    Thumbnail {
      url: 'https://i.ytimg.com/vi/tVzlBQCu3Cw/hqdefault.jpg?sqp=-oaymwEcCPYBEIoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLD4aUeAjq2GBpNLiw6bofc9JQoOLA',
      width: 246,
      height: 138
    },
    Thumbnail {
      url: 'https://i.ytimg.com/vi/tVzlBQCu3Cw/hqdefault.jpg?sqp=-oaymwEbCNIBEHZIVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLBeWQ56646CTnuPOBu3wzPMMlsbjw',
      width: 210,
      height: 118
    }
  ],
  thumbnail_overlays: [
    ThumbnailOverlayTimeStatus {
      type: 'ThumbnailOverlayTimeStatus',
      text: 'UPCOMING',
      style: 'UPCOMING'
    },
    ThumbnailOverlayToggleButton {
      type: 'ThumbnailOverlayToggleButton',
      is_toggled: null,
      icon_type: [Object],
      tooltip: [Object],
      toggled_endpoint: [NavigationEndpoint],
      untoggled_endpoint: [NavigationEndpoint]
    },
    ThumbnailOverlayToggleButton {
      type: 'ThumbnailOverlayToggleButton',
      is_toggled: null,
      icon_type: [Object],
      tooltip: [Object],
      toggled_endpoint: [NavigationEndpoint],
      untoggled_endpoint: [NavigationEndpoint]
    },
    ThumbnailOverlayNowPlaying {
      type: 'ThumbnailOverlayNowPlaying',
      text: 'Now playing'
    }
  ],
  rich_thumbnail: undefined,
  published: Text { text: 'N/A' },
  duration: Text { text: 'UPCOMING' },
  author: Author {
    id: 'UCTygto_BZDamXNv2YRqPNKg',
    name: 'Kaiyo Ch. 鮫かいよ',
    thumbnails: [],
    endpoint: NavigationEndpoint {
      type: 'NavigationEndpoint',
      payload: [Object],
      metadata: [Object]
    },
    badges: [],
    is_verified: null,
    is_verified_artist: null,
    url: 'https://www.youtube.com/@KaiyoCh'
  },
  views: Text { text: 'N/A' },
  short_view_count: Text { text: 'N/A' },
  endpoint: NavigationEndpoint {
    type: 'NavigationEndpoint',
    payload: {
      videoId: 'tVzlBQCu3Cw',
      watchEndpointSupportedOnesieConfig: [Object]
    },
    metadata: {
      url: '/watch?v=tVzlBQCu3Cw',
      page_type: 'WEB_PAGE_TYPE_WATCH',
      api_url: '/player'
    }
  },
  menu: Menu {
    type: 'Menu',
    items: [
      [MenuServiceItem],
      [MenuServiceItem],
      [MenuServiceItem],
      [MenuServiceItem],
      [MenuServiceItem]
    ],
    top_level_buttons: [],
    label: 'Action menu'
  }
}

Other details

No response

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.
@RikiNozomu RikiNozomu added the enhancement New feature or request label Apr 11, 2023
@RikiNozomu RikiNozomu changed the title Cannot get Premiere & Schedule time from subscription feed Cannot get Premiere & Schedule time from getSubscriptionsFeed Apr 11, 2023
@absidue
Copy link
Collaborator

absidue commented Apr 11, 2023

For other Video objects you can use video.is_upcoming to check if it's upcoming and then get the scheduled start date from video.upcoming (contains a standard javascript Date object when is_upcoming is true, otherwise it's undefined).

However it looks like it hasn't been implemented for GridVideo's yet. The reason I mentioned how you can do it with other video objects, is so that you know that it will be implemented similarly to the way it is in other video objects, not through the published field. If you want to format the Date object to a relative date string, you can use the Intl.RelativeTimeFormat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants