Answer the question
In order to leave comments, you need to log in
facebook api. Is it possible to download video from youtube link?
In general, the result should be uploading a video to Facebook hosting.
The code that gives the error "Graph returned an error: Sorry, the video file you selected is in a format that we don't support."
$video = 'https://youtu.be/видос';
$data = [
'title' => 'тайтл',
'description' => 'дискрипшн',
'source' => $fb->videoToUpload($video),
];
try {
$response = $fb->post('/айди группы/videos', $data);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
// When Graph returns an error
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
// When validation fails or other local issues
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
var_dump($graphNode);
echo 'Video ID: ' . $graphNode['id'];
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question