Search code examples
phpapioauthvimeo

Vimeo PHP Upload Directory


I have spent this best part of a week rattling my brain to get this working and I've just come to the conclusion that this is out of my scope. I know this is a rather large ask but I just can't figure it out. :(

Anyway, I am trying to upload some files in a directory on my webserver to Vimeo through a protected php script (I say protected because the script itself will not be accessible from the web) and have that script run via a cron job. The script will only upload to my account.

I have gotten as far as getting a consumer key and consumer secret from vimeo.

I have been attempting to use their documented API demo but that keeps requesting an oauth_token and oauth_token_secret, both of which I don't know how to obtain. I found it quite confusing and unsure if I could adapt it for my requirements. Instead, I googled and found this blog post about transfering files from youtube to vimeo - http://mclear.co.uk/2011/05/27/transfer-videos-from-youtube-to-vimeo/ - I thought I could use it as a building block but I've hit a dead end here also.

To explain the full scale of what I'm trying to achieve:

Video file is created on originating computer - Working

User adds ID3 tags to the file and drops it in a watched folder - Working

Local server sends the file via ftp to the webserver directory - Working

Php script reads the ID3 for the file and uploads it to vimeo - [ID3 Extractor working -Vimeo uploader not working]

Vimeo responds with upload location to script which then connects to our mysql server to add the record - Not working but straightforward to implement once uploader works

Thank you so much in advance for any help you can give. Richard


Solution

  • I made some progress on this with the php "Transfer Youtube to Vimeo tool" I made

    The download at the bottom of the article will get you uploading w/ PHP

    The CLI tool is now available and comes with a video tutorial for how to use it.

    Credit to @TomNomNom

    Please don't contact me RE this I'm not supporting this code it was just hacked together :)