Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions now_playing/src/lib/api/UnsplashAPI.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fetch from 'node-fetch';

const BASE_URL = 'https://unsplash.com/napi/search/photos';
const FALLBACK_URL = 'https://source.unsplash.com/random';
const FALLBACK_URL = 'https://picsum.photos/1920/1080';
const PER_PAGE = 20;
const SAMPLE_SIZE = 500;

Expand All @@ -18,7 +18,7 @@ class UnsplashAPI {
};

const fallback = () => {
// Fallback to using 'https://source.unsplash.com/random/...' (deprecated; occasional 503 response as of late)
// Fallback to picsum.photos (drop-in for the deprecated source.unsplash.com/random; works without API key)
const qs = keywords ? encodeURIComponent(keywords) : '';
const screenSizePart = matchSize ? `${matchSize.w}x${matchSize.h}/` : '';
const url = `${FALLBACK_URL}/${screenSizePart}${qs ? `?${qs}` : ''}`;
Expand Down