/plowshare_duckload.diff
http://gsbabil.googlecode.com/ · Unknown · 128 lines · 127 code · 1 blank · 0 comment · 0 complexity · aac28da100a4c3f124db31064ad67546 MD5 · raw file
- Index: src/core.sh
- ===================================================================
- --- src/core.sh (revision 1462)
- +++ src/core.sh (working copy)
- @@ -698,7 +698,9 @@
- local TEXT2='Enter captcha response (drop punctuation marks, case insensitive): '
-
- # X11 server installed ?
- - if [ -n "$DISPLAY" ] && check_exec 'display'; then
- + if [ -n "$DISPLAY" ] && check_exec 'prompt_captcha.py'; then
- + RESPONSE=$(prompt_captcha.py $FILENAME)
- + elif [ -n "$DISPLAY" ] && check_exec 'display'; then
- display $FILENAME &
- PID=$!
- log_notice $TEXT1
- Index: src/modules/duckload.sh
- ===================================================================
- --- src/modules/duckload.sh (revision 0)
- +++ src/modules/duckload.sh (revision 0)
- @@ -0,0 +1,96 @@
- +#!/bin/bash
- +#
- +# duckload.com module
- +# Copyright (c) 2011 Plowshare team
- +#
- +# This file is part of Plowshare.
- +#
- +# Plowshare is free software: you can redistribute it and/or modify
- +# it under the terms of the GNU General Public License as published by
- +# the Free Software Foundation, either version 3 of the License, or
- +# (at your option) any later version.
- +#
- +# Plowshare is distributed in the hope that it will be useful,
- +# but WITHOUT ANY WARRANTY; without even the implied warranty of
- +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- +# GNU General Public License for more details.
- +#
- +# You should have received a copy of the GNU General Public License
- +#
- +
- +MODULE_DUCKLOAD_REGEXP_URL="http://\(www\.\)\?duckload\.com/"
- +MODULE_DUCKLOAD_DOWNLOAD_OPTIONS=""
- +MODULE_DUCKLOAD_DOWNLOAD_CONTINUE=""
- +MODULE_DUCKLOAD_UPLOAD_OPTIONS=""
- +MODULE_DUCKLOAD_DELETE_OPTIONS=""
- +MODULE_DUCKLOAD_LIST_OPTIONS=""
- +
- +# Output DuckLoad download URL
- +# $1: duckload url
- +# stdout: real file download link
- +duckload_download() {
- +
- + URL="$1"
- + AGENT="Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322)"
- + BASE_URL="http://www.duckload.com/jDownloader"
- +
- + URL_checkOnlineStatus="$BASE_URL/checkOnlineStatus.php"
- + URL_getFree="$BASE_URL/getFree.php"
- + URL_getFreeEncrypt="$BASE_URL/getFreeEncrypt.php"
- +
- + log_debug "[*] checking online status"
- + STATUS=$(curl \
- + --silent \
- + --user-agent "$AGENT" \
- + --data-urlencode "isPremium=0" \
- + --data-urlencode "list=$URL" "$URL_checkOnlineStatus" \
- + --output -)
- +
- + log_debug $STATUS
- + if matchi "ERROR;" "$STATUS" || matchi "OFFLINE" "$STATUS"
- + then
- + if matchi "OFFLINE" "$STATUS"
- + then
- + log_error "[*] file not currently available"
- + return 254
- + fi
- + fi
- +
- + log_debug "[*] getting free slots"
- + STATUS=$(curl \
- + --silent \
- + --user-agent "$agent" \
- + --referer "$URL_checkOnlineStatus" \
- + --data-urlencode "link=$URL" "$URL_getFree" \
- + --output -)
- +
- + log_debug $STATUS
- + if matchi "ERROR;" "$STATUS"
- + then
- + log_error "[*] error getting free download slot"
- + return 3
- + fi
- +
- + time=$(echo "$STATUS" | cut -d ";" -f 2 | strip)
- + crypt=$(echo "$STATUS" | cut -d ";" -f 3 | strip)
- +
- + log_debug "[*] free user delay "
- + wait $time || return 2
- +
- + log_debug "[*] getting final url"
- + STATUS=$(curl \
- + --silent \
- + --user-agent "$AGENT" \
- + --referer "$URL_getFree" \
- + --data-urlencode "crypt=$crypt" "$URL_getFreeEncrypt" \
- + --output -)
- +
- + log_debug $STATUS
- + if matchi "http" "$STATUS"
- + then
- + log_debug "[*] starting download: $STATUS"
- + echo "$STATUS"
- + else
- + return 1
- + fi
- +}
- Index: src/modules/config
- ===================================================================
- --- src/modules/config (revision 1462)
- +++ src/modules/config (working copy)
- @@ -9,6 +9,7 @@
- depositfiles| download | | | list |
- divshare | download | | | |
- dl_free_fr | download | upload | | |
- +duckload | download | | | |
- euroshare_eu| download | | | |
- fileserve | download | upload | | list |
- filesonic | download | upload | delete | list |