diff --git a/imgur-screenshot.sh b/imgur-screenshot.sh index 980901c..76950f9 100755 --- a/imgur-screenshot.sh +++ b/imgur-screenshot.sh @@ -234,7 +234,7 @@ function save_access_token() { access_token="$(egrep -o 'access_token":".*"' <<<"${1}" | cut -d '"' -f 3)" refresh_token="$(egrep -o 'refresh_token":".*"' <<<"${1}" | cut -d '"' -f 3)" - expires_in="$(egrep -o 'expires_in":".*"' <<<"${1}" | cut -d '"' -f 3)" + expires_in="$(egrep -o 'expires_in":[0-9]*' <<<"${1}" | cut -d ':' -f 2)" token_expire_time="$(( $(date +%s) + expires_in ))" # create dir if not exist