aboutsummaryrefslogtreecommitdiffstats
path: root/main/libquvi
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2014-10-20 16:48:03 +0300
committerTimo Teräs <timo.teras@iki.fi>2014-10-20 16:48:56 +0300
commit0d2a2b4e0793f56a78bc9589dd98b7303efb6d65 (patch)
tree3f39b19c8a1bc5e434458c0f39bee4c88aebd10c /main/libquvi
parentedbda7b9abf93a45e9d193e5fe5d1c2badb4fa50 (diff)
downloadaports-0d2a2b4e0793f56a78bc9589dd98b7303efb6d65.tar.bz2
aports-0d2a2b4e0793f56a78bc9589dd98b7303efb6d65.tar.xz
main/libquvi: fix redirect handling
Diffstat (limited to 'main/libquvi')
-rw-r--r--main/libquvi/APKBUILD15
-rw-r--r--main/libquvi/fix-redirects.patch29
2 files changed, 39 insertions, 5 deletions
diff --git a/main/libquvi/APKBUILD b/main/libquvi/APKBUILD
index 335e020406..47112a5483 100644
--- a/main/libquvi/APKBUILD
+++ b/main/libquvi/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libquvi
pkgver=0.9.4
-pkgrel=0
+pkgrel=1
pkgdesc="library for parsing video download links"
url="http://quvi.sourceforge.net/"
arch="all"
@@ -12,7 +12,9 @@ depends_dev="libquvi-scripts-dev curl-dev lua5.1-dev"
makedepends="$depends_dev libproxy-dev glib-dev libgcrypt-dev"
install=""
subpackages="$pkgname-dev $pkgname-doc"
-source="http://downloads.sourceforge.net/project/quvi/${pkgver%.*}/libquvi/libquvi-$pkgver.tar.xz"
+source="http://downloads.sourceforge.net/project/quvi/${pkgver%.*}/libquvi/libquvi-$pkgver.tar.xz
+ fix-redirects.patch
+ "
_builddir="$srcdir"/libquvi-$pkgver
prepare() {
@@ -42,6 +44,9 @@ package() {
rm -f "$pkgdir"/usr/lib/*.la
}
-md5sums="8e3f2134a6b3376934bd884b07dcdac5 libquvi-0.9.4.tar.xz"
-sha256sums="2d3fe28954a68ed97587e7b920ada5095c450105e993ceade85606dadf9a81b2 libquvi-0.9.4.tar.xz"
-sha512sums="287015e370e7b7f98f0f4c3717f5b044c8fcfb8b823c7988cd248e56b5fbbfa1a1aa421fbdafb38d727b79495267ccd4dead71587052117db53f29236268b651 libquvi-0.9.4.tar.xz"
+md5sums="8e3f2134a6b3376934bd884b07dcdac5 libquvi-0.9.4.tar.xz
+5afe26b25eebe18d955552c7aafaa81a fix-redirects.patch"
+sha256sums="2d3fe28954a68ed97587e7b920ada5095c450105e993ceade85606dadf9a81b2 libquvi-0.9.4.tar.xz
+b1367607d46f12c9dae705c9c4a141c2aa8cd04864d740c6cf5284bbd852a0f2 fix-redirects.patch"
+sha512sums="287015e370e7b7f98f0f4c3717f5b044c8fcfb8b823c7988cd248e56b5fbbfa1a1aa421fbdafb38d727b79495267ccd4dead71587052117db53f29236268b651 libquvi-0.9.4.tar.xz
+1c1152361fc4767ef6411130d2b39681d7e3dcdffe419da78199193902429c7e31075fd2ef3c13309f4d60de66dc821321dc4d83a5d4a136eea625c349754e62 fix-redirects.patch"
diff --git a/main/libquvi/fix-redirects.patch b/main/libquvi/fix-redirects.patch
new file mode 100644
index 0000000000..d6352947e1
--- /dev/null
+++ b/main/libquvi/fix-redirects.patch
@@ -0,0 +1,29 @@
+Do not use Effective URL if no redirections happened. This fixes to not
+drop 'fragment' part of the URL that some services need to identify the
+media to play.
+
+diff -ru libquvi-0.9.4.orig/src/curl/resolve.c libquvi-0.9.4/src/curl/resolve.c
+--- libquvi-0.9.4.orig/src/curl/resolve.c 2013-11-04 14:55:25.000000000 -0200
++++ libquvi-0.9.4/src/curl/resolve.c 2014-10-20 16:36:38.493630381 -0300
+@@ -61,10 +61,17 @@
+
+ if (curlcode == CURLE_OK && r->status.resp_code == 200)
+ {
+- gchar *u = NULL;
+- curl_easy_getinfo(c, CURLINFO_EFFECTIVE_URL, &u);
+- /* Leave comparison for resolve_redirections.lua */
+- g_string_assign(r->url.dst, u);
++ long count = 0;
++ curl_easy_getinfo(c, CURLINFO_REDIRECT_COUNT, &count);
++ if (count > 0)
++ {
++ gchar *u = NULL;
++ curl_easy_getinfo(c, CURLINFO_EFFECTIVE_URL, &u);
++ /* Leave comparison for resolve_redirections.lua */
++ g_string_assign(r->url.dst, u);
++ }
++ else
++ g_string_assign(r->url.dst, r->url.addr->str);
+ }
+ else
+ {