From eb41214d16868fd35c7883254696f71ac5094c5e Mon Sep 17 00:00:00 2001 From: zodman Date: Thu, 19 Jan 2017 13:24:00 -0500 Subject: [PATCH 1/3] find string not found for a file --- filecloud.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/filecloud.sh b/filecloud.sh index 339fb964..f5d2bd20 100644 --- a/filecloud.sh +++ b/filecloud.sh @@ -1,4 +1,5 @@ # Plowshare filecloud.io module + # Copyright (c) 2013-2014 Plowshare team # # This file is part of Plowshare. @@ -130,6 +131,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 From 857a9a7325d8a44f2c9f8a8490178e2228b701a3 Mon Sep 17 00:00:00 2001 From: zodman Date: Thu, 19 Jan 2017 13:37:58 -0500 Subject: [PATCH 2/3] add more validation for mediafire file not found --- mediafire.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mediafire.sh b/mediafire.sh index 5a2041a3..005523d5 100644 --- a/mediafire.sh +++ b/mediafire.sh @@ -225,7 +225,7 @@ 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 - + log_debug $URL case "$URL" in # no redirect, normal download '') @@ -245,6 +245,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 ;; From 689434cd4b72b56eb767f4d83145d06abb63bd12 Mon Sep 17 00:00:00 2001 From: zodman Date: Wed, 25 Jan 2017 12:36:54 -0500 Subject: [PATCH 3/3] remove spaces and log --- filecloud.sh | 1 - mediafire.sh | 1 - 2 files changed, 2 deletions(-) diff --git a/filecloud.sh b/filecloud.sh index f5d2bd20..fde801a1 100644 --- a/filecloud.sh +++ b/filecloud.sh @@ -1,5 +1,4 @@ # Plowshare filecloud.io module - # Copyright (c) 2013-2014 Plowshare team # # This file is part of Plowshare. diff --git a/mediafire.sh b/mediafire.sh index 005523d5..50bc8b86 100644 --- a/mediafire.sh +++ b/mediafire.sh @@ -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 - log_debug $URL case "$URL" in # no redirect, normal download '')