Git Product home page Git Product logo

Comments (3)

ravimisra avatar ravimisra commented on August 20, 2024

I fear that there is no direct way to find out the URL.
Though, you can set up a poll for that as follows:
Assuming $posting_init_on initialized to the DateTime of the time when we posted the video and $source_url to the source URL for the post.

$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);

from tumblr.php.

oligriffiths avatar oligriffiths commented on August 20, 2024

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.

from tumblr.php.

ravimisra avatar ravimisra commented on August 20, 2024

@oligriffiths, the id returned in the transcoding response is just to reference transcoding process, it never matches with the final post id.
So https://xxxxxx.tumblr.com/post/174874832676 is wrong URL for the final post.

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.