mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 11:19:15 +02:00
Blacked the code
This commit is contained in:
parent
b6fc0051fa
commit
62ca3bd736
279 changed files with 8861 additions and 9527 deletions
|
@ -7,20 +7,15 @@ import glob
|
|||
|
||||
|
||||
def download(
|
||||
url,
|
||||
target_directory=settings.MEDIA_ROOT,
|
||||
name="%(id)s.%(ext)s",
|
||||
bitrate=192):
|
||||
url, target_directory=settings.MEDIA_ROOT, name="%(id)s.%(ext)s", bitrate=192
|
||||
):
|
||||
target_path = os.path.join(target_directory, name)
|
||||
ydl_opts = {
|
||||
'quiet': True,
|
||||
'outtmpl': target_path,
|
||||
'postprocessors': [{
|
||||
'key': 'FFmpegExtractAudio',
|
||||
'preferredcodec': 'vorbis',
|
||||
}],
|
||||
"quiet": True,
|
||||
"outtmpl": target_path,
|
||||
"postprocessors": [{"key": "FFmpegExtractAudio", "preferredcodec": "vorbis"}],
|
||||
}
|
||||
_downloader = youtube_dl.YoutubeDL(ydl_opts)
|
||||
info = _downloader.extract_info(url)
|
||||
info['audio_file_path'] = target_path % {'id': info['id'], 'ext': 'ogg'}
|
||||
info["audio_file_path"] = target_path % {"id": info["id"], "ext": "ogg"}
|
||||
return info
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue