php - Soundcloud 500x500 artwork by default -
if($song->artwork_url != null) { $song_artwork = $song->artwork_url; } else { $song_artwork = 'img/no_art.png'; }
by default soundcloud pulls -large
(which 100x100)
how make pull (t500x500) can have higher res image?
just replace large.jpg
t500x500.jpg
in filename, so:
$song_artwork = str_replace('large.jpg', 't500x500.jpg', $song->artwork_url);
in fact, support number of different formats different requests:
t500x500: 500px×500px crop: 400px×400px t300x300: 300px×300px large: 100px×100px (default) t67x67: 67px×67px (only on artworks) badge: 47px×47px small: 32px×32px tiny: 20px×20px (on artworks) tiny: 18px×18px (on avatars) mini: 16px×16px original: uploaded image
i found documentation in soundcloud api reference, search artwork_url
.
Comments
Post a Comment