diff --git a/src/GotDownloader.ts b/src/GotDownloader.ts index 53b59bd22..8b040ad9e 100644 --- a/src/GotDownloader.ts +++ b/src/GotDownloader.ts @@ -4,12 +4,12 @@ import * as path from 'path'; import { Downloader } from './Downloader'; -export class GotDownloader implements Downloader { - async download(url: string, targetFilePath: string) { +export class GotDownloader implements Downloader { + async download(url: string, targetFilePath: string, options?: any) { await fs.mkdirp(path.dirname(targetFilePath)); const writeStream = fs.createWriteStream(targetFilePath); await new Promise((resolve, reject) => { - const downloadStream = got.stream(url); + const downloadStream = got.stream(url, options); downloadStream.pipe(writeStream); downloadStream.on('error', error => reject(error));