Skip to content

Commit

Permalink
fix YTDLProvider return path on store and upgrade to php83
Browse files Browse the repository at this point in the history
  • Loading branch information
Letsplaybar committed May 30, 2024
1 parent 386d017 commit d318c6c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM alpine

RUN apk update && apk upgrade \
&& apk add --no-cache php82 php82-mbstring php82-xml php82-pdo php82-mysqli php82-bcmath php82-ctype php82-zip \
php82-imap php82-curl php82-json php82-gettext php82-gd php82-session php82-snmp php82-pdo_mysql php82-tokenizer \
php82-openssl php82-sockets php82-fileinfo php82-dom php82-exif php82-simplexml php82-xmlwriter php82-xmlreader\
php82-sqlite3 php82-pdo_sqlite php82-pcntl php82-gd php82-iconv php82-phar composer nodejs php82-apache2 apache2 npm git python3 ca-certificates \
&& apk add --no-cache php83 php83-mbstring php83-xml php83-pdo php83-mysqli php83-bcmath php83-ctype php83-zip \
php83-imap php83-curl php83-json php83-gettext php83-gd php83-session php83-snmp php83-pdo_mysql php83-tokenizer \
php83-openssl php83-sockets php83-fileinfo php83-dom php83-exif php83-simplexml php83-xmlwriter php83-xmlreader\
php83-sqlite3 php83-pdo_sqlite php83-pcntl php83-gd php83-iconv php83-phar composer nodejs php83-apache2 apache2 npm git python3 ca-certificates \
curl ffmpeg chromium ttf-freefont font-noto-emoji \
&& curl -Lo /usr/bin/yt-dlp https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp \
&& chmod a+rx /usr/bin/yt-dlp \
Expand Down Expand Up @@ -35,6 +35,7 @@ RUN find . -type f -exec chmod 664 {} \; \
&& npm run production \
&& php artisan optimize \
&& php artisan view:clear \
&& php artisan config:clear \
&& adduser -D chrome

ENTRYPOINT ["/entrypoint.sh"]
6 changes: 3 additions & 3 deletions app/Services/LinkArchive/YoutubeDlProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class YoutubeDlProvider extends BaseProvider
{
public function makeArchive(): ?string
{
$path = storage_path('app/archives');
$path = storage_path('app/archives/');

if (is_dir($path) === false) {
mkdir($path);
Expand All @@ -39,12 +39,12 @@ public function makeArchive(): ?string
->downloadPath($path)
->url($this->url));

if (false === $result instanceof VideoCollection && $result->count() >= 1) {
if ($result->count() < 1) {
return null;
}

logger()->debug('Link media archive', $result->toArray());
return $result->getVideos()[0]->getFilename();
return str_replace($path,"",$result->getVideos()[0]->getFilename());
} catch (ExecutableNotFoundException $e) {
throw new \RuntimeException("Unable to create link media archive", 0, $e);
}
Expand Down

0 comments on commit d318c6c

Please sign in to comment.