GithubHelp home page GithubHelp logo

vimeo_me2's People

Contributors

bo-oz avatar cluster444 avatar emcousin avatar glappen avatar golov avatar hipsterelitist avatar jamiew avatar kuchitama avatar narkoz avatar prestidigitation avatar quadule avatar rxcor avatar tcmacdonald avatar unplugandplay avatar wulffeld avatar yuyuvn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

vimeo_me2's Issues

VimeoMe2::RequestFailed

I am uploading video on vimeo . Video get uploaded on vimeo successfully but while return request
I got error "VimeoMe2::RequestFailed (Something went wrong)" .

Script :

vimeo_client = VimeoMe2::User.new('1254fg7856')
data_url = vimeo_client.upload_video(video_file)

More_detail_error :

PATCH https://api.vimeo.com/videos/223757270455   

204 No Content
Completed 500 Internal Server Error in 352036ms
VimeoMe2::RequestFailed (Something went wrong)

Thanks In Advance .

Replace a video

Is it possible to have a functionality that would replace the source file of given video?

Please find the picture of documentation attached.

Screen Shot 2019-03-15 at 10 00 26 AM

No tests

Time to add some :)

What is the state-of-the-art for remote HTTP request mocking? Is it still VCR and family?

Please add a gem to rubygems.org

Please upload a ruby gem to rubygems.org as an alternative way to install this library. The README suggests to install the gem using the git repository, but this has some drawbacks, namely:

  1. Pinning an exact tested and released version in Gemfile.lock
  2. Auto-updating to new tested and released versions as they are vetted and distributed

Adding releases to rubygems.org would still allow existing users to install using git if they prefer.

Thanks for the nice package!

Error to upload files to vimeo

EXAMPLE:
file = File.open("#{Rails.root}/public/recording/test/video.mp4")
@token = Rails.application.credentials.dig(:vimeo, :token)
@vimeo_client = VimeoMe2::User.new(@token)
@vimeo_client.upload_video(file)

the video is uploaded but return error.

Something went wrong

To continue, contact our support team (make sure you have your IP address), and mention code W4A0F6.

Upload raising VimeoMe2::RequestFailed exception but the video is uploaded

Hi!

Recently the upload feature broke in the application I'm working on and after some debugging I discovered that the model on my app that stores the video is not being created (since I make a check for not creating it in case VimeoMe2::RequestFailed is raised) but the video does upload to vimeo when I check on my account via web browser.

The error message that comes from the exception is: "Please add a custom logo to your account."

I would love to help solving this, if anyone could me give clues or pointers on what is going on, I can start working on a PR.

Thanks in advance!

EDIT: While I'm still debugging here, I'll add more info about the problem to see if it helps.
The exception object has the following attributes after the raise:
e.status == "Bad Request"
e.error == 400
e.message == "Please add a custom logo to your account."
e.ratelimit == {"limit"=>"500", "remaining"=>"492", "reset"=>"2020-08-05T19:18:47+00:00"}

Since the error code is 400, I suppose it falls in one of the 'raise' calls on the http_request.rb file in the validate_response! method.
However, the fact that the request is returning code 400 but the video is actually being uploaded is really weird.

"\x84" from ASCII-8BIT to UTF-8 during upload_file

Hello,

I started having this issue recently and no longer can upload files to my vimeo account using the API. The code basically looks like this:

vimeo_client = VimeoMe2::User.new(Rails.application.config.vimeo_token)                                                                                                                                    
vid_id = vimeo_client.upload_video(video_file)

The error I get is "Encoding::UndefinedConversionError: "\x84" from ASCII-8BIT to UTF-8. Here is the stack trace:

activesupport (5.1.6) lib/active_support/core_ext/object/json.rb:36:in `encode'
activesupport (5.1.6) lib/active_support/core_ext/object/json.rb:36:in `to_json'
activesupport (5.1.6) lib/active_support/core_ext/object/json.rb:36:in `to_json'
activesupport (5.1.6) lib/active_support/json/encoding.rb:55:in `to_json'
/usr/local/lib/ruby/2.4.0/json/common.rb:224:in `generate'
/usr/local/lib/ruby/2.4.0/json/common.rb:224:in `generate'
activesupport (5.1.6) lib/active_support/json/encoding.rb:100:in `stringify'
activesupport (5.1.6) lib/active_support/json/encoding.rb:33:in `encode'
activesupport (5.1.6) lib/active_support/json/encoding.rb:20:in `encode'
activesupport (5.1.6) lib/active_support/core_ext/object/json.rb:39:in `to_json'
/gems/2.4.1/bundler/gems/vimeo_me2-6960e41a4a5a/lib/vimeo_me2/http/http_request.rb:72:in `http_request'
/gems/2.4.1/bundler/gems/vimeo_me2-6960e41a4a5a/lib/vimeo_me2/http/http_request.rb:21:in `make_http_request'
/gems/2.4.1/bundler/gems/vimeo_me2-6960e41a4a5a/lib/vimeo_me2/base.rb:36:in `request'
/gems/2.4.1/bundler/gems/vimeo_me2-6960e41a4a5a/lib/vimeo_me2/base.rb:16:in `block (2 levels) in <class:VimeoObject>'
/gems/2.4.1/bundler/gems/vimeo_me2-6960e41a4a5a/lib/vimeo_me2/user/upload.rb:57:in `start_upload'
/gems/2.4.1/bundler/gems/vimeo_me2-6960e41a4a5a/lib/vimeo_me2/user/upload.rb:34:in `handle_upload'
/gems/2.4.1/bundler/gems/vimeo_me2-6960e41a4a5a/lib/vimeo_me2/user/upload.rb:11:in `upload_video'
app/models/component.rb:56:in `upload_hosted_file'

