Añadido bot_youtube.py

This commit is contained in:
2024-02-21 09:54:10 +01:00
parent 5be581b48f
commit 84003868b9
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ fi
# en modo pantalla completa y en bucle # en modo pantalla completa y en bucle
if [[ $1 == 3 ]] if [[ $1 == 3 ]]
then then
FOLDER=/home/sergio/Vídeos/zx_spectrum FOLDER=/home/sergio/Vídeos/autoraspi/
VIDEOS=("${FOLDER}"/*) VIDEOS=("${FOLDER}"/*)
NUM=$(( RANDOM % ${#VIDEOS[@]})) NUM=$(( RANDOM % ${#VIDEOS[@]}))
ls -d $FOLDER > /tmp/auto_raspi.m3u ls -d $FOLDER > /tmp/auto_raspi.m3u
+1
View File
@@ -43,6 +43,7 @@ def read_msg(offset):
yt = YouTube(link) yt = YouTube(link)
title = re.sub(r"[^a-zA-Z0-9 ]", "", yt.title) title = re.sub(r"[^a-zA-Z0-9 ]", "", yt.title)
username = i["message"]["from"]["username"] + '/' username = i["message"]["from"]["username"] + '/'
username = '/home/sergio/downloads/'
try: try:
os.mkdir(username) os.mkdir(username)