diff options
author | Markos Chandras <hwoarang@gentoo.org> | 2012-02-29 21:33:32 +0000 |
---|---|---|
committer | Markos Chandras <hwoarang@gentoo.org> | 2012-02-29 21:33:32 +0000 |
commit | 4d7d491bc8a0503ae7a710c95db1c9aec0f9c43d (patch) | |
tree | a94e43f74f0af3248f3c27736e6d35b92c55f1cc /media-video/get_flash_videos | |
parent | Fixed the Header for ChangeLog (diff) | |
download | historical-4d7d491bc8a0503ae7a710c95db1c9aec0f9c43d.tar.gz historical-4d7d491bc8a0503ae7a710c95db1c9aec0f9c43d.tar.bz2 historical-4d7d491bc8a0503ae7a710c95db1c9aec0f9c43d.zip |
Apply youtube fix from upstream. Bug #405761. Thanks to Peter Fox <gentoo@roestock.demon.co.uk>
Package-Manager: portage-2.2.0_alpha88/cvs/Linux x86_64
Diffstat (limited to 'media-video/get_flash_videos')
-rw-r--r-- | media-video/get_flash_videos/ChangeLog | 11 | ||||
-rw-r--r-- | media-video/get_flash_videos/Manifest | 24 | ||||
-rw-r--r-- | media-video/get_flash_videos/files/get_flash_videos-youtubefix.patch | 100 | ||||
-rw-r--r-- | media-video/get_flash_videos/get_flash_videos-1.24-r1.ebuild | 53 |
4 files changed, 179 insertions, 9 deletions
diff --git a/media-video/get_flash_videos/ChangeLog b/media-video/get_flash_videos/ChangeLog index 086efc66e18f..b8963166a421 100644 --- a/media-video/get_flash_videos/ChangeLog +++ b/media-video/get_flash_videos/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for media-video/get_flash_videos -# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/media-video/get_flash_videos/ChangeLog,v 1.11 2011/07/29 22:16:43 zmedico Exp $ +# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/media-video/get_flash_videos/ChangeLog,v 1.12 2012/02/29 21:33:32 hwoarang Exp $ + +*get_flash_videos-1.24-r1 (29 Feb 2012) + + 29 Feb 2012; Markos Chandras <hwoarang@gentoo.org> + +files/get_flash_videos-youtubefix.patch, +get_flash_videos-1.24-r1.ebuild: + Apply youtube fix from upstream. Bug #405761. Thanks to Peter Fox + <gentoo@roestock.demon.co.uk> 29 Jul 2011; Zac Medico <zmedico@gentoo.org> get_flash_videos-1.24.ebuild: Add ~x86-linux keyword. diff --git a/media-video/get_flash_videos/Manifest b/media-video/get_flash_videos/Manifest index 21b272e61975..320f2d058d59 100644 --- a/media-video/get_flash_videos/Manifest +++ b/media-video/get_flash_videos/Manifest @@ -1,18 +1,28 @@ -----BEGIN PGP SIGNED MESSAGE----- -Hash: SHA256 +Hash: SHA512 +AUX get_flash_videos-youtubefix.patch 3543 RMD160 fd36fca35ff8990479985ad17c32418bd31e593c SHA1 b0e4a777ade9a338db7b43f0da3560f8cbd05e05 SHA256 ca3bc4dce61c4de438ae333de122f6e1eda0ae44059d68f27dd593290f4d0e5e DIST App-get_flash_videos-1.24.tar.gz 82383 RMD160 1367954ba00cbd2dac5da84266d1b1fb64426a18 SHA1 035c1d6fe2ade44d3c968789831719f2d7b35c5d SHA256 9d402facf8d6adfd55365662902ab58a5cb5f0f56861385bed944e22052f9133 DIST get_flash_videos-1.23.tar.gz 76819 RMD160 160906964f821b8e4ef86344eeaa174af8d6f430 SHA1 41753120bb37a06a7f87522581db626bd472af8f SHA256 0d0f1b7d63708ca7332e17d26bd10d92aaf94dac4cd3670a4e8afe9fdb2605b6 EBUILD get_flash_videos-1.23-r1.ebuild 1370 RMD160 50ef9a49d5fb3f9b72790d806d60f8093128fcb1 SHA1 ad7fcd97941cdaf5d5d17123d62cdea9ecbf0f0a SHA256 413139d5a625b36b349e5266bae992a36d737b271e7ca0493f0406470f3d73c7 +EBUILD get_flash_videos-1.24-r1.ebuild 1376 RMD160 c244b6c0aa92ea7c4a22922bc483e79e9f97c10c SHA1 115221880d3e1fc216ceffa9b01b41d51af60e12 SHA256 08705c5d2154a6d28985a4eafce4b02271d9fa85ef38c9bbf4836b0782c56c61 EBUILD get_flash_videos-1.24.ebuild 1264 RMD160 676cd7261cdfdd17c99c88255ae6e6056c128d65 SHA1 01c7d89180b0962c78abbd2700f8689ffb8a522c SHA256 83c018c5238231a9c68cae2edf0afaee7405f5decc3003be33f49865df49071d -MISC ChangeLog 1949 RMD160 8aa990025f7886962c74636c8bbff6bcc7f0ced3 SHA1 d58deb49bd0155157e92168fd76a4b93808dfac4 SHA256 6edf4a0ab8115a0bc6ad0f46265068bfc7bfe628f1fb9d3490584b7976efefde +MISC ChangeLog 2223 RMD160 ba807576053bcd84e1729730ec13a2b2a544ef15 SHA1 2ce57008e3dd18f750c2c49fb66849c546af5a8e SHA256 b6521d183822949d42aeae5771d33a9c02ce74556176f913581cbec6440829fb MISC metadata.xml 278 RMD160 85ae612f4b725d8857a7fe0808090691c0e58fbd SHA1 c97840692a46e7d54f22bfcfd0a564a8d08033dd SHA256 07a0afc4dfc12865b213ef6815169e0524357989b213ac40bc9436dea94c3160 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) -iJwEAQEIAAYFAk59p58ACgkQfXuS5UK5QB3K7QP/SQODKp1+onVeD3CcMTKn2XSN -4hBkZfDNuY06uBbSl/jwghsK4p1yKf9D+4U962h6QYLuGSP7z0pdnxyQ7iiyzIy6 -JgEhXssosW0s0ShsEQ9vCatodIyIrLmPSzmGgTCzdKSCDuDV7jnDM3yueBJAnCfJ -LuX8elpcSOuOfpbS3/s= -=ZiMm +iQIcBAEBCgAGBQJPTpmwAAoJEPqDWhW0r/LC0W4P/1zwL+6UW/OQ8h7RFnTH5Tt3 +MCZBOlduS/G2CRUEp835WxFydXDuzdtuUtQeZlBlnIKNiQMOT14u1S8YTp50PLy4 +ialXKsgl6D1YsifHsps8wCDKEJVJCrzrXCMPSpwxRKxYEjv4ResvPeRgVt3zdj0z +BJ7GCuPsLZy6wjfLyNdXE1T3+qW2qz6fiTrmEb6fUBibJu4UR73ZgRJi5308ZtTv +MFZEr9i14Qm8xGgmr2z5An/xC+eoy72kY0E3C5PDpcjMaS03BGHdjuzNLtLatHb1 +gVUnVSXAULZHIeDGMZJ5wfetpanws28hMz5M278cLfMZeA4prXdVLhycPpilzcBm +ZFmC0VKlJbcQG+GGaVWgNzPAPXXJQNAdp5eAKBm7ZiltKhDjGnN7zev+vDtF75b5 +pemwJQkiIoLsaB7ef6gmOUCNl4FkphLad/sExqNsug5a/q3eRgTh0shslxtPjQcH +BD9QIO4QECxdppy66BXDrmNm+Zok82m52rENZTW+pM4Kme8pCKzkc1eRdWvupQxX +916MxcEfNZGF6OgrtvtTcw3nJMhGrysXmcZxS25tvDilmG59czbGVz+8HTXjt1Of +zKzqhzILTHUAAkfjvoEXJqPtloCQ/V3StMUjAM/SaunwLwlpXTY4DS6CYVEzwMfh +epxJtnK+iCM0/T3+2A1o +=BnnG -----END PGP SIGNATURE----- diff --git a/media-video/get_flash_videos/files/get_flash_videos-youtubefix.patch b/media-video/get_flash_videos/files/get_flash_videos-youtubefix.patch new file mode 100644 index 000000000000..0bca2bbd450d --- /dev/null +++ b/media-video/get_flash_videos/files/get_flash_videos-youtubefix.patch @@ -0,0 +1,100 @@ +https://bugs.gentoo.org/show_bug.cgi?id=405761 + +https://github.com/richcollins/get-flash-videos/commit/27e0f1d214e291debfd567b1652908d0ef6b79d1#lib/FlashVideo/Site + +--- lib/FlashVideo/Site/Youtube.pm~ 2010-11-30 14:34:17.000000000 +0000 ++++ lib/FlashVideo/Site/Youtube.pm 2012-02-20 23:56:35.000000000 +0000 +@@ -26,6 +26,7 @@ + if($embed_url !~ m!youtube\.com/watch!) { + $browser->get($embed_url); + if ($browser->response->header('Location') =~ m!/swf/.*video_id=([^&]+)! ++ || $browser->content =~ m!\<iframe[^\>]*src="http://www.youtube.com/embed/([^"]+)"!i + || $embed_url =~ m!/v/([-_a-z0-9]+)!i + || $browser->uri =~ m!v%3D([-_a-z0-9]+)!i) { + # We ended up on a embedded SWF or other redirect page +@@ -48,12 +49,19 @@ + # If the page contains fmt_url_map, then process this. With this, we + # don't require the 't' parameter. + if ($browser->content =~ /["']fmt_url_map["']:\s{0,3}(["'][^"']+["'])/) { +- debug "Using fmt_url_map method from page ($1)"; +- return $self->download_fmt_map($prefs, $browser, $title, {}, @{from_json $1}); ++ my $fmt_map = $1; ++ if ($fmt_map !~ /\|/) { ++ # $fmt_map is double escaped. We should unescape it here just ++ # once. Be careful not to unescape ',' in the URL. ++ $fmt_map = uri_unescape($fmt_map); ++ } ++ debug "Using fmt_url_map method from page ($fmt_map)"; ++ return $self->download_fmt_map($prefs, $browser, $title, {}, @{from_json $fmt_map}); + } + + my $video_id; + if ($browser->content =~ /(?:var pageVideoId =|(?:CFG_)?VIDEO_ID'?\s*:)\s*'(.+?)'/ ++ || $browser->content =~ /"video_id": "([^"]+)"/ + || $embed_url =~ /v=([^&]+)/) { + $video_id = $1; + } else { +@@ -125,6 +133,9 @@ + } elsif($info{fmt_url_map}) { + debug "Using fmt_url_map method from info"; + return $self->download_fmt_map($prefs, $browser, $title, \%info, $info{fmt_url_map}); ++ } elsif($info{url_encoded_fmt_stream_map}) { ++ debug "Using url_encoded_fmt_stream_map method from info"; ++ return $self->download_url_encoded_fmt_stream_map($prefs, $browser, $title, \%info, $info{url_encoded_fmt_stream_map}); + } + } + +@@ -132,6 +143,53 @@ + return download_get_video($browser, $prefs, $video_id, $title, $t); + } + ++sub download_url_encoded_fmt_stream_map { ++ my($self, $prefs, $browser, $title, $info, $fmt_map) = @_; ++ ++ my $fmt_url_map = parse_youtube_url_encoded_fmt_stream_map($fmt_map); ++ ++ if (!$title and $browser->uri->as_string =~ m'/user/.*?#') { ++ my $video_id = (split /\//, $browser->uri->fragment)[-1]; ++ ++ my %info = get_youtube_video_info($browser->clone, $video_id); ++ ++ $title = $info->{title}; ++ } ++ ++ my $preferred_quality = $prefs->quality->choose(map { $fmt_url_map->{$_->{id}} ++ ? { resolution => $_->{resolution}, url => $fmt_url_map->{$_->{id}} } ++ : () } @formats); ++ ++ $browser->allow_redirects; ++ ++ return $preferred_quality->{url}, title_to_filename($title, "mp4"); ++} ++ ++sub parse_youtube_url_encoded_fmt_stream_map { ++ my($raw_map) = @_;; ++ ++ my $map = {}; ++ ++ foreach my $params (split /,/, $raw_map) { ++ ++ my $format = ""; ++ my $url = ""; ++ ++ foreach my $pair (split /&/, $params) { ++ my ($name, $value) = split /=/, $pair; ++ if ($name eq "itag"){ ++ $format = $value; ++ } elsif ($name eq "url") { ++ $url = uri_unescape($value); ++ } ++ } ++ ++ $map->{$format} = $url; ++ } ++ ++ return $map; ++} ++ + sub download_fmt_map { + my($self, $prefs, $browser, $title, $info, $fmt_map) = @_; + diff --git a/media-video/get_flash_videos/get_flash_videos-1.24-r1.ebuild b/media-video/get_flash_videos/get_flash_videos-1.24-r1.ebuild new file mode 100644 index 000000000000..335f7a3010fe --- /dev/null +++ b/media-video/get_flash_videos/get_flash_videos-1.24-r1.ebuild @@ -0,0 +1,53 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/media-video/get_flash_videos/get_flash_videos-1.24-r1.ebuild,v 1.1 2012/02/29 21:33:32 hwoarang Exp $ + +EAPI=2 +inherit eutils perl-module + +MY_PN="App-${PN}" +MY_P="${MY_PN}-${PV}" + +DESCRIPTION="Downloads videos from various Flash-based video hosting sites" +HOMEPAGE="http://code.google.com/p/get-flash-videos/" +SRC_URI="http://get-flash-videos.googlecode.com/files/${MY_P}.tar.gz" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~x86-linux" +IUSE="test" + +RDEPEND="dev-perl/WWW-Mechanize + perl-core/Module-CoreList + dev-perl/HTML-TokeParser-Simple" +DEPEND="${RDEPEND} + dev-perl/UNIVERSAL-require + test? ( media-video/rtmpdump + dev-perl/Tie-IxHash + dev-perl/XML-Simple + dev-perl/Crypt-Rijndael + dev-perl/Data-AMF + perl-core/IO-Compress )" + +SRC_TEST="do" + +S="${WORKDIR}/${MY_P}" +SRC_TEST="do" +myinst="DESTDIR=${D}" + +src_prepare() { + # 405761 + epatch "${FILESDIR}"/${PN}-youtubefix.patch + perl-module_src_prepare +} + +pkg_postinst() { + elog "Downloading videos from RTMP server requires the following packages :" + elog " media-video/rtmpdump" + elog " dev-perl/Tie-IxHash" + elog "Others optional dependencies :" + elog " dev-perl/XML-Simple" + elog " dev-perl/Crypt-Rijndael" + elog " dev-perl/Data-AMF" + elog " perl-core/IO-Compress" +} |