Handle private videos, use iOS client
This commit is contained in:
1 parent
11d1aef201
commit
1ff96223a5
2 files changed
+18
-7
No files matched your search
@@ -178,7 +178,13 @@ export class YoutubeJs {
|
||||
|
||||
static async getVideoInfo(videoId: string) {
|
||||
await this.init();
|
||||
const info = await YoutubeJs.innerTube.getBasicInfo(videoId, 'ANDROID');
|
||||
const info = await YoutubeJs.innerTube.getBasicInfo(videoId, 'IOS');
|
||||
|
||||
console.log('[YTJS] info:', info);
|
||||
|
||||
if (info.playability_status.status !== 'OK') {
|
||||
throw new Error(`Video not available: ${info.playability_status.reason}`);
|
||||
}
|
||||
|
||||
const formatStreams = info.streaming_data.formats.map(format => {
|
||||
return {
|
||||
|
||||
Reference in new issue
Block a user