mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-21 09:43:18 +03:00
Default youtube downloader switched back to youtube-dl after testing
Fixed bug that caused some non-youtube downloads from failing
This commit is contained in:
@@ -1655,6 +1655,13 @@ async function autoUpdateYoutubeDL() {
|
|||||||
|
|
||||||
// got version, now let's check the latest version from the youtube-dl API
|
// got version, now let's check the latest version from the youtube-dl API
|
||||||
let youtubedl_api_path = using_youtube_dlc ? youtube_dlc_tags_url : youtube_dl_tags_url;
|
let youtubedl_api_path = using_youtube_dlc ? youtube_dlc_tags_url : youtube_dl_tags_url;
|
||||||
|
|
||||||
|
if (default_downloader === 'youtube-dl') {
|
||||||
|
await downloadLatestYoutubeDLBinary('unknown', 'unknown');
|
||||||
|
resolve(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
fetch(youtubedl_api_path, {method: 'Get'})
|
fetch(youtubedl_api_path, {method: 'Get'})
|
||||||
.then(async res => res.json())
|
.then(async res => res.json())
|
||||||
.then(async (json) => {
|
.then(async (json) => {
|
||||||
@@ -1696,7 +1703,7 @@ async function downloadLatestYoutubeDLBinary(current_version, new_version) {
|
|||||||
logger.error(err);
|
logger.error(err);
|
||||||
resolve(false);
|
resolve(false);
|
||||||
}
|
}
|
||||||
logger.info(`youtube-dl successfully updated: ${current_version} -> ${new_version}`);
|
logger.info(`youtube-dl successfully updated!`);
|
||||||
resolve(true);
|
resolve(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -49,6 +49,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Advanced": {
|
"Advanced": {
|
||||||
|
"default_downloader": "youtube-dl",
|
||||||
"use_default_downloading_agent": true,
|
"use_default_downloading_agent": true,
|
||||||
"custom_downloading_agent": "",
|
"custom_downloading_agent": "",
|
||||||
"multi_user_mode": false,
|
"multi_user_mode": false,
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ DEFAULT_CONFIG = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Advanced": {
|
"Advanced": {
|
||||||
"default_downloader": "youtube-dlc",
|
"default_downloader": "youtube-dl",
|
||||||
"use_default_downloading_agent": true,
|
"use_default_downloading_agent": true,
|
||||||
"custom_downloading_agent": "",
|
"custom_downloading_agent": "",
|
||||||
"multi_user_mode": false,
|
"multi_user_mode": false,
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ function getExpectedFileSize(info_json) {
|
|||||||
const formats = info_json['format_id'].split('+');
|
const formats = info_json['format_id'].split('+');
|
||||||
let expected_filesize = 0;
|
let expected_filesize = 0;
|
||||||
formats.forEach(format_id => {
|
formats.forEach(format_id => {
|
||||||
|
if (!info_json.formats) return expected_filesize;
|
||||||
info_json.formats.forEach(available_format => {
|
info_json.formats.forEach(available_format => {
|
||||||
if (available_format.format_id === format_id && available_format.filesize) {
|
if (available_format.format_id === format_id && available_format.filesize) {
|
||||||
expected_filesize += available_format.filesize;
|
expected_filesize += available_format.filesize;
|
||||||
|
|||||||
Reference in New Issue
Block a user