diff --git a/www/p5-WWW-YouTube-Download/Makefile b/www/p5-WWW-YouTube-Download/Makefile index b3f481c3ec5..6bf9c9da50b 100644 --- a/www/p5-WWW-YouTube-Download/Makefile +++ b/www/p5-WWW-YouTube-Download/Makefile @@ -1,9 +1,9 @@ -# $OpenBSD: Makefile,v 1.1.1.1 2011/04/25 13:04:17 todd Exp $ +# $OpenBSD: Makefile,v 1.2 2011/07/31 18:09:57 landry Exp $ COMMENT = simple YouTube interface for downloading videos MODULES = cpan -DISTNAME = WWW-YouTube-Download-0.25 +DISTNAME = WWW-YouTube-Download-0.27 CATEGORIES = www MAINTAINER = Mikolaj Kucharski @@ -25,8 +25,4 @@ RUN_DEPENDS = www/p5-libwww \ converters/p5-JSON \ www/p5-HTML-Parser -post-extract: - find -d "${WRKDIST}" \ - -type d -name PaxHeader -exec rm -rf "{}" \; - .include diff --git a/www/p5-WWW-YouTube-Download/distinfo b/www/p5-WWW-YouTube-Download/distinfo index 810baebecf3..9e28ea21043 100644 --- a/www/p5-WWW-YouTube-Download/distinfo +++ b/www/p5-WWW-YouTube-Download/distinfo @@ -1,5 +1,5 @@ -MD5 (WWW-YouTube-Download-0.25.tar.gz) = UgUqbB7HlELHbxzITA++dA== -RMD160 (WWW-YouTube-Download-0.25.tar.gz) = zHboIL1aGQtTVt10IJAfBCVVK2E= -SHA1 (WWW-YouTube-Download-0.25.tar.gz) = fRtFJ0SdCxioddHqtpHMgJgKdj0= -SHA256 (WWW-YouTube-Download-0.25.tar.gz) = yKuFWa15eRJ130X838Tu8EnwSbH4A2KIhKGKAWNUuuQ= -SIZE (WWW-YouTube-Download-0.25.tar.gz) = 32739 +MD5 (WWW-YouTube-Download-0.27.tar.gz) = v6mPBdn69BVobk9lhbQCEQ== +RMD160 (WWW-YouTube-Download-0.27.tar.gz) = KS4KG2t5SlwgDmVSO6m6eztE6O8= +SHA1 (WWW-YouTube-Download-0.27.tar.gz) = GXaKGt/y+SYlH+bEdhWHrJ8Ozow= +SHA256 (WWW-YouTube-Download-0.27.tar.gz) = QOwsdvSFb2dckA/yt1NRhwyJTbKu3e2OWCu9un4hnns= +SIZE (WWW-YouTube-Download-0.27.tar.gz) = 31418 diff --git a/www/p5-WWW-YouTube-Download/patches/patch-Makefile_PL b/www/p5-WWW-YouTube-Download/patches/patch-Makefile_PL index 30808100d25..c919fe2a82b 100644 --- a/www/p5-WWW-YouTube-Download/patches/patch-Makefile_PL +++ b/www/p5-WWW-YouTube-Download/patches/patch-Makefile_PL @@ -1,8 +1,8 @@ +$OpenBSD: patch-Makefile_PL,v 1.2 2011/07/31 18:09:57 landry Exp $ Module::Install::AuthorTests is missing in ports tree, but not really essential. -$OpenBSD: patch-Makefile_PL,v 1.1.1.1 2011/04/25 13:04:17 todd Exp $ --- Makefile.PL.orig Tue Jan 4 15:17:14 2011 +++ Makefile.PL Mon Jan 10 22:22:02 2011 @@ -8,7 +8,6 @@ requires 'JSON'; diff --git a/www/p5-WWW-YouTube-Download/patches/patch-lib_WWW_YouTube_Download_pm b/www/p5-WWW-YouTube-Download/patches/patch-lib_WWW_YouTube_Download_pm new file mode 100644 index 00000000000..5aa397bb2b0 --- /dev/null +++ b/www/p5-WWW-YouTube-Download/patches/patch-lib_WWW_YouTube_Download_pm @@ -0,0 +1,46 @@ +$OpenBSD: patch-lib_WWW_YouTube_Download_pm,v 1.1 2011/07/31 18:09:57 landry Exp $ + +- unbreak after recent youtube changes +- error out when extracting JSON fails +- support for another url type +- 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 { + $data = JSON->new->utf8(1)->decode($json); + last; + } ++ elsif ($_ && /^\s*'PLAYER_CONFIG'\s*:\s*({.*})\s*$/) { ++ $data = JSON->new->utf8(1)->decode($1); ++ last; ++ } + } + +- return $data->{args}; ++ if ($data->{args}) { ++ return $data->{args}; ++ } else { ++ Carp::croak "failed to extract JSON data."; ++ } + } + + sub _parse_fmt_url_map { +@@ -214,13 +222,16 @@ sub _suffix { + + sub _video_id { + my $stuff = shift; +- if ($stuff =~ m{/.*?[?&;]v=([^&#?=/;]+)}) { ++ if ($stuff =~ m{/.*?[?&;!]v=([^&#?=/;]+)}) { + return $1; + } + elsif ($stuff =~ m{/(?:e|v|embed)/([^&#?=/;]+)}) { + return $1; + } + elsif ($stuff =~ m{#p/(?:u|search)/\d+/([^&?/]+)}) { ++ return $1; ++ } ++ elsif ($stuff =~ m{youtu.be/([^&#?=/;]+)}) { + return $1; + } + else { diff --git a/www/p5-WWW-YouTube-Download/patches/patch-t_private_video_id_t b/www/p5-WWW-YouTube-Download/patches/patch-t_private_video_id_t new file mode 100644 index 00000000000..7c73e6e8d73 --- /dev/null +++ b/www/p5-WWW-YouTube-Download/patches/patch-t_private_video_id_t @@ -0,0 +1,23 @@ +$OpenBSD: patch-t_private_video_id_t,v 1.1 2011/07/31 18:09:57 landry Exp $ + +- support for another url type +- youtu.be shortener support + +--- t/private/video_id.t.orig Tue Apr 19 17:34:24 2011 ++++ t/private/video_id.t Sat Jul 30 22:46:10 2011 +@@ -73,5 +73,15 @@ test_video_id( + 'INsSU8Jnx-4', + ); + ++test_video_id( ++ 'http://www.youtube.com/watch#!v=fqNKwF18cq0', ++ 'fqNKwF18cq0', ++); ++ ++test_video_id( ++ 'youtu.be/HyNh3AXegxw', ++ 'HyNh3AXegxw', ++); ++ + done_testing; +