video_file is a ActionDispatch::Http::UploadedFile with content-type "video/mp4". Any idea why this would stop working, or if there is another way to accomplish the upload? Thank you very much for any help, and for making this gem in the first place - it is very helpful.

Greg

Something strange occurred in PullUpload

Hi everyone,

I am getting VimeoMe2::RequestFailed, Something strange occurred. Please try again. Here is my story:
I was using the vimeo_client.pull_upload with no problem, I made an new vimeo app with API 3.4 and updated the vimeo_me2 to 1.2 . and it refuses to go through the upload process and in vimeo_me2/http/http_request.rb:24 the request returns the following :
{"error":"Something strange occurred. Please try again.","link":null,"developer_message":"To access upload features for API version 3.4 when your app defaults to a different API version, include the Accept header with your request, and set its value to 3.4. For more details, see our versioning documentation at https://developer.vimeo.com/api/common-formats#versioning.","error_code":3116}
Everything seems ok, wonder what's causing this...

Thank you ...

upload_video no longer returns the new video id

Here's my code that was working after I submitted last pull request:

def upload_hosted_file                                                                                                                                                                                         
      if video_file                                                                                                                                                                                                
        vimeo_client = VimeoMe2::User.new(Rails.application.config.vimeo_token)                                                                                                                                    
        vid_id = vimeo_client.upload_video(video_file)                                                                                                                                                             
        update_column(:vimeo_video_id, vid_id)                                                                                                                                                                     
      end                                                                                                                                                                                                          
    end  

It now seems that upload_video(video_file) returns nil instead of the video id. I see that the upload_video implementation changed, so is there a new way to get the video id now?

vimeo_me2 1.20 not working with Vimeo API 3.4 ?

Hello,
Thank you for this great gem :)
I use the gem 1.20 version with Vimeo API 3.4, but I get an error from Vimeo when trying to post a video : Error: Something strange occurred. Please try again.
The error disappear when I force the API version to 3.2.

Code to reproduce the error :

begin
    vimeo = VimeoMe2::VimeoObject.new(VIMEO_TOKEN) # default api_version = 3.4
    vimeo_response = vimeo.post('/me/videos', body: { type: 'pull', link: url }.to_query)
rescue VimeoMe2::RequestFailed => error
    Rails.logger.info "Unable to create Vimeo video: #{error.message}" # Error: Something strange occurred. Please try again.
end

Code to skip the error :

begin
    vimeo = VimeoMe2::VimeoObject.new(VIMEO_TOKEN, '3.2') # force api_version
    vimeo_response = vimeo.post('/me/videos', body: { type: 'pull', link: url }.to_query)
rescue VimeoMe2::RequestFailed => error
    Rails.logger.info "Unable to create Vimeo video: #{error.message}" # No more error
end

EDIT : I use Ruby 2.2.3 and Rails 3.2.22

Follow Users is not working

Follow users method is not working. Somehow the request is not formatted correctly. Anyone know how to properly format an array of user URI's to put in the body of the POST request?

Set domains

Hi!
Thanks in advance for this gem, it is very helpful. But I have a question, I can't configure the whitelisted domains, it's the only parameter that I can't edit, or even consult. Is it possible to perform that operation with this gem?
Regards!
Álvaro

Video Upload not working?

I'm using the upload code provided on the README (Utilizing an upload form in Rails), but from some time until now it has stopped working.

I've put a puts e command inside the rescue VimeoMe2::RequestFailed => e exception rescue block and this is what it shows me upon trying to upload a new video:

image

Everything was working fine a few days ago. No changes were made in the vimeo API, as far as I'm concerned (double-checked the changelog today)

switching to ruby 3.0.0 brings new error

[3] pry(#)> vimeo_video = vimeo_client.upload_video(self.video_file)
ArgumentError: wrong number of arguments (given 2, expected 0..1)
from /Users/dk/.rvm/gems/ruby-3.0.0@services/bundler/gems/vimeo_me2-3296c6ba08cf/lib/vimeo_me2/base.rb:27:in `request'

while in ruby 2.6.5 it works fine

what could be broken on the code? I didn't find any clue yet...

Rails Server not starting after Installing the gem

Hello!

I'm using the gem with docker and docker compose.
My rails version is 3.2.13.
My ruby version is 2.1.2.

After installing the gem as the README suggests, (which doesn't install at the first bundle install, I have to enter the container and do it again manually) I get the following error message after attempting to start the rails server:

rake aborted!
/usr/local/lib/ruby/gems/2.1.0/bundler/gems/vimeo_me2-6d09c58acf06/lib/vimeo_me2/user/upload.rb:52: syntax error, unexpected ':', expecting =>
 ...     headers = {'Content-Type': 'application/offset+octet-st...
 ...                               ^
 /usr/local/lib/ruby/gems/2.1.0/bundler/gems/vimeo_me2-6d09c58acf06/lib/vimeo_me2/user/upload.rb:52: syntax error, unexpected '}', expecting keyword_end
 /rails_app/config/application.rb:9:in `<top (required)>'
 /rails_app/Rakefile:5:in `require'
 /rails_app/Rakefile:5:in `<top (required)>'
 (See full trace by running task with --trace)

Apparently this has been solved in this commit of one of the repo's forks:
BarefootCoders@aa695e0

Any chance to integrate this to the master?

Change name of video at the time of upload

This line defaults the name of uploaded video to video.mp4

video = File.open('video.mp4')
vimeo_client.upload_video(video)

One way to change it now is by updating after upload using
vimeo_video.name = "New name"

Is it possible to give a name to it at the time of upload? Something like
vimeo_client.upload_video(video, "New name")

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.