Hi,

Unbreaks it again, after another change on YouTube.


Index: Makefile
===================================================================
RCS file: /cvs/ports/www/p5-WWW-YouTube-Download/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- Makefile    31 Jul 2011 18:09:57 -0000      1.2
+++ Makefile    4 Aug 2011 16:29:58 -0000
@@ -4,6 +4,7 @@
 
 MODULES =      cpan
 DISTNAME =     WWW-YouTube-Download-0.27
+REVISION =     0
 CATEGORIES =   www
 
 MAINTAINER =   Mikolaj Kucharski <miko...@kucharski.name>
Index: patches/patch-lib_WWW_YouTube_Download_pm
===================================================================
RCS file: 
/cvs/ports/www/p5-WWW-YouTube-Download/patches/patch-lib_WWW_YouTube_Download_pm,v
retrieving revision 1.1
diff -u -r1.1 patch-lib_WWW_YouTube_Download_pm
--- patches/patch-lib_WWW_YouTube_Download_pm   31 Jul 2011 18:09:57 -0000      
1.1
+++ patches/patch-lib_WWW_YouTube_Download_pm   4 Aug 2011 16:29:58 -0000
@@ -6,8 +6,19 @@
 - youtu.be shortener support
 
 --- lib/WWW/YouTube/Download.pm.orig   Sun May 29 15:32:20 2011
-+++ lib/WWW/YouTube/Download.pm        Sat Jul 30 22:44:24 2011
-@@ -170,9 +170,17 @@ sub _get_args {
++++ lib/WWW/YouTube/Download.pm        Thu Aug  4 17:21:02 2011
+@@ -131,8 +131,8 @@ sub _fetch_video_url_map {
+     local $Carp::CarpLevel = $Carp::CarpLevel + 1;
+ 
+     my $args        = $self->_get_args($content);
+-    my $fmt_url_map = _parse_fmt_url_map($args->{fmt_url_map});
+-    my $fmt_map     = _parse_fmt_map($args->{fmt_map});
++    my $fmt_url_map = _parse_fmt_url_map($args->{url_encoded_fmt_stream_map});
++    my $fmt_map     = _parse_fmt_map($args->{fmt_list});
+ 
+     my $video_url_map = +{
+         map {
+@@ -170,17 +170,28 @@ sub _get_args {
              $data = JSON->new->utf8(1)->decode($json);
              last;
          }
@@ -26,7 +37,21 @@
  }
  
  sub _parse_fmt_url_map {
-@@ -214,13 +222,16 @@ sub _suffix {
+     my $param = shift;
+     my $fmt_url_map = {};
+-    for my $stuff (split ',', $param) {
+-        my ($fmt, $playback_url) = split '\|', $stuff, 2;
+-        $fmt_url_map->{$fmt} = $playback_url;
++
++    foreach my $opt (split ',', $param) {
++      my $stuff = uri_unescape($opt);
++        if ($stuff =~ m/^url=(.*)&itag=(\d+)$/) {
++            $fmt_url_map->{$2} = $1;
++        }
+     }
+ 
+     return $fmt_url_map;
+@@ -214,13 +225,16 @@ sub _suffix {
  
  sub _video_id {
      my $stuff = shift;


-- 
best regards
q#

Reply via email to