[Python] How to store mp3 file in a Python Object

Discussão em 'Python' iniciado por Stack, Abril 19, 2025.

  1. Stack

    Stack Membro Participativo

    I need to download an mp3 file and store it in python code without the os filesystem manipulation. This is the code:

    def PlaySong(self, link):
    ydl_opts = {
    'quiet': True,
    'format': '140',
    'verbose': False,
    'postprocessors': [{
    'key': 'FFmpegExtractAudio',
    'preferredcodec': 'mp3',
    'preferredquality': '192',
    }],
    'no_warnings': True,
    'cachedir' : False
    }
    ydl = youtube_dl.YoutubeDL(ydl_opts)
    ? = ytd.download([link])


    The goal would be to download the file and play it with the vlc library

    Continue reading...

Compartilhe esta Página