diff --git a/objects/Encoder.php b/objects/Encoder.php index 0f77bed7..4b23b795 100644 --- a/objects/Encoder.php +++ b/objects/Encoder.php @@ -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))); @@ -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); @@ -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); @@ -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);