-
Notifications
You must be signed in to change notification settings - Fork 115
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
fixing video uploads #92
Conversation
Merge this please |
@ravimisra I'm not able to post a video even replacing the code with your updated code. Here is my code: $client->setToken($accessToken, $accessSecret); I tried giving the root path to the directory where the video will save, but not working. Fatal error: Uncaught Tumblr\API\RequestException: [400]: Bad Request thrown in /var/www/project/lib/tumblr-api/vendor/tumblr/tumblr/lib/Tumblr/API/Client.php on line 427 |
Thank you for submitting this pull request, however I do not see a valid CLA on file for you. Before we can merge this request please visit https://yahoocla.herokuapp.com/ and agree to the terms. Thanks! 😄 |
Accepted terms at https://yahoocla.herokuapp.com/, please merge. |
@KrishnaVishwakarma1595, $path should be initialized to the filename of the video file with absolute path. e.g. /tmp/video/my_video_file_to_upload.mp4 |
@ravimisra Thanks for your reply. I've tried giving absolute path also but it's still giving the same error. $client->setToken($accessToken, $accessSecret); |
@ravimisra We ended up patching this issue on the backend some time ago. I just re-tested, and was able to create a video file without issue using the following snippet (sensitive information replaced with <?php
require __DIR__ . "/vendor/autoload.php";
const CONSUMER_KEY = "...";
const CONSUMER_SECRET = "...";
const ACCESS_TOKEN = "...";
const ACCESS_TOKEN_SECRET = "...";
const BLOG = "...";
$video_file = getenv("HOME") . "/Downloads/video.mp4";
$client = new Tumblr\API\Client(CONSUMER_KEY, CONSUMER_SECRET);
$client->setToken(ACCESS_TOKEN, ACCESS_TOKEN_SECRET);
$post_data = ["type" => "video", "caption" => "this is a test video", "data" => $video_file];
try {
print_r($client->createPost(BLOG, $post_data));
} catch (Exception $ex) {
print_r($ex);
} Please feel free to create an issue if you still run into problems posting videos. |
Video Not Upload issue . Error status 401 require DIR . "/vendor/autoload.php"; const CONSUMER_KEY = "..."; $video_file = "../video.mp4"; $client = new Tumblr\API\Client(CONSUMER_KEY, CONSUMER_SECRET); try { |
@himanshupatel95 If you're getting responses with a Please go to https://api.tumblr.com/console to create a new access token and give that a shot. |
Thanks |
Fixed the issue related to posting a video post on Tumblr.
A video post can be uploaded as follows: