Remove broken cctv support and test
[clive.git] / lib / clive / Host / Ehrensenf.pm
blob93924625475f92d9414dda274b7e17919670668c
1 # -*- coding: ascii -*-
2 ###########################################################################
3 # clive, command line video extraction utility.
5 # Copyright 2009 Toni Gundogdu.
7 # This file is part of clive.
9 # clive is free software: you can redistribute it and/or modify it under
10 # the terms of the GNU General Public License as published by the Free
11 # Software Foundation, either version 3 of the License, or (at your option)
12 # any later version.
14 # clive is distributed in the hope that it will be useful, but WITHOUT ANY
15 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17 # details.
19 # You should have received a copy of the GNU General Public License along
20 # with this program. If not, see <http://www.gnu.org/licenses/>.
21 ###########################################################################
22 package clive::Host::Ehrensenf;
24 use warnings;
25 use strict;
27 use clive::Error qw(CLIVE_MARKEDBROKEN);
29 sub new {
30 return bless( {}, shift );
33 use constant MARKEDBROKEN_ERRMSG =>
34 "support marked as 'broken'. consider whipping up a patch to earn fame
35 error: and other users' undying gratitude.";
37 sub parsePage {
38 my ( $self, $content, $props ) = @_;
40 # Marked as "broken."
42 clive::Log->instance->err( CLIVE_MARKEDBROKEN, MARKEDBROKEN_ERRMSG );
43 return 1;
45 $$props->video_host("ehrensenf");
47 my %re = ( data => qr|<h2 class="gradient">(.*?)</h2>| );
49 my $tmp;
50 if ( clive::Util::matchRegExps( \%re, \$tmp, $content ) == 0 ) {
51 if ( $tmp->{data} =~ /(\d\d).(\d\d).(\d\d\d\d)/ ) {
52 my $id = "$3-$2-$1";
54 my $xurl = "http://www.ehrensenf.de/misc/load-balancing/lb.php?"
55 . "file=$id.flv";
57 $$props->video_id($id);
58 $$props->video_link($xurl);
60 return (0);
62 else {
63 clive::Log->instance->errn("could not match date string");
66 return (1);
71 # All along the watchtower.