Git Product home page Git Product logo

Comments (10)

wle1036 avatar wle1036 commented on July 19, 2024 2
	$arrMessage = array(
					'type' => 'video',
					'tags' => 'test-salam-ok',
					'caption' => 'Photo details',
					'slug' => 'test',
					"data"    =>  $file_url,
					'format' => 'html'
				);

is work God .
data is direct video url like this :

https://wle.ir/downloads/video/cncPaiting.mp4

from tumblr.php.

gnithin avatar gnithin commented on July 19, 2024

I figured out why it was happening -
My main goal was to ultimately share a video from a remote url. Hence using source key for a local video like the one in the example above didn't workout. The solution was to use data and give it the path to the local video.
The Tumblr API documentation requires data key to be assigned to the file contents.
So, when using the data key, the library tries to load the local video using Guzzle(Which gave a lot of errors when used in my production env - Google app engine). Giving it a remote url doesn't work since the file path is checked.
I couldn't find a way to simply add the contents of a file to the data key like the way in the API.
It would be nice if there was a way to stop the data key from being pre-processed and simply accept whatever is given.

from tumblr.php.

ravi2shah avatar ravi2shah commented on July 19, 2024

@gnithin have you able to upload a video?
instead of video if I'll upload photo with same code its working fine.

$post_data = array('type' => 'video', 'caption' => 'hello video','data' => $video_path);
$createPost = $tumblr->createPost($unique_id,$post_data);

getting this error while uploading
Tumblr\API\RequestException: [400]: Bad Request (You may only upload one video per post.)

from tumblr.php.

gnithin avatar gnithin commented on July 19, 2024

@ravi2shah
Since I was having trouble setting the file content to "data" key on my own, I switched to using another library (this one), where I could just do -

$this->client->oauth_post(
    "/blog/".$blog_identifier.".tumblr.com/post",
    [
        "type"    => "video",
        "caption" => $caption,
        "data"    => file_get_contents($video_path);
    ];
);

It worked back then. I don't know if this would still work, but you can give it a try :)

from tumblr.php.

ravimisra avatar ravimisra commented on July 19, 2024

@ravi2shah and @gnithin
I had fixed the issue in this pull request, please pull these changes into your code.

from tumblr.php.

grzegorz-pierzakowski avatar grzegorz-pierzakowski commented on July 19, 2024

Hi there,
when are you going to merge this?
Thanks

from tumblr.php.

DhirajBelure avatar DhirajBelure commented on July 19, 2024

below parameter require to post video on tumblr
$params = array('type' => 'video','caption' => 'caption','embed'=> '<iframe width="560" height="315" src="your youtube video url" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>');

from tumblr.php.

ravimisra avatar ravimisra commented on July 19, 2024

@DhirajBelure embed option will work only if your video URL is streamable i.e. hosted on Youtube, s3 or on the other video hosting services. It merely embeds your video on your Tumblr blog, instead of uploading the video to Tumblr.

from tumblr.php.

UVLabs avatar UVLabs commented on July 19, 2024

@ravimisra @DhirajBelure @grzegorz-pierzakowski @ravi2shah @gnithin you can use embed with HTML5 embed code:

$params = array('type' => 'video','caption' => 'caption','embed'=> '<video width="100%" height="auto" controls><source src="video source on server" type="video/mp4">
Your browser does not support the video tag.
</video>');

from tumblr.php.

himanshupatel95 avatar himanshupatel95 commented on July 19, 2024

video not upload .
$video_file = getenv("HOME") . "../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);
}
any Solution ?

from tumblr.php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.