简体   繁体   中英

soundcloud-python uploading a track is extremely slow

I am uploading tracks to SoundCloud using the soundcloud-python api wrapper (https://github.com/soundcloud/soundcloud-python).

Everything is working correctly, but uploading a track to SoundCloud takes about 1 minute per megabyte (eg invoking client.post('/tracks', track=data) with a 45 MB mp3 file is taking about 45 minutes to upload).

I have verified that I can push data at Gbps speed from this server (it's a worker dyno on Heroku) to other servers over the internet. Does SoundCloud throttle the API for uploading data or are there settings I can tweak that will help improve the speed?

Here is sample code:

import soundcloud
client = soundcloud.Client(access_token='OAUTH2_ACCESS_TOKEN')
res = client.post('/tracks',
                  track={'title': 'my title',
                         'asset_data':open('file.mp3', 'rb') 
                        }
                 )

Is it possible that your code is sending packets that are being selectively filtered out by your router? As Niklas B. mentioned above, the remote host could be limiting the rate. Have you contacted Soundcloud? Try uploading a file from your server through the standard Soundcloud interface and clocking that transfer rate.

Also found this question , asked Mar 12 at 13:52 by user1264242

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM