0

I have installed ffmpeg as a dependency in my conda env but still get this error.

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()

        filename = '{}.mp3'.format(response.text.split('/')[-1])

        song = AudioSegment.from_file(response.content, format='mp3')

        slices = song[::10000]

        slices.export(filename, format="mp3")


        return JsonResponse(data)

Trying to download an audio mp3 which I get the url as a json response, and then slices and save the slices somewhere.

When I do conda list I do get the the ffmpeg as a dependency

Riccardo
  • 107
  • 6
  • share some code, also fire structure would be nice to see, check if you're using the correct invironment for the terminal – SLDem Nov 14 '22 at 00:59
  • I'm pretty sure I'm using the correct env, I will share my code of course – Riccardo Nov 14 '22 at 07:51
  • https://stackoverflow.com/a/57350596/14535309 try this answer/other answer in this topic – SLDem Nov 14 '22 at 16:15

0 Answers0