Attached is a patch enabling HTTP redirection following by curl, for
the download stuff in curl. This is useful as a bunch of websites
rely on 302 redirects for their download sections, Project Gutenberg
being a good example.
>From 0a9009669fd9a9bba0ffe873a3ad3c2ca24e1db5 Mon Sep 17 00:00:00 2001
From: Nick White <[email protected]>
Date: Sat, 30 Mar 2013 10:32:45 +0000
Subject: [PATCH] Ensure curl follows redirects for downloads
---
config.def.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/config.def.h b/config.def.h
index ed8fbbe..76061f3 100644
--- a/config.def.h
+++ b/config.def.h
@@ -32,7 +32,7 @@ static Bool hidebackground = FALSE;
/* DOWNLOAD(URI, referer) */
#define DOWNLOAD(d, r) { \
.v = (char *[]){ "/bin/sh", "-c", \
- "st -e /bin/sh -c \"curl -J -O --user-agent '$1'" \
+ "st -e /bin/sh -c \"curl -L -J -O --user-agent '$1'" \
" --referer '$2' -b $3 -c $3 '$0';" \
" sleep 5;\"", \
d, useragent, r, cookiefile, NULL \
--
1.7.2.5