fent / fent/node-ytdl-core

Improve video details extraction by using innertube API

Open
#960 5 comments 0 reactions 0 assignees View on GitHub
needs more info
Dominant language
JavaScript
Stars
4.7k
Forks
852
PR merge metrics
No merged PRs in 30d

Description

YouTube is slowly migrating to their new innertube API and we should consider using the new API for consitent and reliable results. youtube-dl is already using this new API.

Examples:
```bash
curl --location --request POST 'https://www.youtube.com/youtubei/v1/player?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8' \
--header 'Content-Type: application/json' \
--data-raw '{
"context": {
"client": {
"clientName": "WEB",
"clientVersion": "2.20210623.00.00"
}
},
"videoId": "vKJpN5FAeF4"
}'
```

An age restricted video that does not work with get_video_info route.
```bash
curl --location --request POST 'https://www.youtube.com/youtubei/v1/player?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8' \
--header 'Content-Type: application/json' \
--data-raw '{
"context": {
"client": {
"clientName": "WEB_EMBEDDED_PLAYER",
"clientVersion": "1.20210623.1.0"
}
},
"videoId": "HtVdAasjOgU"
}'
```

The API key and client version can be extracted from watch or embed page.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.