Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Neto committed Aug 12, 2024
1 parent 1b9ba0d commit be385cc
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions objects/Encoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -594,8 +594,12 @@ public static function getYoutubeDl($videoURL, $queue_id, $destinationFile, $add
global $global;
$videoURL = escapeshellarg($videoURL);
$tmpfname = _get_temp_file('youtubeDl');

$e = new Encoder($queue_id);
$streamers_id = $e->getStreamers_id();

//$cmd = "youtube-dl -o {$tmpfname}.mp4 -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4' {$videoURL}";
$cmd = self::getYouTubeDLCommand($addOauthFromProvider, $queue_id) . " --no-check-certificate --force-ipv4 --no-playlist -k -o {$tmpfname}.mp4 -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4' {$videoURL}";
$cmd = self::getYouTubeDLCommand($addOauthFromProvider, $streamers_id) . " --no-check-certificate --force-ipv4 --no-playlist -k -o {$tmpfname}.mp4 -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4' {$videoURL}";
//echo "\n**Trying Youtube DL **".$cmd;
$progressFile = "{$global['systemRootPath']}videos/{$queue_id}_tmpFile_downloadProgress.txt";
_error_log("getYoutubeDl: Getting from Youtube DL {$cmd} progressFile={$progressFile} " . json_encode(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)));
Expand All @@ -607,7 +611,7 @@ public static function getYoutubeDl($videoURL, $queue_id, $destinationFile, $add
$error = $cmd . PHP_EOL . print_r($output, true);
_error_log($error);
self::setStreamerLog($queue_id, 'Fail to download line=' . __LINE__ . ' ' . $error, Encoder::LOG_TYPE_ERROR);
$cmd = self::getYouTubeDLCommand($addOauthFromProvider, $queue_id) . " --no-check-certificate --force-ipv4 --no-playlist -k -o {$tmpfname}.mp4 {$videoURL}";
$cmd = self::getYouTubeDLCommand($addOauthFromProvider, $streamers_id) . " --no-check-certificate --force-ipv4 --no-playlist -k -o {$tmpfname}.mp4 {$videoURL}";
//echo "\n**Trying Youtube DL **".$cmd;
_error_log("getYoutubeDl: Getting from Youtube other option DL {$cmd}");
exec($cmd . " 1> {$global['systemRootPath']}videos/{$queue_id}_tmpFile_downloadProgress.txt 2>&1", $output, $return_val);
Expand All @@ -616,7 +620,7 @@ public static function getYoutubeDl($videoURL, $queue_id, $destinationFile, $add
$error = $cmd . PHP_EOL . print_r($output, true);
_error_log($error);
self::setStreamerLog($queue_id, 'Fail to download line=' . __LINE__ . ' ' . $error, Encoder::LOG_TYPE_ERROR);
$cmd = self::getYouTubeDLCommand($addOauthFromProvider, $queue_id) . " --no-check-certificate --no-playlist -k -o {$tmpfname}.mp4 {$videoURL}";
$cmd = self::getYouTubeDLCommand($addOauthFromProvider, $streamers_id) . " --no-check-certificate --no-playlist -k -o {$tmpfname}.mp4 {$videoURL}";
//echo "\n**Trying Youtube DL **".$cmd;
_error_log("getYoutubeDl: Getting from Youtube other option DL {$cmd}");
exec($cmd . " 1> {$global['systemRootPath']}videos/{$queue_id}_tmpFile_downloadProgress.txt 2>&1", $output, $return_val);
Expand All @@ -625,7 +629,7 @@ public static function getYoutubeDl($videoURL, $queue_id, $destinationFile, $add
$error = $cmd . PHP_EOL . print_r($output, true);
_error_log($error);
self::setStreamerLog($queue_id, 'Fail to download line=' . __LINE__ . ' ' . $error, Encoder::LOG_TYPE_ERROR);
$cmd = self::getYouTubeDLCommand($addOauthFromProvider, $queue_id) . " --no-check-certificate --force-ipv4 --no-playlist -k -o '{$tmpfname}.%(ext)s' {$videoURL}";
$cmd = self::getYouTubeDLCommand($addOauthFromProvider, $streamers_id) . " --no-check-certificate --force-ipv4 --no-playlist -k -o '{$tmpfname}.%(ext)s' {$videoURL}";
//echo "\n**Trying Youtube DL **".$cmd;
_error_log("getYoutubeDl: Getting from Youtube other option DL {$cmd}");
exec($cmd . " 1> {$global['systemRootPath']}videos/{$queue_id}_tmpFile_downloadProgress.txt 2>&1", $output, $return_val);
Expand Down

0 comments on commit be385cc

Please sign in to comment.