Skip to content

estatistics/facebook_album_downloader

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

📖 About

!!! 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.

📚 Tech Stack

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

Features

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.

File information

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.

Getting Started

📦 Prerequisites

  • Node (v17.0.0+)
  • Npm (v8.1.0+)

⚙️ How To Use

  1. Clone this repository
git clone https://github.com/estatistics/facebook-album-downloader.git
  1. Install the project dependencies
npm install or yarn install 

Before running

When you fork this repository in your disk, open and edit fb_downloader.js as follows:

  1. in "const id" please WRITE your USERNAME and PASS of your facebook profile
  2. in "const ALBUM" please WRITE facebook ALBUM URL that you like to download. It is provided an example of a public fb album url.
  3. in "--user-data-dir='" write the PATH to save images. There, it will be created a folder named "photos".
  4. in "executablePath:" write the path of YOUR browser - Currently, support is provided only for chromium
  5. you may or may not activate the extra tab key press in line 68 by removing "//"

How to run

  1. Open a terminal
  2. Go to the folder that you forked this repository, for example: cd /home/USER/Downloads/facebook_album_downloader/
  3. Run inside that folder node fb_downloader.js

Optional - Debugging - Use it at your own risk.

  1. If you like you may change headless mode from true to false in order to see what happens
  2. 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
  1. 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.
  2. Further debugging is listed in bottom of fb_downloader.js

🔑 License

  • Copyright © 2023 - MIT License.

See LICENSE for more information.


About

Download Facebook albums in full resolution

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%