Class: Anstaendig::DokuStreamAgent

Inherits:
AbstractAgent show all
Defined in:
lib/anstaendig/agents/dokustream.rb

Overview

Agent for anstaendig to download videos from dokustream.org.

Instance Attribute Summary

Attributes inherited from AbstractAgent

#filename, #url

Instance Method Summary collapse

Methods inherited from AbstractAgent

#recode, #rip, #run, #userAgent

Constructor Details

#initialize(uri, quality) ⇒ DokuStreamAgent



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/anstaendig/agents/dokustream.rb', line 6

def initialize( uri, quality )
  require( 'open-uri' )

  doc = open( uri.to_s ).readlines

  title = doc.to_s.match( /<title>DokuStream - (.*)<\/title>/ )[1]
  id = uri.to_s.match( /id\/([0-9]*)/ )[1]

  @filename = title + '.avi'
  @url = "http://sv01.dokustream.org/stream-video.php?id=" + id
end