【问题标题】:How can I download an audio mp3 file and save it?如何下载音频 mp3 文件并保存?
【发布时间】:2022-11-14 02:34:03
【问题描述】:

我的观点:

class UserSearchView(APIView):

    def get(self, request, link):
        url = config('BASE_URL')
        querystring = {"track_url": f'{link}'}
        headers = {
            "X-RapidAPI-Key": config('API_KEY'),
            "X-RapidAPI-Host": config('API_HOST')
        }

        response = requests.request("GET", url, headers=headers, params=querystring)

        data = response.json()


        return JsonResponse(data)

我的回复 :

{
    "url": "https://result.s3.amazonaws.com/2022-11-13/61566981.mp3"
}

不知道如何在这里进行,有人可以帮忙吗?----------

【问题讨论】:

    标签: python django api


    【解决方案1】:

    我不确定 100% 但你可以寻找 python 库来简化处理 .mp3 文件的过程 https://www.youtube.com/watch?v=n2FKsPt83_A

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-11
      • 2019-11-26
      • 1970-01-01
      • 1970-01-01
      • 2019-05-07
      相关资源
      最近更新 更多