anstaendig 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
  == Installation
4
4
 
5
- gem build anstaendig.gemspec
6
- sudo gem install anstaendig-*.gem
5
+ * gem build anstaendig.gemspec
6
+ * sudo gem install anstaendig-*.gem
7
7
 
data/bin/anstaendig CHANGED
@@ -20,13 +20,13 @@ def usageMessage
20
20
  $stderr << "#{File.basename( $0 )} [options] <url>
21
21
  Download videos from video streaming sites.
22
22
 
23
- -h This help.
24
- -l List available agents.
25
- -m Keep mess (do not clean up on Interrupt).
26
- -o name File to save the video to.
27
- -q quality Quality of the video.
28
- -r Recode to Theora/Vorbis.
29
- -s Only show stream URL.
23
+ -h This help.
24
+ -l List available agents.
25
+ -m Keep mess (do not clean up on Interrupt).
26
+ -o <name> File to save the video to.
27
+ -q <quality> Quality of the video.
28
+ -r Recode to Theora/Vorbis.
29
+ -s Only show stream URL.
30
30
 
31
31
  "
32
32
  exit( 1 )
@@ -1,11 +1,5 @@
1
1
  module Anstaendig
2
2
  # Agent for anstaendig to download videos from the 3sat media center.
3
- #
4
- # Author:: henning mueller (mailto:henning@orgizm.net)
5
- # Copyright:: Copyright (c) 2010 henning mueller
6
- # License:: Beerware
7
-
8
- # 3sat agent class inherits from agent interface.
9
3
  class DreiSatAgent < AbstractAgent
10
4
  AGENTS[ 'www.3sat.de' ] = self
11
5
 
@@ -1,11 +1,5 @@
1
1
  module Anstaendig
2
2
  # Agent for anstaendig to download videos from the ARD media center.
3
- #
4
- # Author:: henning mueller (mailto:henning@orgizm.net)
5
- # Copyright:: Copyright (c) 2010 henning mueller
6
- # License:: Beerware
7
-
8
- # ARD agent class inherits from agent interface.
9
3
  class ArdAgent < AbstractAgent
10
4
  AGENTS[ 'www.ardmediathek.de' ] = self
11
5
 
@@ -1,17 +1,5 @@
1
1
  module Anstaendig
2
2
  # Agent for anstaendig to download videos from the arte media center.
3
- #
4
- # Author:: henning mueller (mailto:henning@orgizm.net)
5
- # Copyright:: Copyright (c) 2010 henning mueller
6
- # License:: Beerware
7
-
8
- #
9
- # TODO
10
- # This extracts the correct filename and url, but the stream ripping dies
11
- # somehow after a few minutes.
12
- #
13
-
14
- # arte agent class inherits from agent interface.
15
3
  class ArteAgent < AbstractAgent
16
4
  AGENTS[ 'videos.arte.tv' ] = self
17
5
 
@@ -23,6 +11,8 @@ module Anstaendig
23
11
 
24
12
  doc = open( uri.to_s ).readlines
25
13
 
14
+ @swfurl = doc.grep( /^<embed/ )[0].match( /\"(.*)\"/ )[1]
15
+
26
16
  doc = Nokogiri::XML( open(
27
17
  doc.grep( /vars_player\.videorefFileUrl/ )
28
18
  .first.match( /(http.*xml)/ )[1]
@@ -34,7 +24,7 @@ module Anstaendig
34
24
  end
35
25
  end
36
26
 
37
- @filename = doc.xpath( '//name' ).first.text + '.wmv'
27
+ @filename = doc.xpath( '//name' ).first.text + '.flv'
38
28
 
39
29
  case( quality )
40
30
  when :hd, :high, :default
@@ -45,5 +35,10 @@ module Anstaendig
45
35
  raise( NoSuchQualityException )
46
36
  end
47
37
  end
38
+
39
+ # Ripping arte clips no longer works with mplayer :(.
40
+ def rip
41
+ `rtmpdump -W "#{@swfurl}" -r "#{@url}" -o "#{@filename}"`
42
+ end
48
43
  end
49
44
  end
@@ -1,11 +1,5 @@
1
1
  module Anstaendig
2
2
  # Agent for anstaendig to download videos from the ZDF media center.
3
- #
4
- # Author:: henning mueller (mailto:henning@orgizm.net)
5
- # Copyright:: Copyright (c) 2010 henning mueller
6
- # License:: Beerware
7
-
8
- # ZDF agent class inherits from agent interface.
9
3
  class ZdfAgent < AbstractAgent
10
4
  AGENTS[ 'www.zdf.de' ] = self
11
5
 
@@ -40,7 +34,6 @@ module Anstaendig
40
34
  @filename = doc.xpath( '//h1[@class="beitragHeadline"]' ).inner_text + '.wmv'
41
35
 
42
36
  doc = Nokogiri::HTML( open( uri ) )
43
- # @url = doc.xpath( '//ref' ).attr( 'href' )
44
37
  @url = doc.to_s.match( /(mms.*wmv)/ )[0]
45
38
  end
46
39
  end
data/lib/anstaendig.rb CHANGED
@@ -1,9 +1,13 @@
1
1
  $:.unshift( File.dirname( __FILE__ ) )
2
2
 
3
- # The Anstaendig module includes an abstract agent class and all agents
4
- # implementing this.
3
+ # The Anstaendig module consists of the AbstractAgent class and media center
4
+ # site agents, which are implementing it.
5
+ #
6
+ # Author:: henning mueller (mailto:henning@orgizm.net)
7
+ # Copyright:: Copyright (c) 2010 henning mueller
8
+ # License:: Beerware
5
9
  module Anstaendig
6
- VERSION = '0.1.0'
10
+ VERSION = '0.1.1'
7
11
  end
8
12
 
9
13
  Dir.glob( $:.first + '/**/*.rb' ).sort.each do |file|
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anstaendig
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - henning mueller
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-05-31 00:00:00 +02:00
18
+ date: 2010-07-15 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21