Skip to content

Commit

Permalink
Fix yt
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrews54757 committed Oct 1, 2024
1 parent 6ec0781 commit d8b360c
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions chrome/player/players/yt/YTPlayer.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,24 @@ export default class YTPlayer extends DashPlayer {
}

try {
const [youtube, info] = await this.getVideoInfo(identifier, this.defaultClient);
this.videoInfo = info;
this.ytclient = youtube;

if (this.videoInfo.playability_status?.status === 'LOGIN_REQUIRED') {
console.warn('Login Required, trying to fetch with TV mode');
const [youtube2, info2] = await this.getVideoInfo(identifier, ClientType.TV_EMBEDDED);
this.videoInfo = info2;
this.ytclient = youtube2;
}

let manifest;
try {
const [youtube, info] = await this.getVideoInfo(identifier, this.defaultClient);
this.videoInfo = info;
this.ytclient = youtube;

if (this.videoInfo.playability_status?.status === 'LOGIN_REQUIRED') {
console.warn('Login Required, trying to fetch with TV mode');
const [youtube2, info2] = await this.getVideoInfo(identifier, ClientType.TV_EMBEDDED);
this.videoInfo = info2;
this.ytclient = youtube2;
}

manifest = await this.videoInfo.toDash((url) => {
return url;
});
} catch (e) {
if (this.videoInfo.client_type === ClientType.WEB) {
if (this.defaultClient === ClientType.WEB) {
console.warn('Failed to fetch manifest, trying with iOS client', e);
const [youtube3, info3] = await this.getVideoInfo(identifier, ClientType.IOS);
this.videoInfo = info3;
Expand Down

0 comments on commit d8b360c

Please sign in to comment.