Skip to content
This repository was archived by the owner on Apr 29, 2022. It is now read-only.

Commit dc8eaa6

Browse files
committed
Fix "expires_in" field recognition
1 parent e5678f5 commit dc8eaa6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

imgur-screenshot.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ function save_access_token() {
234234

235235
access_token="$(egrep -o 'access_token":".*"' <<<"${1}" | cut -d '"' -f 3)"
236236
refresh_token="$(egrep -o 'refresh_token":".*"' <<<"${1}" | cut -d '"' -f 3)"
237-
expires_in="$(egrep -o 'expires_in":".*"' <<<"${1}" | cut -d '"' -f 3)"
237+
expires_in="$(egrep -o 'expires_in":[0-9]*' <<<"${1}" | cut -d ':' -f 2)"
238238
token_expire_time="$(( $(date +%s) + expires_in ))"
239239

240240
# create dir if not exist

0 commit comments

Comments
 (0)