-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
YouTube UI add reply to comment #250
Labels
enhancement
New feature or request
low priority
Nice to have feature.
medium
A task that should take less than a day to complete.
Comments
Benjamin-Loison
added
enhancement
New feature or request
low priority
Nice to have feature.
quick
A task that should take less than two hours to complete.
labels
Mar 7, 2024
Benjamin-Loison
added
medium
A task that should take less than a day to complete.
and removed
quick
A task that should take less than two hours to complete.
labels
Mar 7, 2024
syntax = "proto3";
message message0
{
string videoId = 2;
string commentId = 4;
} {
"videoId": "373TksynowI",
"commentId": "UgyIHL-bHj3fgnXduOd4AaABAg"
} is enough and minimized (if remove |
Waiting original requester answer on Discord. |
import requests
import json
import time
url = 'https://yt.lemnoslife.com/noKey/comments'
params = {
'part': 'snippet',
'parentId': 'UgyIHL-bHj3fgnXduOd4AaABAg',
'maxResults': 100
}
pageToken = ''
initialLastComment = None
while True:
while True:
params['pageToken'] = pageToken
response = requests.get(url, params = params).json()
items = response['items']
if not 'nextPageToken' in response:
break
pageToken = response['nextPageToken']
lastComment = items[-1]['snippet']['textOriginal']
print(lastComment)
if initialLastComment is None:
initialLastComment = lastComment
elif initialLastComment != lastComment:
break
time.sleep(1) |
node test.js
const protobuf = require("protobufjs");
const fs = require("fs");
const crypto = require("node:crypto")
const axios = require("axios")
const root = protobuf.loadSync("messages.proto");
const message0 = root.lookupType("message0")
const outerMessage = message0.create({
videoId: "373TksynowI",
commentId: "UgyIHL-bHj3fgnXduOd4AaABAg",
})
const createReplyParams = message0.encode(outerMessage).finish().toString("base64")
const authorization = "SAPISIDHASH CENSORED"
const commentText = "nodejs 4"
const headers = {
'authorization': authorization,
'content-type': 'application/json',
'cookie': '__Secure-1PAPISID=CENSORED; __Secure-1PSID=CENSORED; __Secure-1PSIDTS=sidts-CENSORED',
'origin': 'https://www.youtube.com',
'X-Goog-AuthUser': '1',
}
const body = {
'commentText': commentText,
'createReplyParams': createReplyParams,
'context': {
'client': {
'clientName': "WEB",
'clientVersion': "2.20240308.00.00"
}
}
}
axios.post("https://www.youtube.com/youtubei/v1/comment/create_comment_reply", body, {headers})
.then(response => {
console.log('response', JSON.stringify(response.data, null, 4))
})
.catch(error => {
console.log('error', error)
})
syntax = "proto3";
message message0
{
string videoId = 2;
string commentId = 4;
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
New feature or request
low priority
Nice to have feature.
medium
A task that should take less than a day to complete.
Requested on Discord.
After
minimize_curl.py
(note that thecommentText
is part of the response,STATUS_SUCCEEDED
is more general):https://www.youtube.com/watch?v=373TksynowI&lc=UgyIHL-bHj3fgnXduOd4AaABAg
https://yt.lemnoslife.com/noKey/commentThreads?part=replies&id=UgyIHL-bHj3fgnXduOd4AaABAg
test.proto
:test.data
:protoc --encode=message0 test.proto < test.data
Not identical for the moment...
For an unknown reason when provide above proto and following JSON to https://www.protobufpal.com we get the same YouTube UI protobuf (i.e.
EgszNzNUa3N5bm93SSIaVWd5SUhMLWJIajNmZ25YZHVPZDRBYUFCQWcqAggAUAfoAQA=
):https://yt.lemnoslife.com/noKey/comments?part=snippet&id=UgyIHL-bHj3fgnXduOd4AaABAg.A0h8yXKhWTrA0h9U2nnZ09
https://yt.lemnoslife.com/noKey/commentThreads?part=snippet&id=UgyIHL-bHj3fgnXduOd4AaABAg&fields=items/snippet/totalReplyCount
https://yt.lemnoslife.com/noKey/comments?part=snippet&parentId=UgyIHL-bHj3fgnXduOd4AaABAg&maxResults=100
Related to #91 and #190.
The text was updated successfully, but these errors were encountered: