summaryrefslogtreecommitdiff
path: root/hib-dlagent
diff options
context:
space:
mode:
authorYaohan Chen <yaohan.chen@gmail.com>2014-04-05 00:17:01 -0400
committerYaohan Chen <yaohan.chen@gmail.com>2014-04-05 00:17:01 -0400
commit9bd67f7b1e29ac08ea5bc9085c8e662d525b7c53 (patch)
tree1e1a4b28af8f0f6b728013ffed8a290ec604d45e /hib-dlagent
parenta282b78c31be363a4fa5869c59588aa39da57b88 (diff)
downloadhib-dlagent-9bd67f7b1e29ac08ea5bc9085c8e662d525b7c53.tar.gz
hib-dlagent-9bd67f7b1e29ac08ea5bc9085c8e662d525b7c53.zip
No longer create a temporary cookie jar
The PhantomJS script logs in and finds URL in one session, so there is no need for a temporary cookie jar.
Diffstat (limited to 'hib-dlagent')
-rwxr-xr-xhib-dlagent9
1 files changed, 1 insertions, 8 deletions
diff --git a/hib-dlagent b/hib-dlagent
index 9863a2e..bb31a63 100755
--- a/hib-dlagent
+++ b/hib-dlagent
@@ -4,7 +4,6 @@ set -e
VERSION=0.6
LOGIN_PAGE=https://www.humblebundle.com/login
HOME_PAGE=https://www.humblebundle.com/home
-COOKIE_JAR=
SCRIPT_PATH='/usr/share/hib-dlagent'
CONFIG_PATH='/etc/hib-dlagent'
@@ -21,8 +20,7 @@ discover_url() {
local LISTING_PAGE="$1"
# Running a new shell in order to split PHANTOM_JS_OPTIONS into multiple arguments
PASSWORD="$PASSWORD" \
- sh -c "phantomjs --config='$CONFIG_PATH'/phantomjs-config.json --cookies-file='$COOKIE_JAR' \
- $PHANTOM_JS_OPTIONS \
+ sh -c "phantomjs --config='$CONFIG_PATH'/phantomjs-config.json $PHANTOM_JS_OPTIONS \
'$SCRIPT_PATH'/discover-url.coffee '$LISTING_PAGE' '$FILE' '$USERNAME'"
}
@@ -59,8 +57,6 @@ handle_download() {
local SAVE_FILE="$1"
local LISTING_PAGES=()
- COOKIE_JAR=$(mktemp)
-
if [ -n "$USERNAME" ]; then
LISTING_PAGES+=("$HOME_PAGE")
if [ -z "$PASSWORD" ]; then
@@ -84,9 +80,6 @@ handle_download() {
if [ -n "$URL" ]; then break; fi
done
- # Cookie no longer necessary.
- rm "$COOKIE_JAR"
-
if [ ! -n "$URL" ]; then
echo "Could not find URL for file: $FILE" >&2
exit 2