Dear maintainer,
attached you'll find a refreshed version of my patch from [0], which is by now
also featuring a DEP-3 header. Please consider including the patch in the
package's debian/patches directory or, even better, forward this patch to the
upstream developers.
If you should prefer a Debdiff or some other format for this patch, please let
me know.

Kind regards,
Kai Wasserbäch


[0] http://bugs.debian.org/557114#15



-- 

Kai Wasserbäch (Kai Wasserbaech)

E-Mail: [email protected]
Jabber (debianforum.de): Drizzt
URL: http://wiki.debian.org/C%C3%B9ran
GnuPG: 0xE1DE59D2      0600 96CE F3C8 E733 E5B6 1587 A309 D76C E1DE 59D2
(http://pgpkeys.pca.dfn.de/pks/lookup?search=0xE1DE59D2&fingerprint=on&hash=on&op=vindex)
Subject: Patch to add Blip.tv support to clive.
Author: Kai Wasserbäch <[email protected]>
Bug-Debian: http://bugs.debian.org/557114
Forwarded: no
Last-Update: 2010-04-06
---
 lib/clive/Host/Bliptv.pm |   77 +++++++++++++++++++++++++++++++++++++++++++++++
 lib/clive/HostFactory.pm |    1 
 2 files changed, 78 insertions(+)

Index: b/lib/clive/Host/Bliptv.pm
===================================================================
--- /dev/null
+++ b/lib/clive/Host/Bliptv.pm
@@ -0,0 +1,77 @@
+# -*- coding: utf-8 -*-
+###########################################################################
+# clive, command line video extraction utility.
+#
+# Copyright © 2009-2010 Kai Wasserbäch <[email protected]>
+#
+# This file is part of clive.
+#
+# clive is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option)
+# any later version.
+#
+# clive is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see <http://www.gnu.org/licenses/>.
+###########################################################################
+package clive::Host::Bliptv;
+
+use warnings;
+use strict;
+
+sub new {
+    return bless( {}, shift );
+}
+
+sub parsePage {
+    my ( $self, $content, $props ) = @_;
+
+    $$props->video_host("bliptv");
+
+    my %re = ( id =>
+            qr|player\.setPermalinkUrl\("http://blip\.tv/file/view/(.*?)\?referrer=blip.tv&source=1"\);|,
+            xurl =>
+            qr|player\.setPrimaryMediaUrl\("(.*?)"\);|,
+    );
+
+    my $tmp;
+    if ( clive::Util::matchRegExps( \%re, \$tmp, $content ) == 0 ) {
+            my $config = clive::Config->instance->config;
+            my $xurl;
+
+            # In case we want the best quality
+            if ( $config->{format} eq "best" ) {
+                    use HTML::TokeParser;
+                    my $parser = HTML::TokeParser->new($content);
+
+                    while (my $token = $parser->get_tag("option")) {
+                            my $value = $token->[1]{value} || "-";
+                            my $text  = $parser->get_trimmed_text("/option");
+                            if( $value =~ /^\/file\/(.*?)$/ and
+                                    $text =~ /^Source(.*?)$/ ) {
+                                    my @filename = split( /=/, $value);
+                                    $xurl = "http://blip.tv/file/get/"; . $filename[1];
+                            }
+                    }
+            }
+            else { # in all other case use the user selected quality (via passed
+                   # URL).
+                    $xurl = $tmp->{xurl};
+            }
+
+            $$props->video_id($tmp->{id});
+            $$props->video_link($xurl);
+
+            return (0);
+    }
+    return (1);
+}
+
+1;
+
+# Your life will set with the sun.
Index: b/lib/clive/HostFactory.pm
===================================================================
--- a/lib/clive/HostFactory.pm
+++ b/lib/clive/HostFactory.pm
@@ -44,6 +44,7 @@ my @_hosts = (
     [ "Funnyhub",  qr|funnyhub.com|i,  "flv" ],
     [ "Myubo",     qr|myubo.com|i,     "flv" ],
     [ "Buzzhumor", qr|buzzhumor.com|i, "flv" ],
+    [ "Bliptv", qr|blip.tv|i, "flv|mov|3gp|m4v" ],
 );
 
 sub new {

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to