Skip to content

Commit

Permalink
fix(parser): Make Video.is_live work on channel pages (#368)
Browse files Browse the repository at this point in the history
  • Loading branch information
absidue authored Mar 22, 2023
1 parent a8b507e commit bd35faa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/parser/classes/Video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Thumbnail from './misc/Thumbnail.js';
import NavigationEndpoint from './NavigationEndpoint.js';
import MetadataBadge from './MetadataBadge.js';
import ExpandableMetadata from './ExpandableMetadata.js';
import ThumbnailOverlayTimeStatus from './ThumbnailOverlayTimeStatus.js';

import { timeToSeconds } from '../../utils/Utils.js';
import { YTNode } from '../helpers.js';
Expand Down Expand Up @@ -98,7 +99,7 @@ class Video extends YTNode {
return this.badges.some((badge) => {
if (badge.style === 'BADGE_STYLE_TYPE_LIVE_NOW' || badge.label === 'LIVE')
return true;
});
}) || this.thumbnail_overlays.firstOfType(ThumbnailOverlayTimeStatus)?.style === 'LIVE';
}

get is_upcoming(): boolean | undefined {
Expand Down

0 comments on commit bd35faa

Please sign in to comment.