Skip to content

Commit

Permalink
Merge pull request mcrapet#126 from zodman/master
Browse files Browse the repository at this point in the history
filecloud: find string not found for a file

+ mediafire tiny fix
  • Loading branch information
mcrapet authored Jan 25, 2017
2 parents b84f0e3 + 689434c commit d8b8099
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions filecloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ filecloud_download() {

else
PAGE=$(curl -L $AUTH_COOKIE -c "$COOKIE_FILE" "$URL") || return
if match 'The file at this URL was either removed or did not exist in the first place' "$PAGE" ; then
return $ERR_LINK_DEAD
fi

ERROR_CODE=$(parse 'var __error' '__error[[:space:]]*=[[:space:]]*\([^;]\+\)' <<< "$PAGE") || return

Expand Down
5 changes: 4 additions & 1 deletion mediafire.sh
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ mediafire_download() {

# Only get site headers first to capture direct download links
URL=$(curl --head "$BASE_URL/?$FILE_ID" | grep_http_header_location_quiet) || return

case "$URL" in
# no redirect, normal download
'')
Expand All @@ -245,6 +244,10 @@ mediafire_download() {
*errno=999)
return $ERR_LINK_NEED_PERMISSIONS
;;
*errno=320\&origin=download)
return $ERR_LINK_DEAD
;;

*errno=320|*errno=378)
return $ERR_LINK_DEAD
;;
Expand Down

0 comments on commit d8b8099

Please sign in to comment.