Comments (2)
I think this is probably a case where it makes the most sense to just use curl directly rather than go through the library - this is an edge case that would be a little confusing to use within the library. You can see how the Vimeo library does this with vanilla curl_{x} calls, https://github.com/vimeo/vimeo.php/blob/master/src/Vimeo/Vimeo.php#L541, or there are many different curl wrappers you can use.
from vimeo.php.
Thanks for your quick response @aaronm67. I've actually been trying curl
all day unsuccessfully.
EDIT:
Upon further inspection of the Vimeo PHP SDK, I've come up with the following curl
settings that finally did the trick:
$curl = curl_init($uploadLink);
curl_setopt_array($curl, array(
CURLOPT_URL => $uploadLink,
CURLOPT_HEADER => 1,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
CURLOPT_CUSTOMREQUEST => 'HEAD',
CURLOPT_SSL_VERIFYPEER => true,
CURLOPT_SSL_VERIFYHOST => 2,
CURLOPT_HTTPHEADER => array(
'Tus-Resumable: 1.0.0',
'Accept: application/vnd.vimeo.*+json;version=3.4',
'User-Agent: vimeo.php 3.0.8; (http://developer.vimeo.com/api/docs)',
'Authorization: Bearer [token]'
)
));
// Separate the header from the body.
$headerSize = curl_getinfo($curl)['header_size'];
$headers = substr($result, 0, $headerSize);
$body = substr($result, $headerSize);
curl_close($curl);
I had some trouble getting this to work initially, maybe it will save someone some time guessing. I'm leaving this here as a sample for anyone else who may need this in the future.
from vimeo.php.
Related Issues (20)
- stats.plays is at null HOT 1
- Can't upload subtitles via API HOT 4
- Not able to upload video from my local computer
- Chapters API HOT 2
- Unable to upload video from URL HOT 4
- Configurable return parameters - upload function
- Your Composer dependencies require a PHP version “>= 8.0.2”. You are running 8.0.0
- About Video Editor API from Vimeo HOT 1
- Doesn't upload on Windows due to bug in tus-php
- hidden videos in showcase not returned with api HOT 7
- Consistently 502 Bad Gateway in every request HOT 2
- `body.upload.upload_link` is null sometimes
- I like this. Ideally we would use Gson versions (which would map to the API version) in addition to this. Then only invalidate the cache if we know there will be a breaking change. This would also help us a bit with any other persistence (like turnstile). HOT 1
- Unable to Get Local Issuer Certificate HOT 8
- Can't upload videos since few days HOT 4
- Download Texttrack HOT 1
- got an error while trying to get video urls HOT 1
- Drupal 9 on PHP 8 Symfony/console incompatability issue (Interim transition issues between PHP 7 and 8 on Drupal 9) HOT 8
- SSL certificate problem: certificate has expired HOT 10
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 vimeo.php.