Another Facebook Album Downloader that was inspired and forked from
"https://github.com/yasinatesim/facebook-album-downloader"
A simple application that allows users to download Facebook albums in full resolution for linux users.
· Report Bug · Request Feature
!!! It is still in development - multipage albums are not still downloaded - folder is not renamed after album title and much more !!! !!! Use it at your own risk !!! Facebook Album Downloader is a java (JS) file that allows users to download Facebook photo albums in full resolution in linux.
Puppeteer | A Node library for controlling headless Chrome or Chromium browsers |
Axios | A promise-based HTTP client for the browser and Node.js |
Fs | A JavaScript library for working with files |
Path | A JavaScript library for working with paths |
The main feature of this javascript (JS) is to allow users to download Facebook albums after providing USER,PASSWORD,Facebook ALBUM url that they have access. The javascript uses mainly a tool called Puppeteer to scrape the HTML of the album.
The directory contains the following:
fb_downloader.js
- The main app that contains the code to download photos of full resolution from facebook albums that you have access- README.md - An information file that includes the information that is presented here
- package.json - A file that contains all the packages that may need to be installed in your system in order fb_downloader.js to work.
- Node (v17.0.0+)
- Npm (v8.1.0+)
- Clone this repository
git clone https://github.com/estatistics/facebook-album-downloader.git
- Install the project dependencies
npm install or yarn install
When you fork this repository in your disk, open and edit fb_downloader.js
as follows:
- in "const id" please WRITE your USERNAME and PASS of your facebook profile
- in "const ALBUM" please WRITE facebook ALBUM URL that you like to download. It is provided an example of a public fb album url.
- in "--user-data-dir='" write the PATH to save images. There, it will be created a folder named "photos".
- in "executablePath:" write the path of YOUR browser - Currently, support is provided only for chromium
- you may or may not activate the extra tab key press in line 68 by removing "//"
- Open a terminal
- Go to the folder that you forked this repository, for example:
cd /home/USER/Downloads/facebook_album_downloader/
- Run inside that folder
node fb_downloader.js
- If you like you may change
headless
mode fromtrue
tofalse
in order to see what happens - Album urls are grabbed by
document.querySelectorAll('a[href*="/photo/?fbid="]');
- If fb change image links in html in future, this may be edited accordingly - debug using your chrome/firefox console.
- After you have opened your fb album url and it has been loaded completely
- Enter
document.querySelectorAll('a[href*="/photo/?fbid="]');
in console, - Normally, it must output a list of results.
- then
const imageSelector = '[data-visualcompletion="media-vc-image"]';
it selects only this part of results that it is about images
- Then one-by-one fb photo urls are opened in new tab. open-save-close and again same circle it happens in full js code.
- Go to a full resolution image of fb album then, you can run in your console
pp = document.querySelector(imageSelector, img => img.src);
it selects the image url of full resolution image- use
console.log(pp.src)
to output the fileurl.
- Further debugging is listed in bottom of
fb_downloader.js
- Copyright © 2023 - MIT License.
See LICENSE for more information.