Skip to content

Commit

Permalink
Add support for Vimeo Channels
Browse files Browse the repository at this point in the history
  • Loading branch information
0mega committed Nov 12, 2014
1 parent 2c71c06 commit a8d1ee3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/video_info/providers/vimeo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def _video
end

def _url_regex
/.*\.com\/(?:(?:groups\/[^\/]+\/videos\/)|(?:ondemand\/less\/)|(?:video\/))?([0-9]+).*$/
/.*\.com\/(?:(?:groups\/[^\/]+\/videos\/)|(?:ondemand|channels)(?:(?:\/less\/)|(?:\/\w*\/))|(?:video\/))?([0-9]+).*$/
end

def _api_base
Expand Down
12 changes: 12 additions & 0 deletions spec/lib/video_info/providers/vimeo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
it { is_expected.to be_truthy }
end

context "with Vimeo Channels url" do
let(:url) { 'https://vimeo.com/channels/any_channel/111431415' }
it { is_expected.to be_truthy }
end

context "with vimeo album url" do
let(:url) { 'http://vimeo.com/album/2755718' }
it { is_expected.to be_falsey }
Expand Down Expand Up @@ -203,4 +208,11 @@
its(:video_id) { should eq '101677664' }
end

context "with video 111431415 in /channels/*/ url", :vcr do
subject { VideoInfo.new('https://vimeo.com/channels/some_channel1/111431415') }

its(:provider) { should eq 'Vimeo' }
its(:video_id) { should eq '111431415' }
end

end

0 comments on commit a8d1ee3

Please sign in to comment.