LA7 download movie-ruby


This is a ruby program I found online (http://thedarkgod.wordpress.com/2011/10/22/downloading-videos-from-la7-tv/). by downloading the video you have the ability to skip comercials and fastforward the view:

here is the ruby code by Matteo:


#!/usr/bin/env ruby

require 'uri'
require 'net/http'
require 'rexml/document'

# Constants
LA7TV_URL = 'www.la7.tv'
DESCRIPTOR_URL = 'http://www.la7.tv/repliche/content/index.php?contentId=%s'
ARCHIVE_URL = 'rtmp://yalpvod.alice.cdn.interbusiness.it:1935/vod/%s'

if ARGV.empty? or not ARGV[0].include? LA7TV_URL
$stderr.puts <<-EOD
This script downloads videos from http://www.la7.it, for your personal use only.
The idea is that you can watch what you see online for free, but offline too.
Please be sensible and don't use this method for breaking the law.

Please make sure rtmpdump is installed.

Usage: #{$0}
EOD
exit -1
end

asset_number = ARGV[0].split('assetid=')[1]
xmldoc = Net::HTTP.get URI.parse(sprintf DESCRIPTOR_URL, asset_number)
xml = REXML::Document.new xmldoc
videos = REXML::XPath.match(xml, '*/videos/video')
video = videos.max_by { |video| video.elements['quality'].text.to_i }

local_filename = video.elements['originalName'].text
remote_filename = video.elements['fms'].text.gsub(/^mp4:\//, '')
remote_url = sprintf ARCHIVE_URL, remote_filename

puts "Downloading #{local_filename}\n\tfrom #{remote_url}"
Kernel.exec "rtmpdump -e -o '#{local_filename}' -r '#{remote_url}'"

How to:
1-Copy and paste the script into a text file. name it : la7.rb
2. Copy the url of the show/episode you want to see.
3. in the terminal run :
./la7.rb your_url_pasted_here
4. enjoy

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s