Subversion Repositories yt_downloader

Compare Revisions

No changes between revisions

Regard whitespace Rev 19 → Rev 20

/trunk/new_ffmpeg
0,0 → 1,18
 
With yt-dlp, you might get the error "ERROR: Postprocessing: Conversion failed!" if
you have a tool old ffmpeg version.
 
If you cannot update to a newer version to ffmpeg using aptitude,
you can download (or compile) a new ffmpeg version.
 
Example for downloading FFmpeg 5.1.1 for Raspberry Pi Buster (32 bit ARM)
 
Visit:
https://johnvansickle.com/ffmpeg/
Download and unpack:
wget https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-armhf-static.tar.xz
tar xvf ffmpeg-release-armhf-static.tar.xz
rm ffmpeg-release-armhf-static.tar.xz
Create a symlink:
ln -s ffmpeg-5.1.1-armhf-static/ffmpeg .
 
/trunk/phpstan.sh
0,0 → 1,12
#!/bin/bash
 
DIR=$( dirname "$0 ")
 
cd "$DIR"
 
if [ ! -f ytdwn.php ]; then
ln -s ytdwn ytdwn.php
fi
phpstan
rm ytdwn.php
 
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/trunk/ytdwn
1,8 → 1,8
#!/usr/bin/php
<?php
 
// ViaThinkSoft YouTube Downloader Util 2.3.3
// Revision: 2022-12-19
// ViaThinkSoft YouTube Downloader Util 2.4
// Revision: 2022-12-27
// Author: Daniel Marschall <www.daniel-marschall.de>
// Licensed under the terms of the Apache 2.0 License
//
56,6 → 56,12
$cookie_file = AUTO_COOKIE_FILE;
$downloader = 'yt-dlp';
 
if (($downloader == 'yt-dlp') && file_exists(__DIR__.'/ffmpeg')) {
// With yt-dlp, you might get the error "ERROR: Postprocessing: Conversion failed!" if
// you have a tool old ffmpeg version.
$extra_args .= ' --ffmpeg-location '.escapeshellarg(__DIR__.'/ffmpeg');
}
 
// Parse arguments
// We do not use getopt() at the moment, because the important functionality "optind" is only available in PHP 7.1, which is not yet distributed with most of the stable Linux distros
 
549,9 → 555,13
if (substr($type,0,2) == 'v:') {
$format = substr($type,2);
if (!empty($format)) {
exec(YTDL_EXE.' -o '.escapeshellarg($outputTemplate).' '.$extra_args.(empty($cookie_file) ? '' : ' --cookies '.$cookie_file).' '.escapeshellarg(vid_to_vurl($video_id)).' --format '.escapeshellarg($format), $out, $code);
$cmd = YTDL_EXE.' -o '.escapeshellarg($outputTemplate).' '.$extra_args.(empty($cookie_file) ? '' : ' --cookies '.$cookie_file).' '.escapeshellarg(vid_to_vurl($video_id)).' --format '.escapeshellarg($format);
echo "$cmd\n";
exec($cmd, $out, $code);
} else {
exec(YTDL_EXE.' -o '.escapeshellarg($outputTemplate).' '.$extra_args.(empty($cookie_file) ? '' : ' --cookies '.$cookie_file).' '.escapeshellarg(vid_to_vurl($video_id)), $out, $code);
$cmd = YTDL_EXE.' -o '.escapeshellarg($outputTemplate).' '.$extra_args.(empty($cookie_file) ? '' : ' --cookies '.$cookie_file).' '.escapeshellarg(vid_to_vurl($video_id));
echo "$cmd\n";
exec($cmd, $out, $code);
}
 
$written_file = $code == 0 ? ytdwn_get_downloaded_filename($outputTemplate, $video_id) : false;
559,9 → 569,13
} else if (substr($type,0,2) == 'a:') {
$format = substr($type,2);
if (!empty($format)) {
exec(YTDL_EXE.' -o '.escapeshellarg($outputTemplate).' '.$extra_args.(empty($cookie_file) ? '' : ' --cookies '.$cookie_file).' '.escapeshellarg(vid_to_vurl($video_id)).' --extract-audio --audio-format '.escapeshellarg($format), $out, $code);
$cmd = YTDL_EXE.' -o '.escapeshellarg($outputTemplate).' '.$extra_args.(empty($cookie_file) ? '' : ' --cookies '.$cookie_file).' '.escapeshellarg(vid_to_vurl($video_id)).' --extract-audio --audio-format '.escapeshellarg($format);
echo "$cmd\n";
exec($cmd, $out, $code);
} else {
exec(YTDL_EXE.' -o '.escapeshellarg($outputTemplate).' '.$extra_args.(empty($cookie_file) ? '' : ' --cookies '.$cookie_file).' '.escapeshellarg(vid_to_vurl($video_id)).' --extract-audio', $out, $code);
$cmd = YTDL_EXE.' -o '.escapeshellarg($outputTemplate).' '.$extra_args.(empty($cookie_file) ? '' : ' --cookies '.$cookie_file).' '.escapeshellarg(vid_to_vurl($video_id)).' --extract-audio';
echo "$cmd\n";
exec($cmd, $out, $code);
}
 
$written_file = $code == 0 ? ytdwn_get_downloaded_filename($outputTemplate, $video_id) : false;
/trunk/.
Property changes:
Modified: svn:ignore
marschall
test
-ffmpeg
+ffmpeg*
youtube-dl
youtube-dlc
yt-dlp
upload_to_vts
phpstan.neon
.phpstan.tmp
+ytdwn.php
+