mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-08 08:51:29 +03:00
updated backend to support youtube auth
frontend now support youtube auth as well
This commit is contained in:
@@ -515,6 +515,8 @@ app.post('/tomp3', function(req, res) {
|
||||
var maxBitrate = req.body.maxBitrate;
|
||||
var customArgs = req.body.customArgs;
|
||||
var customOutput = req.body.customOutput;
|
||||
var youtubeUsername = req.body.youtubeUsername;
|
||||
var youtubePassword = req.body.youtubePassword;
|
||||
|
||||
|
||||
let downloadConfig = null;
|
||||
@@ -535,6 +537,10 @@ app.post('/tomp3', function(req, res) {
|
||||
if (!maxBitrate || maxBitrate === '') maxBitrate = '0';
|
||||
qualityPath = `--audio-quality ${maxBitrate}`
|
||||
}
|
||||
|
||||
if (youtubeUsername && youtubePassword) {
|
||||
downloadConfig.push('--username', youtubeUsername, '--password', youtubePassword);
|
||||
}
|
||||
|
||||
if (qualityPath !== '') {
|
||||
downloadConfig.splice(2, 0, qualityPath);
|
||||
@@ -598,6 +604,8 @@ app.post('/tomp4', function(req, res) {
|
||||
|
||||
var selectedHeight = req.body.selectedHeight;
|
||||
var customQualityConfiguration = req.body.customQualityConfiguration;
|
||||
var youtubeUsername = req.body.youtubeUsername;
|
||||
var youtubePassword = req.body.youtubePassword;
|
||||
|
||||
let downloadConfig = null;
|
||||
let qualityPath = 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4';
|
||||
@@ -616,6 +624,10 @@ app.post('/tomp4', function(req, res) {
|
||||
} else if (selectedHeight && selectedHeight !== '') {
|
||||
qualityPath = `bestvideo[height=${selectedHeight}]+bestaudio/best[height=${selectedHeight}]`;
|
||||
}
|
||||
|
||||
if (youtubeUsername && youtubePassword) {
|
||||
downloadConfig.push('--username', youtubeUsername, '--password', youtubePassword);
|
||||
}
|
||||
|
||||
if (!useDefaultDownloadingAgent && customDownloadingAgent === 'aria2c') {
|
||||
downloadConfig.splice(0, 0, '--external-downloader', 'aria2c');
|
||||
|
||||
Reference in New Issue
Block a user