This commit is contained in:
Bard 2024-10-03 19:17:45 +08:00 committed by GitHub
parent 0ad24a1bf0
commit 4a7e46f933
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,14 +17,16 @@ fetch_pic_url() {
;;
unsplash)
curl -fks --max-time 3 \
"https://source.unsplash.com/1920x1080/daily?wallpapers" |
sed -E 's#^.*href="([^?]+)\?.*$#\1?fm=jpg\&fit=crop\&w=1920\&h=1080#'
--header "Authorization: Client-ID kmFIroj2ELqXJPtC0XUoyww-Tr_lDU8Ho8uxjptIrCo" \
"https://api.unsplash.com/photos/random?count=1&orientation=landscape" |
jsonfilter -e "@[0]['urls']['regular']"
;;
unsplash_*)
local collection_id=${WEB_PIC_SRC#unsplash_}
curl -fks --max-time 3 \
"https://source.unsplash.com/collection/${collection_id}/1920x1080" |
sed -E 's#^.*href="([^?]+)\?.*$#\1?fm=jpg\&fit=crop\&w=1920\&h=1080#'
--header "Authorization: Client-ID kmFIroj2ELqXJPtC0XUoyww-Tr_lDU8Ho8uxjptIrCo" \
"https://api.unsplash.com/photos/random?count=1&orientation=landscape" |
jsonfilter -e "@[0]['urls']['regular']"
;;
wallhaven)
curl -fks --max-time 3 \