Soundcloud 500x500 artwork by default

醉酒当歌 提交于 2019-12-03 01:02:53

Just replace large.jpg by t500x500.jpg in the filename, like so:

  $song_artwork = str_replace('large.jpg', 't500x500.jpg', $song->artwork_url);

In fact, they support a number of different formats for 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:     originally uploaded image

I found the documentation in the Soundcloud API reference, search for artwork_url.

For client side a simple JS .replace() will do the job

SC.get("/users/984878/tracks", {limit: 10}, function(tracks){

$.each(tracks, function(index,track){

lrgart = track.artwork_url;
lrgart = lrgart.replace('-large', '-t500x500');

});

@likeitlikeit's answer worked for me, however I had to change the file extension for the 'original' size to png even though the smaller images were jpg, so try that if your first attempt is not found

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!