Skip to content

Commit

Permalink
fix: add workaround for podcast type video (#1362)
Browse files Browse the repository at this point in the history
  • Loading branch information
JellyBrick authored Nov 4, 2023
1 parent fdd6d99 commit 47f38cc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/providers/song-info-front.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ export default () => {
data.videoDetails.album = videoData?.Hd?.playerOverlays?.playerOverlayRenderer?.browserMediaSession?.browserMediaSessionRenderer?.album.runs?.at(0)?.text;
data.videoDetails.elapsedSeconds = 0;
data.videoDetails.isPaused = false;

// HACK: This is a workaround for "podcast" type video. GREAT JOB GOOGLE.
if (data.playabilityStatus.transportControlsConfig) {
data.videoDetails.author = data.microformat.microformatDataRenderer.pageOwnerDetails.name;
}

ipcRenderer.send('video-src-changed', data);
}
}, { once: true, passive: true });
Expand Down
11 changes: 11 additions & 0 deletions src/types/get-player-response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,17 @@ export interface PlayabilityStatus {
audioOnlyPlayability: AudioOnlyPlayability;
miniplayer: Miniplayer;
contextParams: string;
transportControlsConfig?: TransportControlsConfig;
}

type ReplaceDefaultType = {
replaceDefault: boolean,
};

export interface TransportControlsConfig {
seekForwardStatus: ReplaceDefaultType;
seekBackwardStatus: ReplaceDefaultType;
playbackRateStatus: ReplaceDefaultType;
}

export interface AudioOnlyPlayability {
Expand Down

0 comments on commit 47f38cc

Please sign in to comment.