Download stories (videos and images) from Facebook and Instagram.
< 腳本Story Downloader - Facebook and Instagram的回應
I don't change the download path in the script. The browser handles it.
async downloadMedia(url, filename) {
try {
const response = await fetch(url);
const blob = await response.blob();
const link = document.createElement("a");
link.href = URL.createObjectURL(blob);
link.download = filename;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
URL.revokeObjectURL(link.href);
}
catch (error) {
console.error("Download error:", error);
}
}
This function is executed after clicking the download button.
As you can see in the line that says link.click(), the code simulates clicking on the link with the photo/video URL, and the browser downloads the file.
請問要如何修改下載路徑,我搜尋了整個C:,才找到在C:\Users\Administrator...