Hi, This is an update to the latest 0.27 version, plus it includes patches from me. Amongs them there is an important change to unbreak the module with latest youtube site. All regress tests pass. Tested by meself with tool which uses this module.
Patches will be sent upstream. diff -xCVS -ruN p5-WWW-YouTube-Download-/Makefile p5-WWW-YouTube-Download/Makefile --- p5-WWW-YouTube-Download-/Makefile Mon Apr 25 14:04:17 2011 +++ p5-WWW-YouTube-Download/Makefile Sat Jul 30 23:06:52 2011 @@ -3,7 +3,7 @@ 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 <miko...@kucharski.name> @@ -24,9 +24,5 @@ www/p5-URI \ converters/p5-JSON \ www/p5-HTML-Parser - -post-extract: - find -d "${WRKDIST}" \ - -type d -name PaxHeader -exec rm -rf "{}" \; .include <bsd.port.mk> diff -xCVS -ruN p5-WWW-YouTube-Download-/distinfo p5-WWW-YouTube-Download/distinfo --- p5-WWW-YouTube-Download-/distinfo Mon Apr 25 14:04:17 2011 +++ p5-WWW-YouTube-Download/distinfo Sat Jul 30 22:26:14 2011 @@ -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 -xCVS -ruN p5-WWW-YouTube-Download-/patches/patch-Makefile_PL p5-WWW-YouTube-Download/patches/patch-Makefile_PL --- p5-WWW-YouTube-Download-/patches/patch-Makefile_PL Mon Apr 25 14:04:17 2011 +++ p5-WWW-YouTube-Download/patches/patch-Makefile_PL Sat Jul 30 23:07:48 2011 @@ -1,8 +1,8 @@ +$OpenBSD$ 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 -xCVS -ruN p5-WWW-YouTube-Download-/patches/patch-lib_WWW_YouTube_Download_pm p5-WWW-YouTube-Download/patches/patch-lib_WWW_YouTube_Download_pm --- p5-WWW-YouTube-Download-/patches/patch-lib_WWW_YouTube_Download_pm Thu Jan 1 01:00:00 1970 +++ p5-WWW-YouTube-Download/patches/patch-lib_WWW_YouTube_Download_pm Sat Jul 30 22:48:17 2011 @@ -0,0 +1,46 @@ +$OpenBSD$ + +- 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 -xCVS -ruN p5-WWW-YouTube-Download-/patches/patch-t_private_video_id_t p5-WWW-YouTube-Download/patches/patch-t_private_video_id_t --- p5-WWW-YouTube-Download-/patches/patch-t_private_video_id_t Thu Jan 1 01:00:00 1970 +++ p5-WWW-YouTube-Download/patches/patch-t_private_video_id_t Sat Jul 30 22:48:31 2011 @@ -0,0 +1,23 @@ +$OpenBSD$ + +- 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; + -- best regards q#