|
@@ -2,8 +2,8 @@
|
|
|
#Playlistalo - simpatico script che legge le cartelle e genera la playlist
|
|
|
#Requirements: youtube_dl Mastodon.py python-telegram-bot validators python-musicpd
|
|
|
|
|
|
-#import youtube_dlc as youtube_dl
|
|
|
-import youtube_dl
|
|
|
+#import youtube_dl
|
|
|
+import yt_dlp as youtube_dl
|
|
|
import shutil
|
|
|
import sys
|
|
|
import re
|
|
@@ -37,7 +37,7 @@ ARCHIVE = True
|
|
|
TELEGRAM_TOKEN = ""
|
|
|
MASTODON_TOKEN = ""
|
|
|
MASTODON_URL = ""
|
|
|
-ANNOUNCEREPEAT = 3
|
|
|
+ANNOUNCEREPEAT = 5
|
|
|
|
|
|
#Scrivi la prima configurazione
|
|
|
configfile = 'playlistalo.conf'
|
|
@@ -657,7 +657,7 @@ def trimaudio(fin, fout):
|
|
|
fade = 10
|
|
|
|
|
|
audio = AudioSegment.from_file(fin, "m4a")
|
|
|
- print(audio.duration_seconds)
|
|
|
+ #print(audio.duration_seconds)
|
|
|
|
|
|
|
|
|
|
|
@@ -668,12 +668,12 @@ def trimaudio(fin, fout):
|
|
|
|
|
|
#trim
|
|
|
audio = split_on_silence(audio, min_silence_len=3000, silence_thresh=-70.0, seek_step=100)[0]
|
|
|
- print(audio.duration_seconds)
|
|
|
+ #print(audio.duration_seconds)
|
|
|
|
|
|
#fade
|
|
|
if (audio.duration_seconds > maxlen + tolerance):
|
|
|
audio = audio[:maxlen*1000].fade_out(fade*1000)
|
|
|
- print(audio.duration_seconds)
|
|
|
+ #print(audio.duration_seconds)
|
|
|
|
|
|
#normalize
|
|
|
audio = match_target_amplitude(audio, -20.0)
|