Skip to content

Commit

Permalink
challenge quick fix added
Browse files Browse the repository at this point in the history
  • Loading branch information
adasq authored and adasq committed Mar 18, 2021
1 parent c00b65e commit f5ca35e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "youtube-studio",
"version": "0.0.15",
"version": "0.0.16",
"description": "Unofficial YouTube Studio API",
"main": "index.js",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion src/youtube-studio-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ async function setMonetisation(monetizationSettings) {
_.set(requestBody, 'context.user.onBehalfOfUser', config.DELEGATED_SESSION_ID);
_.set(requestBody, 'context.user.delegationContext.externalChannelId', config.CHANNEL_ID || "");

const { sessionToken } = await fetch(`${YT_STUDIO_URL}/youtubei/v1/att/esr?alt=json&key=${config.INNERTUBE_API_KEY}`, {
let { sessionToken } = await fetch(`${YT_STUDIO_URL}/youtubei/v1/att/esr?alt=json&key=${config.INNERTUBE_API_KEY}`, {
method: 'POST',
headers: {
"sec-ch-ua": "\"Google Chrome\";v=\"87\", \" Not;A Brand\";v=\"99\", \"Chromium\";v=\"87\"",
Expand All @@ -143,6 +143,7 @@ async function setMonetisation(monetizationSettings) {
})
.then(res => res.json())

sessionToken = 'AbX5usaVblZEZl2lczOwxAxUibNffJq4vqh58zeBJ1j_Iy4Izj-wFpOIaNmzkKVgpXJ1PL7DWz5rgkyX2QEUq5XOMc-EJw==';
requestBody = _.cloneDeep(metadata_update_request_payload)

_.set(requestBody, 'context.user.onBehalfOfUser', config.DELEGATED_SESSION_ID);
Expand Down

0 comments on commit f5ca35e

Please sign in to comment.