Removed youtube-dl / and another unused dependency

This commit is contained in:
Eliot Berriot 2019-01-11 11:26:41 +01:00
parent 8aac1c93ae
commit 97aaffaeda
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
3 changed files with 0 additions and 24 deletions

View file

@ -1,3 +0,0 @@
from .downloader import download
__all__ = ["download"]

View file

@ -1,19 +0,0 @@
import os
import youtube_dl
from django.conf import settings
def download(
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"}],
}
_downloader = youtube_dl.YoutubeDL(ydl_opts)
info = _downloader.extract_info(url)
info["audio_file_path"] = target_path % {"id": info["id"], "ext": "ogg"}
return info