Subversion Repositories yt_downloader

Compare Revisions

No changes between revisions

Regard whitespace Rev 20 → Rev 19

/trunk/new_ffmpeg
File deleted
/trunk/phpstan.sh
File deleted
Property changes:
Deleted: svn:executable
-*
\ No newline at end of property
/trunk/ytdwn
1,8 → 1,8
#!/usr/bin/php
<?php
 
// ViaThinkSoft YouTube Downloader Util 2.4
// Revision: 2022-12-27
// ViaThinkSoft YouTube Downloader Util 2.3.3
// Revision: 2022-12-19
// Author: Daniel Marschall <www.daniel-marschall.de>
// Licensed under the terms of the Apache 2.0 License
//
56,12 → 56,6
$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
 
555,13 → 549,9
if (substr($type,0,2) == 'v:') {
$format = substr($type,2);
if (!empty($format)) {
$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);
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);
} else {
$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);
exec(YTDL_EXE.' -o '.escapeshellarg($outputTemplate).' '.$extra_args.(empty($cookie_file) ? '' : ' --cookies '.$cookie_file).' '.escapeshellarg(vid_to_vurl($video_id)), $out, $code);
}
 
$written_file = $code == 0 ? ytdwn_get_downloaded_filename($outputTemplate, $video_id) : false;
569,13 → 559,9
} else if (substr($type,0,2) == 'a:') {
$format = substr($type,2);
if (!empty($format)) {
$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);
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);
} else {
$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);
exec(YTDL_EXE.' -o '.escapeshellarg($outputTemplate).' '.$extra_args.(empty($cookie_file) ? '' : ' --cookies '.$cookie_file).' '.escapeshellarg(vid_to_vurl($video_id)).' --extract-audio', $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
-