Commit 2263959 1 parent d311ebb commit 2263959 Copy full SHA for 2263959
File tree 2 files changed +3
-7
lines changed
2 files changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -10,3 +10,4 @@ node_modules/
10
10
InstagramDownloader.zip
11
11
.idea /* .iws
12
12
* .iws
13
+ tmp.json
Original file line number Diff line number Diff line change @@ -16,16 +16,11 @@ export async function downloadSingleImage(message: DownloadMessage): Promise<voi
16
16
let imageName = getImageId ( message . imageURL [ 0 ] ) ;
17
17
imageName = `${ message . accountName } _${ imageName } ` ;
18
18
19
- const headers = [ ] ;
20
- // Check if the user uses firefox
21
- if ( ( window as unknown as { browser : object } ) . browser ) headers . push ( { name : 'Referer' , value : 'https://www.instagram.com/' } ) ;
22
-
19
+ const file = await ( await fetch ( message . imageURL [ 0 ] ) ) . blob ( ) ;
23
20
await browser . downloads . download ( {
24
- url : message . imageURL [ 0 ] ,
21
+ url : URL . createObjectURL ( file ) ,
25
22
filename : imageName ,
26
- headers,
27
23
} ) ;
28
-
29
24
}
30
25
31
26
export function downloadBulk ( urls : string [ ] , accountName : string ) : void {
You can’t perform that action at this time.
0 commit comments