Comments (10)
$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.
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.
@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.
@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.
@ravi2shah and @gnithin
I had fixed the issue in this pull request, please pull these changes into your code.
from tumblr.php.
Hi there,
when are you going to merge this?
Thanks
from tumblr.php.
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.
@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.
@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.
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)
- Response to a Submission HOT 1
- followed
- Tumblr oauth not working in Laravel 6.5.2
- Encountere a error during handling Response in PHP HOT 1
- Encountered an Exception handling HOT 1
- How to check if a post is reblogged ?
- Is this package deprecated? HOT 6
- Is there a version of this package that supports NPF(Neue Post Format)?
- Missing or invalid request token. HOT 1
- Neue Post HOT 5
- compatibility issue with php8.2 HOT 1
- What file do I have to include in my php file HOT 2
- Bad Request (You may only upload one video per post.) HOT 1
- RATE LIMITING HEADERS HOT 1
- Rate limit exceeded HOT 1
- Reblog post Unauthorized ? HOT 1
- oauth 403 error ? HOT 2
- some blogs returns 404 HOT 11
- How to get video post URL HOT 3
- get list of users who liked post
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tumblr.php.