mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-03-29 16:10:56 +03:00
Use named arguments with download file
This commit is contained in:
@@ -71,7 +71,7 @@ export class CustomPlaylistsComponent implements OnInit {
|
||||
}
|
||||
|
||||
downloadPlaylist(fileNames, type, zipName = null, playlistID = null) {
|
||||
this.postsService.downloadFileFromServer(fileNames, type, zipName).subscribe(res => {
|
||||
this.postsService.downloadFileFromServer(fileNames, type, {outputName: zipName}).subscribe(res => {
|
||||
if (playlistID) { this.downloading_content[type][playlistID] = false };
|
||||
const blob: Blob = res;
|
||||
saveAs(blob, zipName + '.zip');
|
||||
|
||||
@@ -190,13 +190,15 @@ export class RecentVideosComponent implements OnInit {
|
||||
const type = (file.isAudio ? 'audio' : 'video') as FileType;
|
||||
const ext = type === 'audio' ? '.mp3' : '.mp4'
|
||||
const sub = this.postsService.getSubscriptionByID(file.sub_id);
|
||||
this.postsService.downloadFileFromServer(file.id, type, null, null, sub.name, sub.isPlaylist,
|
||||
this.postsService.user ? this.postsService.user.uid : null, null).subscribe(res => {
|
||||
const blob: Blob = res;
|
||||
saveAs(blob, file.id + ext);
|
||||
}, err => {
|
||||
console.log(err);
|
||||
});
|
||||
this.postsService.downloadFileFromServer(
|
||||
file.id, type,
|
||||
{subscriptionName: sub.name, subPlaylist: sub.isPlaylist, uid: this.postsService.user ? this.postsService.user.uid : null}
|
||||
).subscribe(res => {
|
||||
const blob: Blob = res;
|
||||
saveAs(blob, file.id + ext);
|
||||
}, err => {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
|
||||
downloadNormalFile(file) {
|
||||
|
||||
Reference in New Issue
Block a user