POL_Gamefront_Download

Informations

Creator Meddelanden
Xenos5

Information

This installer has been approved by the team.

Informations

Platforms:
Downloads: 11473
Wine: System

Feedbacks

Description

Download a file from http://gamefront.com/
Parameters:
- 1: file ID
- 2: directory for temp files
- 3: result file name
- 4: download title

Source code

local ID="$1"
local TMP_DIR="$2"
local RESULT="$3"
local NAME="$4"
local URL1="http://gamefront.com/files/$ID"
local URL2="http://gamefront.com/files/service/thankyou?id=$ID"
local COOKIE="$TMP_DIR/cookie.txt"
POL_SetupWindow_wait "$(eval_gettext 'Contacting download server.')" "$TITLE"
$POL_WGET --cookies=on --keep-session-cookies --save-cookies="$COOKIE" -O /dev/null "$URL1"
local HTML_FILE="$TMP_DIR/url2.html"
$POL_WGET --referer="$URL1" --cookies=on --load-cookies="$COOKIE" --keep-session-cookies --save-cookies="$COOKIE" -O "$HTML_FILE" "$URL2"
GAMEFRONT_URL="$(grep 'click here' "$HTML_FILE" | grep -oE 'href="[^"]*"' | cut -d '"' -f2)"
POL_System_wget "$GAMEFRONT_URL" "$NAME" --referer="$URL2" --cookies=on --load-cookies="$COOKIE" --keep-session-cookies --save-cookies="$COOKIE" -O "$RESULT"

Contributions

Filters:

Contribute
Member Meddelanden