1 # (c) 2008 by Ralf Ertzinger <ralf@camperquake.de>
2 # licensed under GNU GPL v2
4 # Grabber for motherless.com
6 # written by Maximilian Rehkopf <otakon at gmx dot net>
8 package videosite::MotherlessGrabber;
10 use videosite::GrabberBase;
11 @ISA = qw(videosite::GrabberBase);
20 my $self = $class->SUPER::new(
22 _SELFTESTURL => 'http://motherless.com/4976432',
23 _SELFTESTTITLE => 'Teen masturbation in shower',
24 PATTERNS => ['(http://(?:[-a-zA-Z0-9_.]+\.)*motherless.com/([a-zA-Z0-9]+))'],
28 return bless($self, $class);
47 $metadata->{'URL'} = $url;
48 $metadata->{'ID'} = $2;
49 $metadata->{'TYPE'} = 'video';
50 $metadata->{'SOURCE'} = $self->{'NAME'};
51 $metadata->{'TITLE'} = undef;
52 $metadata->{'DLURL'} = undef;
54 unless(defined($content = $self->simple_get(sprintf("http://motherless.com/%s", $2), $ua))) {
55 $self->error('Could not download page');
59 $p = HTML::TokeParser->new(\$content);
62 while ($tag = $p->get_tag('meta', 'script')) {
63 if (('meta' eq $tag->[0]) and ($tag->[1]->{'name'}) and ($tag->[1]->{'name'} eq 'description')) {
64 $metadata->{'TITLE'} = $tag->[1]->{'content'};
65 } elsif ('script' eq $tag->[0]) {
66 my $t = $p->get_text();
68 if ($t =~ m|__fileurl = '(.*)';|) {
69 $self->debug("Found fileurl: %s", $1);
70 $metadata->{'DLURL'} = $1;
75 unless(defined($metadata->{'DLURL'}) && defined($metadata->{'TITLE'})) {
76 $self->error('Could not extract download URL and title');