mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-13 02:31:30 +03:00
removed debug statements
This commit is contained in:
@@ -391,8 +391,6 @@ app.post('/tomp4', function(req, res) {
|
|||||||
var selectedHeight = req.body.selectedHeight;
|
var selectedHeight = req.body.selectedHeight;
|
||||||
var customQualityConfiguration = req.body.customQualityConfiguration;
|
var customQualityConfiguration = req.body.customQualityConfiguration;
|
||||||
|
|
||||||
// console.log(selectedHeight);
|
|
||||||
|
|
||||||
let qualityPath = 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4';
|
let qualityPath = 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4';
|
||||||
|
|
||||||
if (customQualityConfiguration) {
|
if (customQualityConfiguration) {
|
||||||
@@ -422,11 +420,7 @@ app.post('/tomp4', function(req, res) {
|
|||||||
}
|
}
|
||||||
var modified_file_name = output_json ? output_json['title'] : null;
|
var modified_file_name = output_json ? output_json['title'] : null;
|
||||||
if (!output_json) {
|
if (!output_json) {
|
||||||
// only get the first result
|
|
||||||
// console.log(output_json);
|
|
||||||
// console.log(output);
|
|
||||||
continue;
|
continue;
|
||||||
res.sendStatus(500);
|
|
||||||
}
|
}
|
||||||
var file_path = output_json['_filename'].split('\\');
|
var file_path = output_json['_filename'].split('\\');
|
||||||
|
|
||||||
@@ -654,7 +648,7 @@ app.get('/video/:id', function(req , res){
|
|||||||
file.on('close', function() {
|
file.on('close', function() {
|
||||||
let index = descriptors[req.params.id].indexOf(file);
|
let index = descriptors[req.params.id].indexOf(file);
|
||||||
descriptors[req.params.id].splice(index, 1);
|
descriptors[req.params.id].splice(index, 1);
|
||||||
console.log('Successfully closed stream and removed file reference.');
|
if (debugMode) console.log('Successfully closed stream and removed file reference.');
|
||||||
});
|
});
|
||||||
head = {
|
head = {
|
||||||
'Content-Range': `bytes ${start}-${end}/${fileSize}`,
|
'Content-Range': `bytes ${start}-${end}/${fileSize}`,
|
||||||
@@ -694,7 +688,7 @@ app.get('/audio/:id', function(req , res){
|
|||||||
file.on('close', function() {
|
file.on('close', function() {
|
||||||
let index = descriptors[req.params.id].indexOf(file);
|
let index = descriptors[req.params.id].indexOf(file);
|
||||||
descriptors[req.params.id].splice(index, 1);
|
descriptors[req.params.id].splice(index, 1);
|
||||||
console.log('Successfully closed stream and removed file reference.');
|
if (debugMode) console.log('Successfully closed stream and removed file reference.');
|
||||||
});
|
});
|
||||||
head = {
|
head = {
|
||||||
'Content-Range': `bytes ${start}-${end}/${fileSize}`,
|
'Content-Range': `bytes ${start}-${end}/${fileSize}`,
|
||||||
@@ -720,7 +714,6 @@ app.get('/audio/:id', function(req , res){
|
|||||||
let urlMode = !!req.body.urlMode;
|
let urlMode = !!req.body.urlMode;
|
||||||
let type = req.body.type;
|
let type = req.body.type;
|
||||||
let result = null;
|
let result = null;
|
||||||
// console.log(urlMode);
|
|
||||||
if (!urlMode) {
|
if (!urlMode) {
|
||||||
if (type === 'audio') {
|
if (type === 'audio') {
|
||||||
result = getAudioInfos(fileNames)
|
result = getAudioInfos(fileNames)
|
||||||
|
|||||||
@@ -227,8 +227,6 @@ export class MainComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public removeFromMp4(name: string) {
|
public removeFromMp4(name: string) {
|
||||||
// console.log(name);
|
|
||||||
// console.log(this.mp4s);
|
|
||||||
for (let i = 0; i < this.mp4s.length; i++) {
|
for (let i = 0; i < this.mp4s.length; i++) {
|
||||||
if (this.mp4s[i].id === name) {
|
if (this.mp4s[i].id === name) {
|
||||||
this.mp4s.splice(i, 1);
|
this.mp4s.splice(i, 1);
|
||||||
@@ -332,9 +330,7 @@ export class MainComponent implements OnInit {
|
|||||||
const cachedFormatsExists = this.cachedAvailableFormats[this.url];
|
const cachedFormatsExists = this.cachedAvailableFormats[this.url];
|
||||||
if (cachedFormatsExists) {
|
if (cachedFormatsExists) {
|
||||||
const video_formats = this.cachedAvailableFormats[this.url]['video'];
|
const video_formats = this.cachedAvailableFormats[this.url]['video'];
|
||||||
if (video_formats['best_audio_format'] && this.selectedQuality !== ''/* &&
|
if (video_formats['best_audio_format'] && this.selectedQuality !== '') {
|
||||||
video_formats[this.selectedQuality]['acodec'] === 'none'*/) {
|
|
||||||
console.log(this.selectedQuality);
|
|
||||||
customQualityConfiguration = video_formats[this.selectedQuality]['format_id'] + '+' + video_formats['best_audio_format'];
|
customQualityConfiguration = video_formats[this.selectedQuality]['format_id'] + '+' + video_formats['best_audio_format'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -446,15 +442,12 @@ export class MainComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getURLInfo(url) {
|
getURLInfo(url) {
|
||||||
console.log(this.cachedAvailableFormats[url]);
|
|
||||||
if (!(this.cachedAvailableFormats[url])) {
|
if (!(this.cachedAvailableFormats[url])) {
|
||||||
this.formats_loading = true;
|
this.formats_loading = true;
|
||||||
console.log('has no cached formats available');
|
|
||||||
this.postsService.getFileInfo([url], 'irrelevant', true).subscribe(res => {
|
this.postsService.getFileInfo([url], 'irrelevant', true).subscribe(res => {
|
||||||
if (url === this.url) { this.formats_loading = false; }
|
if (url === this.url) { this.formats_loading = false; }
|
||||||
const infos = res['result'];
|
const infos = res['result'];
|
||||||
const parsed_infos = this.getAudioAndVideoFormats(infos.formats);
|
const parsed_infos = this.getAudioAndVideoFormats(infos.formats);
|
||||||
console.log('got formats for ' + url);
|
|
||||||
const available_formats = {audio: parsed_infos[0], video: parsed_infos[1]};
|
const available_formats = {audio: parsed_infos[0], video: parsed_infos[1]};
|
||||||
this.cachedAvailableFormats[url] = available_formats;
|
this.cachedAvailableFormats[url] = available_formats;
|
||||||
});
|
});
|
||||||
@@ -471,7 +464,6 @@ export class MainComponent implements OnInit {
|
|||||||
.switch() // act on the return of the search
|
.switch() // act on the return of the search
|
||||||
.subscribe(
|
.subscribe(
|
||||||
(results: Result[]) => {
|
(results: Result[]) => {
|
||||||
// console.log(results);
|
|
||||||
this.results_loading = false;
|
this.results_loading = false;
|
||||||
if (results && results.length > 0) {
|
if (results && results.length > 0) {
|
||||||
this.results = results;
|
this.results = results;
|
||||||
@@ -510,7 +502,6 @@ export class MainComponent implements OnInit {
|
|||||||
const format_type = (format.vcodec === 'none') ? 'audio' : 'video';
|
const format_type = (format.vcodec === 'none') ? 'audio' : 'video';
|
||||||
|
|
||||||
format_obj.type = format_type;
|
format_obj.type = format_type;
|
||||||
// console.log(format);
|
|
||||||
if (format_obj.type === 'audio' && format.abr) {
|
if (format_obj.type === 'audio' && format.abr) {
|
||||||
const key = format.abr.toString() + 'K';
|
const key = format.abr.toString() + 'K';
|
||||||
format_obj['bitrate'] = format.abr;
|
format_obj['bitrate'] = format.abr;
|
||||||
|
|||||||
Reference in New Issue
Block a user