Skip to content

Commit

Permalink
Merge pull request #120 from xiaohaoxing/development
Browse files Browse the repository at this point in the history
feat: add isShort property to videoCompact.
  • Loading branch information
SuspiciousLookingOwl authored Nov 13, 2024
2 parents de9b687 + f3d2d92 commit 1460ae8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/youtube/VideoCompact/VideoCompact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export class VideoCompact extends Base implements VideoCompactProperties {
duration!: number | null;
/** Whether this video is a live now or not */
isLive!: boolean;
/** Whether this video is a shorts or not */
isShort!: boolean;
/** The channel who uploads this video */
channel?: BaseChannel;
/** The date this video is uploaded at */
Expand Down
3 changes: 3 additions & 0 deletions src/youtube/VideoCompact/VideoCompactParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ export class VideoCompactParser {
!!(badges?.[0].metadataBadgeRenderer.style === "BADGE_STYLE_TYPE_LIVE_NOW") ||
thumbnailOverlays?.[0].thumbnailOverlayTimeStatusRenderer?.style === "LIVE";

target.isShort =
thumbnailOverlays?.[0].thumbnailOverlayTimeStatusRenderer?.style === "SHORTS" || false;

// Channel
const browseEndpoint = (ownerText || shortBylineText)?.runs[0]?.navigationEndpoint
?.browseEndpoint;
Expand Down

0 comments on commit 1460ae8

Please sign in to comment.