Skip to content

Commit

Permalink
mediafire (download): fix checking wrong captcha
Browse files Browse the repository at this point in the history
Related to mcrapet#80.
  • Loading branch information
Raziel-23 committed May 18, 2016
1 parent eb033ee commit 492c00f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mediafire.sh
Original file line number Diff line number Diff line change
Expand Up @@ -293,18 +293,18 @@ mediafire_download() {
PAGE=$(curl --location -b "$COOKIE_FILE" --referer "$URL" \
-d "security=$SECURITY_CODE" $CAPTCHA_DATA "$BASE_URL/?$FILE_ID") || return

# After resolving captcha we are redirected to an error page, so once again load a proper page.
PAGE=$(curl -b "$COOKIE_FILE" "$URL" | break_html_lines) || return

# Your entry was incorrect, please try again!
if match 'Your entry was incorrect' "$PAGE"; then
if match 'form name="form_captcha"' "$PAGE"; then
captcha_nack $ID
log_error 'Wrong captcha'
return $ERR_CAPTCHA
fi

captcha_ack $ID
log_debug 'Correct captcha'

# After resolving captcha we are redirected to an error page, so once again load a proper page.
PAGE=$(curl -b "$COOKIE_FILE" "$URL" | break_html_lines) || return
fi

# Check for password protected link
Expand Down

0 comments on commit 492c00f

Please sign in to comment.