diff --git a/webroot/comments.shs b/webroot/comments.shs index d591b8f..cfc2edd 100755 --- a/webroot/comments.shs +++ b/webroot/comments.shs @@ -6,8 +6,27 @@ if [[ "${get_data[v]}" == '' && "${get_data[cont]}" == '' ]]; then fi 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_)" - cont="$(grep -Poh 'token":"Eg0S.*?"' <<< "$vid" | sed -E 's/token"://;s/"//g' | head -n1)" #' +# 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)" #' + # 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 cont="${get_data[cont]}" fi