vimeo / vimeo.js

Official Node.js library for the Vimeo API.
https://developer.vimeo.com
Apache License 2.0
267 stars 78 forks source link

Can't use the repo to upload any video. #150

Closed zydjohnHotmail closed 2 years ago

zydjohnHotmail commented 2 years ago

Hello: I have got my client_ID, client_secret and access token. And I want to upload one small MP4 video (20KB). But it is not working: D:\nodejs\vimeo>npm install vimeo

added 21 packages, and audited 22 packages in 7s

found 0 vulnerabilities

D:\nodejs\vimeo>npm list vimeo@1.0.0 D:\nodejs\vimeo `-- vimeo@2.1.1

D:\nodejs\vimeo>type upload_video1.js var Vimeo = require('vimeo').Vimeo; var client = new Vimeo('my_user_id', 'my_client_secrets', 'my_access_token'); client.upload( 'D:/Videos/TestUpload.mp4', function (uri) { console.log('File upload completed. Your Vimeo URI is:', uri) }, function (bytesUploaded, bytesTotal) { var percentage = (bytesUploaded / bytesTotal * 100).toFixed(2) console.log(bytesUploaded, bytesTotal, percentage + '%') }, function (error) { console.log('Failed because: ' + error) } )

D:\nodejs\vimeo>node upload_video1.js Failed because: Unable to initiate an upload. [Error: {"error":"Unable to upload video. Please get in touch with the app's creator.","link":null,"developer_message":"The authentication token is missing a user ID and must be provided when uploading a video.","error_code":8002}]

I have two questions: 1) I know the latest version is 3.4, but it seems npm install vimeo, the installed version is only 2.1.1. So, the NPM package is way out of date, please update the NPM package. The NPM package was dated in year 2018, more than 3 years ago! 2) The error message seems not correct, as in my javascript, I have provided all necessary information. Please advise! But I think if you can update the NPM package version, it may work!

aaronm67 commented 2 years ago

I know the latest version is 3.4, but it seems npm install vimeo, the installed version is only 2.1.1. So, the NPM package is way out of date, please update the NPM package. The NPM package was dated in year 2018, more than 3 years ago!

The library version and the API version don't align, the library should function correctly with the latest API version (3.4).

The error message seems not correct, as in my javascript, I have provided all necessary information.

You may reach out through the Vimeo support channels (https://vimeo.com/help/contact) - it looks like there may be an issue with the access token you're using - this error isn't related to the library.

zydjohnHotmail commented 2 years ago

Hello: Please show me some useful information in your PC, like: npm install vimeo npm list I can understand NPM version is different from API version, however, since the NPM was uploaded more than 3 years ago. Are you sure that all new features are including in the old NPM package? I open ticket for the support, but they also have similar issue.

aaronm67 commented 2 years ago

Yes - this package will support the latest version of the API. The error message your getting is from the API, not the library. You're successfully making an API request.

The access_token you're using (3rd parameter of the Vimeo constructor) isn't valid for uploading - you should ensure that this is a valid, authenticated access token, and that it has upload scope. You can align your support ticket around these questions (the access token specifically) and you may have more luck.