Skip to content

Commit

Permalink
fix: replace yotube-dl with yt-dlp. Run command in background
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvinSchiller committed Apr 2, 2024
1 parent 72aabd7 commit fca354f
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions htdocs/inc.processCheckCardEditRegister.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,9 @@ function fillRfidArrAvailWithUsed($rfidAvailArr, $rfidUsedArr=array()) {
// link to existing audiofolder
$foldername = $Audio_Folders_Path."/".$post['audiofolder'];
}
$exec = "cd '".$foldername."'; youtube-dl -f bestaudio --extract-audio --audio-format mp3 ".$post['YTstreamURL']." > ".$conf['shared_abs']."/youtube-dl.log; chmod 777 ".$foldername."/* 2>&1 &";
exec($exec);
$exec = "cd '".$foldername."'; yt-dlp --compat-options youtube-dl -f bestaudio --extract-audio --audio-format mp3 '".$post['YTstreamURL']."' >> ".$conf['shared_abs']."/youtube-download.log 2>&1; chmod 777 ".$foldername."/*;";
# Run command in background!
exec("{ ".$exec." } > /dev/null &");
// success message
$messageSuccess = $lang['cardRegisterDownloadingYT'];
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/lang/lang-de-DE.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
$lang['cardRegisterErrorConvertSpotifyURL'] = "Falsche Spotify URL, konvertiert in korrektes Format";
$lang['cardRegisterStream2Card'] = "Stream ist mit der Karten-ID verknüpft.";
$lang['cardRegisterFolder2Card'] = "Audio-Ordner ist nun mit der Karten-ID verknüpft.";
$lang['cardRegisterDownloadingYT'] = "<p>YouTube Audio wird heruntergeladen. Dies kann einige Minuten dauern. Du kannst die Logdatei \"youtube-dl.log\" im Ordner \"shared\" ansehen.</p>";
$lang['cardRegisterDownloadingYT'] = "<p>YouTube Audio wird heruntergeladen. Dies kann einige Minuten dauern. Du kannst die Logdatei \"youtube-download.log\" im Ordner \"shared\" ansehen.</p>";
$lang['cardRegisterSwipeUpdates'] = "Dies wird automatisch aktualisiert, wenn du eine RFID-Karte ausliest.";
$lang['cardRegisterManualLinks'] = "<p>Du kannst Karten auch manuell mit Ordnern verbinden. Das Handbuch erklärt, wie man sich <a href='https://github.com/MiczFlor/RPi-Jukebox-RFID/wiki/MANUAL#connect' target='-blank'>mit der Phoniebox verbindet</a> und <a href='https://github.com/MiczFlor/RPi-Jukebox-RFID/wiki/MANUAL#registering-cards-manually-through-samba-without-the-web-app' target='_blank'>Karten registriert</a>.</p>";
$lang['cardRegisterTriggerSuccess'] = "Die Karte ist jetzt verknüpft um die Funktion auszuführen:";
Expand Down
2 changes: 1 addition & 1 deletion htdocs/lang/lang-en-UK.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
$lang['cardRegisterErrorConvertSpotifyURL'] = "Wrong spotify url, converted to the correct format";
$lang['cardRegisterStream2Card'] = "Stream is linked to Card ID.";
$lang['cardRegisterFolder2Card'] = "Audio folder is now linked to Card.";
$lang['cardRegisterDownloadingYT'] = "<p>YouTube audio is downloading. This may take a couple of minutes. You may check the logfile \"youtube-dl.log\" in the shared folder.</p>";
$lang['cardRegisterDownloadingYT'] = "<p>YouTube audio is downloading. This may take a couple of minutes. You may check the logfile \"youtube-download.log\" in the shared folder.</p>";
$lang['cardRegisterSwipeUpdates'] = "This will automatically update as you swipe a RFID card.";
$lang['cardRegisterManualLinks'] = "<p>You can also connect cards to folders manually. The manual explains how to <a href='https://github.com/MiczFlor/RPi-Jukebox-RFID/wiki/MANUAL#connect' target='–blank'>connect to the phoniebox</a> and <a href='https://github.com/MiczFlor/RPi-Jukebox-RFID/wiki/MANUAL#registering-cards-manually-through-samba-without-the-web-app' target='_blank'>register cards</a>.</p>";
$lang['cardRegisterTriggerSuccess'] = "The card is now linked to trigger the command:";
Expand Down
2 changes: 1 addition & 1 deletion htdocs/lang/lang-fr-FR.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
$lang['cardRegisterErrorConvertSpotifyURL'] = "URL Spotify incorrecte, elle a été convertie au bon format";
$lang['cardRegisterStream2Card'] = "Le stream est lié à la carte.";
$lang['cardRegisterFolder2Card'] = "Le dossier audio est désormais lié à une carte.";
$lang['cardRegisterDownloadingYT'] = "<p>Piste YouTube en cours de téléchargement. Cela peut prendre plusieurs minutes. Log dans le fichier \"youtube-dl.log\".</p>";
$lang['cardRegisterDownloadingYT'] = "<p>Piste YouTube en cours de téléchargement. Cela peut prendre plusieurs minutes. Log dans le fichier \"youtube-download.log\".</p>";
$lang['cardRegisterSwipeUpdates'] = "Mise à jour automatique lors du passage d'une carte.";
$lang['cardRegisterManualLinks'] = "<p>Vous pouvez lier manuellement une carte à un dossier. Explication dans la documentation <a href='https://github.com/MiczFlor/RPi-Jukebox-RFID/wiki/MANUAL#connect' target='–blank'>connection à phoniebox</a> et <a href='https://github.com/MiczFlor/RPi-Jukebox-RFID/wiki/MANUAL#registering-cards-manually-through-samba-without-the-web-app' target='_blank'>enregistrer une carte</a>.</p>";
$lang['cardRegisterTriggerSuccess'] = "La carte est désormais lié à une commande :";
Expand Down
2 changes: 1 addition & 1 deletion htdocs/lang/lang-nl-NL.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
$lang['cardRegisterErrorConvertSpotifyURL'] = "Verkeerde spotify url, geconverteerd naar het juiste formaat";
$lang['cardRegisterStream2Card'] = "Stream is gekoppeld aan kaart-ID.";
$lang['cardRegisterFolder2Card'] = "De audiomap is nu gekoppeld aan kaart-ID";
$lang['cardRegisterDownloadingYT'] = "<p>YouTube-audio wordt gedownload. Dit kan een paar minuten duren. U kunt het logbestand 'youtube-dl.log' in de gedeelde map controleren.</p>";
$lang['cardRegisterDownloadingYT'] = "<p>YouTube-audio wordt gedownload. Dit kan een paar minuten duren. U kunt het logbestand 'youtube-download.log' in de gedeelde map controleren.</p>";
$lang['cardRegisterSwipeUpdates'] = "Dit wordt automatisch bijgewerkt terwijl je een RFID-kaart veegt.";
$lang['cardRegisterManualLinks'] = "<p>U kunt kaarten ook handmatig met mappen verbinden. In de handleiding wordt uitgelegd hoe u <a href='https://github.com/MiczFlor/RPi-Jukebox-RFID/wiki/MANUAL#connect' target='–blank'>verbinding maakt met de phoniebox</a> en <a href='https://github.com/MiczFlor/RPi-Jukebox-RFID/wiki/MANUAL#registering-cards-manually-through-samba-without-the-web-app' target='_blank'>kaarten registreert</a>.</p>";

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# related libraries.
evdev
git+https://github.com/lthiery/SPI-Py.git#egg=spi-py
git+https://github.com/ytdl-org/youtube-dl@master#egg=youtube-dl
yt-dlp
pyserial
RPi.GPIO

Expand Down

0 comments on commit fca354f

Please sign in to comment.