Git Product home page Git Product logo

Comments (4)

Dashron avatar Dashron commented on August 30, 2024

Have you been able to make other requests, such as $vimeo->request("/me")?

A status of 0 usually means the request never reached our server, which usually means there is an issue with certificates. Take a look at http://unitstep.net/blog/2009/05/05/using-curl-in-php-to-access-https-ssltls-protected-sites/ for more information, I do not recommend the easy fix (it's insecure).

If that doesn't solve the problem, try adding some curl debugging with http://php.net/manual/en/function.curl-error.php

from vimeo.php.

Dashron avatar Dashron commented on August 30, 2024

Hi,

Have you made any progress with this issue?

Thanks!

from vimeo.php.

mnori avatar mnori commented on August 30, 2024

Hi,

I tried $vimeo->request("/me") which worked great (got some details about my profile).

I then discovered that I was setting $pictures_uri in uploadImage() wrong - I had set it to https://api.vimeo.com/videos/105769240 when it should have been /videos/105769240 (I think?)

With the latter set, I got the "Unable to request an upload url from vimeo" exception, and this response:

(
    [body] => 
    [status] => 405
    [headers] => Array
        (
            [Date] => Wed, 10 Sep 2014 15
            [Server] => Apache
            [Allow] => GET,DELETE,PATCH,OPTIONS
            [Cache-Control] => max-age=315360000
            [Expires] => Sat, 07 Sep 2024 15
            [Vary] => Accept-Encoding
            [Content-Length] => 0
            [Content-Type] => application/json
        )
)

This is interesting since in the code it's a POST request. Am I using the wrong endpoint?

I also tried /videos/105769240/pictures as the endpoint parameter - this gave me a list of thumbnail sizes, but did not seem to upload the picture.

Matt

from vimeo.php.

Dashron avatar Dashron commented on August 30, 2024

The $pictures_uri should match the pictures connection in a clip response. It usually looks like "/videos/105769240/pictures".

$lib->uploadImage($clip['metadata']['connections']['pictures']['uri'], $path)

  • or -
    $lib->uploadImage('/videos/105769240/pictures', $path)

A POST request will be made against that url (https://github.com/vimeo/vimeo.php/blob/master/vimeo.php#L354) and it should give you a new single picture response, with the necessary informatoin to perform the upload.

Everything will be handled for you in the uploadImage method, and it will return a uri, pointing to the new image resource (/videos/[id]/pictures/[id])

from vimeo.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.