简体   繁体   English

soundcloud-python上传曲目非常慢

[英]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). 我正在使用soundcloud-python api包装器(https://github.com/soundcloud/soundcloud-python)将曲目上传到SoundCloud。

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). 一切正常,但是将曲目上载到SoundCloud每兆字节大约需要1分钟(例如,调用具有45 MB mp3文件的client.post('/ tracks',track = data)大约需要45分钟)。

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. 我已经确认可以将数据以Gbps的速度从该服务器(在Heroku上是工人dyno)通过互联网推送到其他服务器。 Does SoundCloud throttle the API for uploading data or are there settings I can tweak that will help improve the speed? SoundCloud是否会限制用于上传数据的API,或者我可以调整哪些设置来帮助提高速度?

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. 如上面的Niklas B.所述,远程主机可能会限制速率。 Have you contacted Soundcloud? 您是否已联系Soundcloud? Try uploading a file from your server through the standard Soundcloud interface and clocking that transfer rate. 尝试通过标准的Soundcloud接口从服务器上载文件,并记录传输速率。

Also found this question , asked Mar 12 at 13:52 by user1264242 也找到了这个问题 ,由user1264242在3月12日13:52问

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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