-
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
How to get video post URL #98
Comments
I fear that there is no direct way to find out the URL. $remote_url = null;
$attempts = 0;
$found = false;
do {
$info = $client->getBlogPosts($blogName, ['type' => 'video', 'limit' => 1]);
if (!empty($info) && !empty($info->posts) && !empty($info->posts[0])) {
if ($info->posts[0]->timestamp >= $posting_init_on->timestamp) {
$url = $info->posts[0]->source_url;
$parsed_source_url = parse_url($url);
$query = $parsed_source_url['query'];
if (!empty($query)) {
parse_str($query, $parsed_query);
if (!empty($parsed_query) && $parsed_query['z'] == $source_url) {
$remote_url = $info->posts[0]->post_url;
$found = true;
}
}
}
}
$attempts++;
sleep(($attempts + 1) * 5);
} while ($attempts < 15 && $found === false); |
https://xxxxxx.tumblr.com/post/174874832676 Is the correct url, however video transcoding takes a few minutes to a few hours depending upon the size of the video and how many other videos are being processed at the same time. Your best bet is to periodically check if the video url returns a non 404. |
@oligriffiths, the id returned in the transcoding response is just to reference transcoding process, it never matches with the final post id. |
Hi,
When i upload video post my response is:
object(stdClass)#1151 (3) { ["id"]=> float(174874832676) ["state"]=> string(11) "transcoding" ["display_text"]=> string(75) "Your video is still processing, please wait a few minutes for it to appear." }
When video transcoding is finished , new video post id changed and https://xxxxxx.tumblr.com/post/174874832676 - link returnd "Not found".
How i can get video post id after transcoding finished?
The text was updated successfully, but these errors were encountered: