* change comments to a legit API - thanks Lauren
This commit is contained in:
parent
0fd785ca92
commit
04649561f0
|
@ -6,8 +6,27 @@ if [[ "${get_data[v]}" == '' && "${get_data[cont]}" == '' ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${get_data[cont]}" == '' ]]; then # tactical replies, INCOMING
|
if [[ "${get_data[cont]}" == '' ]]; then # tactical replies, INCOMING
|
||||||
vid="$(curl -b cookiejar_ -H "Cookie: CONSENT=YES+1337" -s "https://www.youtube.com/watch?v=${get_data[v]}" -c cookiejar_)"
|
# vid="$(curl -b cookiejar_ -H "Cookie: CONSENT=YES+1337" -s "https://www.youtube.com/watch?v=${get_data[v]}" -c cookiejar_)"
|
||||||
cont="$(grep -Poh 'token":"Eg0S.*?"' <<< "$vid" | sed -E 's/token"://;s/"//g' | head -n1)" #'
|
# cont="$(grep -Poh 'token":"Eg0S.*?"' <<< "$vid" | sed -E 's/token"://;s/"//g' | head -n1)" #'
|
||||||
|
# the above still works but the below is more resilient?
|
||||||
|
vid="$(curl --request POST \
|
||||||
|
--url 'https://www.youtube.com/youtubei/v1/next?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8' \
|
||||||
|
--header 'Accept: application/json' \
|
||||||
|
--header 'Content-Type: application/json' \
|
||||||
|
--cookie CONSENT=PENDING%2B553 \
|
||||||
|
--data '{
|
||||||
|
"context": {
|
||||||
|
"client": {
|
||||||
|
"clientName": "WEB",
|
||||||
|
"clientVersion": "2.20211221.00.00",
|
||||||
|
"hl": "en",
|
||||||
|
"timeZone": "UTC",
|
||||||
|
"utcOffsetMinutes": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"videoId": "'"${get_data[v]}"'"
|
||||||
|
}')"
|
||||||
|
cont="$(jq -r '.contents.twoColumnWatchNextResults.results.results.contents[3].itemSectionRenderer.contents[0].continuationItemRenderer.continuationEndpoint.continuationCommand.token' <<< "$vid")"
|
||||||
else
|
else
|
||||||
cont="${get_data[cont]}"
|
cont="${get_data[cont]}"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue