From 4a7e46f9330f071143ea369aa3fd55b65fb04ffa Mon Sep 17 00:00:00 2001 From: Bard Date: Thu, 3 Oct 2024 19:17:45 +0800 Subject: [PATCH] unsplash --- .../root/usr/libexec/argon/online_wallpaper | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/luci-theme-argon/root/usr/libexec/argon/online_wallpaper b/luci-theme-argon/root/usr/libexec/argon/online_wallpaper index daafcd3..a71fdf3 100755 --- a/luci-theme-argon/root/usr/libexec/argon/online_wallpaper +++ b/luci-theme-argon/root/usr/libexec/argon/online_wallpaper @@ -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 \