use /temp_songs directory

master
Aevann 2023-02-10 16:17:22 +02:00
parent 68da9828b3
commit 96b8afa617
3 changed files with 5 additions and 3 deletions

View File

@ -21,6 +21,7 @@ RUN mkdir /images
RUN mkdir /chat_images
RUN mkdir /dm_images
RUN mkdir /songs
RUN mkdir /temp_songs
RUN mkdir /videos
RUN mkdir /audio
RUN mkdir /asset_submissions

View File

@ -779,7 +779,7 @@ def settings_song_change(v):
ydl_opts = {
'cookiefile': '.cookies',
'outtmpl': '/songs/%(title)s.%(ext)s',
'outtmpl': '/temp_songs/%(title)s.%(ext)s',
'format': 'bestaudio/best',
'postprocessors': [{
'key': 'FFmpegExtractAudio',
@ -796,8 +796,8 @@ def settings_song_change(v):
v=v,
error="Age-restricted videos aren't allowed."), 400
files = os.listdir("/songs/")
paths = [path.join("/songs/", basename) for basename in files]
files = os.listdir("/temp_songs/")
paths = [path.join("/temp_songs/", basename) for basename in files]
songfile = max(paths, key=path.getctime)
os.rename(songfile, f"/songs/{id}.mp3")

View File

@ -40,6 +40,7 @@ mkdir /images
mkdir /chat_images
mkdir /dm_images
mkdir /songs
mkdir /temp_songs
mkdir /videos
mkdir /audio
mkdir /asset_submissions