-
Notifications
You must be signed in to change notification settings - Fork 157
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
does --write-comments
need to be set for comments to be available in getComments()
?
#224
Comments
With the current way it is the comments are showing up as empty objects in the database during my tests. comment_count returns 6 and comments shows like below... Note this is from a youtube video, I have yet to check other platforms, and will update this when I can. [{},{},{},{},{},{}] To get around this issue with the empty objects, I am trying this for the moment. How sure how it effects performance though, time will tell. Also on a side note I noticed that the .info.json file is missing from the try {
$json = $video->toJson();
$json = json_decode($json);
$comments = $json->comments;
} catch (\Exception $e) {
$comments = [];
} I'm seeing these fields in the info.json file with I use the {
"id": "string",
"text": "string",
"like_count": 2,
"author_id": "string",
"author": "string",
"author_thumbnail": "string",
"parent": "string",
"_time_text": "string",
"timestamp": 1672012800,
"author_url": "string",
"author_is_uploader": false,
"is_favorited": false
} Here is the code below to add the fields that aren't already in the code.
public function getAuthorUrl(): ?string {
return $this->get('author_url');
}
public function getAuthorIsUploader(): ?bool {
return $this->get('author_is_uploader');
}
public function getAuthorThumbnail(): ?string {
return $this->get('author_thumbnail');
}
public function getLikeCount(): ?int {
return $this->get('like_count');
}
public function getIsFavorited(): ?bool {
return $this->get('is_favorited');
}
public function getTimeText(): ?string {
return $this->get('_time_text');
} |
--write-comments
needs to be set for comments to be available in getComments()
--write-comments
need to be set for comments to be available in getComments()
?
Like the |
That's expected if you use |
But you could also just use |
Not sure where else the code needs to be updated in order to make it so when calling
getComments()
it actually returns the comments instead of an empty array.The text was updated successfully, but these errors were encountered: