1

I want to extract images from Vimeo videos pages. I have already gone through these links

C# regex to get video id from youtube and vimeo by url

Get img thumbnails from Vimeo?

Using jquery to dynamically load Vimeo videos

and with the help of above links I am upto this regex: vimeo.com/(?:.#|./videos/)?([0-9]+)

I am able to resolve video id (which I need to extract thumbnails) via above regex for these urls

http://vimeo.com/channels/hd#11384488

http://vimeo.com/groups/brooklynbands/videos/7906210

http://vimeo.com/staffpicks#13561592

http://vimeo.com/834881

but I am not able to get id for these type of urls:

http://vimeo.com/videoschool/lesson/20/make-a-great-holiday-video

http://vimeo.com/videoschool/lesson/38/video-101-adding-text-and-titles-with-imovie

These urls don't even contain the video id information. How can I extract video id from this? Is there any other way by which I can extract thumbnails of vimeo video by providing url?

Community
  • 1
  • 1
Rocky Singh
  • 15,128
  • 29
  • 99
  • 146

1 Answers1

1

You'd have to crawl the URL and parse the video id from the HTML. It's in there a bunch of times, but one way would be to grab it from the id of one of the <div> tags that surrounds the video. For that last URL you posted it looks like this:

<div id="player_17861379_1698442974" class="f player">

The first string of numbers between underscore characters is the video id. You can parse it from the HTML with a regex like:

<div[^<]+?id="player_(\d+?)_

Which should give you 17861379. This same video without the article is at http://vimeo.com/17861379.

Kevin Collins
  • 1,453
  • 1
  • 10
  • 16