Skip to content

Commit

Permalink
Added docs for cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
munishkhatri720 committed Jan 9, 2025
1 parent 7b991c3 commit fe19d36
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ plugins:
# Initialization is skipped automatically if a valid refresh token is supplied. Leave this commented if you're
# completing the OAuth flow for the first time/do not have a refresh token.
# skipInitialization: true
# cookie: "paste your google account cookie here which your exported from browser"
```

## Using a `poToken`
Expand Down Expand Up @@ -308,6 +309,31 @@ plugins:
token: "paste your po_token here"
visitorData: "paste your visitor_data here"
```
## Using `Cookies`

Follow this [guide](https://github.com/yt-dlp/yt-dlp/wiki/Extractors#exporting-youtube-cookies) from yt-dlp to export your account cookies.

> [!NOTE]
> Cookies are not as reliable as OAuth2. They have a very short lifespan. Also, make sure to use a burner account; do not use your main account, as it may get banned or terminated. Cookies only work on `WEB`, `WEBEMBEDDED`, `MWEB`, and `ANDROID_VR`.

Specifying the cookie is as simple as doing:

### Lavaplayer
```java
source.getOauth2Handler().setCookie("your_cookie_here");
```

### Lavalink
```yaml
plugins:
youtube:
enabled: true
oauth:
enabled: true
cookie : "put_your_cookie_here"
refreshToken : "put_your_refresh_token_here"
skipInitialization : true
```

## REST routes (`plugin` only)
### `POST` `/youtube`
Expand Down Expand Up @@ -350,6 +376,23 @@ Otherwise:
}
```

### `POST` `/youtube/cookie`
Body:
```json
{
"cookie" : "your_cookie_value, or null"
}
```

Response:

If the YouTube source is not enabled, or oauth is not enabled:
`500 - Internal Server Error`

Otherwise:
`204 - No Content`


### `GET` `/youtube/stream/{videoId}`

Query parameters:
Expand Down

0 comments on commit fe19d36

Please # to comment.