Benjamin Loison
Benjamin Loison
diff: ```diff diff --git a/common.php b/common.php index ef9d2f4..67d771a 100644 --- a/common.php +++ b/common.php @@ -84,7 +84,7 @@ return [$result, $http_response_header]; } - function isRedirection($url) + function getRedirection($url) { $opts =...
```markdown Fix #330: Change `isRedirection` to `getRedirection` ```
```bash curl https://www.youtube.com/youtubei/v1/comment/update_comment -H 'Content-Type: application/json' -H 'X-Goog-AuthUser: 1' -H 'Origin: https://www.youtube.com' -H 'Authorization: SAPISIDHASH CENSORED' -H 'Cookie: __Secure-1PSIDTS=sidts-CENSORED; __Secure-1PSID=CENSORED; __Secure-1PAPISID=CENSORED' --data-raw '{"context": {"client": {"clientName": "WEB", "clientVersion": "2.20240712.01.00"}}, "commentText": "Test",...
https://www.youtube.com/watch?v=373TksynowI&lc=UgwtrfUlH98urhZFaXR4AaABAg https://yt.lemnoslife.com/noKey/commentThreads?part=snippet&id=UgwtrfUlH98urhZFaXR4AaABAg ```python import requests import json import blackboxprotobuf import base64 import hashlib import time SAPISID = 'CENSORED' __Secure_1PSIDTS = 'CENSORED' __Secure_1PSID = 'CENSORED' COMMENT_ID = 'UgwtrfUlH98urhZFaXR4AaABAg' VIDEO_ID_THE_COMMENT_IS_POSTED_ON = '373TksynowI'...
It seems that currently the algorithm rebuilds the command as `--data-raw '$...'` which is an issue in the context of [Benjamin_Loison/OneDrive/issues/6](https://codeberg.org/Benjamin_Loison/OneDrive/issues/6).
Also before [blob/main/tools/minimizeCURL.py#L151-L228](https://github.com/Benjamin-Loison/YouTube-operational-API/blob/main/tools/minimizeCURL.py#L151-L228) have to be considered as it rebuilds incorrectly the command.
A shameful, probably introducing a security flaw, fix is: ```python command = command.replace(" --data-raw '$", " --data-raw $'") ``` But to put where? I guess in `isCommandStillFine`.
Related to #171.
Alternatively can replace `--data-raw $'...'` with `--data-raw "..."` it seems. Maybe just `'...'` does not interpret some characters like `\r` and `\n`. It seems that `"..."` too even if escape...
```bash echo $'-----------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXX\r\nContent-Disposition: form-data; name="no_individu"\r\n\r\nXXXXXX\r\n-----------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXX\r\nContent-Disposition: form-data; name="acti"\r\n\r\nXX\r\n-----------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXX--\r\n' ``` Output: ``` -----------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXX Content-Disposition: form-data; name="no_individu" XXXXXX -----------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXX Content-Disposition: form-data; name="acti" XX -----------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXX-- ``` I am unable to reproduce these new lines...