Veoh and the 5 minute limit
I am a big fan of those Web 2.0 mashups like Youtube, Veoh, Divx Stage 6 and so on.
Recently Veoh cut back the playtime of their videos down to 5 minutes if it exeeded 20 minutes in total. Their main goal here was to propagate their ,,Veoh TV Player''. Well after a quick try with my Wine (yes, there is no Linux version available) I gave that idea quickly up and continued to search a bit.
Seems as there are still means to get the video out of their cache. Originally this little hack was introduced here which gave me the incentive to write the following little script. Lets say you want to watch some CCC Videos without playing around with Google webbits. For instance here is a video about Botnet Detection and Mitigation which is quite interesting but again it's limited to 5 minutes due to its longer duration.
First, we need to extract the permalink ID which is the last part of the URL - here it would be ,,v262945dCjc4CJs''. Utilizing this we can extract the original video hash and extension via this nifty trick.
Just call this URL - http://www.veoh.com/rest/video/PERMALINKID/details with the permalink ID embedded into it to get necessary values. There we can find the necessary data to complete this URL - http://p-cache.veoh.com/cache/external/ORIGINALHASHORIGEXTENSION - which actually points to a downloadable video file. Nice !
Lets see how the final script works...
So much for that problem :)
Here the little Ruby script:
I wrote it with clarity in mind so I am sure you can golf it shorter. :)
For you people out there who are into shell oneliners, here is one...
Recently Veoh cut back the playtime of their videos down to 5 minutes if it exeeded 20 minutes in total. Their main goal here was to propagate their ,,Veoh TV Player''. Well after a quick try with my Wine (yes, there is no Linux version available) I gave that idea quickly up and continued to search a bit.
Seems as there are still means to get the video out of their cache. Originally this little hack was introduced here which gave me the incentive to write the following little script. Lets say you want to watch some CCC Videos without playing around with Google webbits. For instance here is a video about Botnet Detection and Mitigation which is quite interesting but again it's limited to 5 minutes due to its longer duration.
First, we need to extract the permalink ID which is the last part of the URL - here it would be ,,v262945dCjc4CJs''. Utilizing this we can extract the original video hash and extension via this nifty trick.
Just call this URL - http://www.veoh.com/rest/video/PERMALINKID/details with the permalink ID embedded into it to get necessary values. There we can find the necessary data to complete this URL - http://p-cache.veoh.com/cache/external/ORIGINALHASHORIGEXTENSION - which actually points to a downloadable video file. Nice !
Lets see how the final script works...
% ./Downloader.rb http://www.veoh.com/videos/v262945dCjc4CJs
--01:13:35-- http://p-cache.veoh.com/cache/external/1df8cd077cde7650567d07e11e8e3ecfba1d3327.mp4
=> `1df8cd077cde7650567d07e11e8e3ecfba1d3327.mp4'
[..]
So much for that problem :)
Here the little Ruby script:
% cat Downloader.rb
#!/usr/bin/ruby -w
#
# (c) 2007, Bjoern Rennhak
# Ideas originally taken from http://board.alluc.org/viewtopic.php?pid=400997 .
#
# This code is released under GNU GPL v2.
#
require 'net/http'
require 'rexml/document'
( puts "Usage: #{$PROGRAM_NAME} [Veoh Permalink ID | Full URL]" and exit ) if( ARGV.empty? )
( ARGV[0] =~ %r{^http}i ) ? ( pLinkID = ARGV[0].gsub(/.*\/(.+)$/,'\1') ) : ( pLinkID = ARGV[0] )
detailsURL = "http://www.veoh.com/rest/video/#{pLinkID}/details"
xml = Net::HTTP.get_response( URI.parse(detailsURL) ).body
( REXML::Document.new(xml) ).elements.each('videos/video') do |e|
@origExtension, @originalHash = e.attributes['origExtension'], e.attributes['originalHash']
end
`wget http://p-cache.veoh.com/cache/external/#{@originalHash}#{@origExtension}`
I wrote it with clarity in mind so I am sure you can golf it shorter. :)
For you people out there who are into shell oneliners, here is one...
% awk -v id=v262945dCjc4CJs -- '{ system("lynx -dump http://www.veoh.com/rest/video/"id"/details"); exit }' | egrep "origExtension|originalHash" | xargs | sed 's!.*=\(.*\) .*=\(\..*\)!wget http://p-cache.veoh.com/cache/external/\1\2!g'
2 comments
Comments
-
this method doesnt work now. Veoh blocks it.
-
Hi there, thanks for the info, I will see if I can find another way to download the videos. Keep you posted !