Coder Social home page Coder Social logo

imagefap-dl's Introduction

Buy Me a Coffee at ko-fi.com

imagefap-dl

An ImageFap gallery downloader written in Node.js.

Installation

First, install Node.js.

Then, in a terminal, run the following command:

npm i -g imagefap-dl

Usage

In a terminal:

// Download all galleries uploaded by johndoe to the current directory
$ imagefap-dl "https://www.imagefap.com/profile/johndoe/galleries"

// Download a single gallery to "C:\Downloads"
$ imagefap-dl -o "C:\Downloads" "https://www.imagefap.com/gallery/1234567"

URLs can be copy-and-pasted from the ImageFap website. Make sure they conform to one of the formats listed in the usage guide (below).

To display usage guide:

$ imagefap-dl -h

Output:

Usage

  imagefap-dl [OPTION]... URL 

URL

  Download all galleries by a user:                                             
  - https://www.imagefap.com/profile/<username>/galleries                       
                                                                                
  Download all galleries in a folder:                                           
  - https://www.imagefap.com/profile/<username>/galleries?folderid=<folder-id>  
  - https://www.imagefap.com/organizer/<folder-id>/<folder-slug>                
  - https://www.imagefap.com/usergallery.php?userid=<user-id>&folderid=<folder- 
  id>
                                                                                
  Download a single gallery:                                                    
  - https://www.imagefap.com/gallery/<gallery-id>                               
  - https://www.imagefap.com/gallery.php?gid=<gallery-id>                       
  - https://www.imagefap.com/pictures/<gallery-id>/<gallery-slug>               

Options

  -h, --help                            Display this usage guide                
  -o, --out-dir <dir>                   Path to directory where content is      
                                        saved. Default: current working         
                                        directory                               
  -d, --dir-structure <flags>           Combination of flags controlling the    
                                        output directory structure of           
                                        downloaded galleries. See "Directory    
                                        structure flags" section for available  
                                        flags.                                  
  -f, --full-filenames                  Use full filename for image downloads.  
                                        If not specified, filenames may be      
                                        truncated. Note: getting full filenames 
                                        involves extra page requests that will  
                                        increase download time.                 
  -w, --overwrite                       Overwrite existing image files          
  -j, --no-json                         Do not save gallery info in JSON file   
  -m, --no-html                         Do not save original HTML               
  -l, --log-level <level>               Log level: 'info', 'debug', 'warn' or   
                                        'error'; set to 'none' to disable       
                                        logging. Default: info                  
  -s, --log-file <path>                 Save logs to <path>                     
  -r, --max-retries <number>            Maximum retry attempts when a download  
                                        fails. Default: 3                       
  -c, --max-concurrent <number>         Maximum number of concurrent image      
                                        downloads. Default: 10                  
  -p, --min-time-page <milliseconds>    Minimum time to wait between page fetch 
                                        requests. As a general rule, do not     
                                        set this lower than 2000, otherwise you 
                                        will likely get 'Too many requests'     
                                        errors. Default: 2000                   
  -i, --min-time-image <milliseconds>   Minimum time to wait between image      
                                        download requests. Default: 200         
  -y, --no-prompt                       Do not prompt for confirmation to       
                                        proceed                                 

Directory structure flags (--dir-structure)

  When downloading a gallery, the following flags specify which directory is to 
  be included in the output directory structure:                                

  u   Include directory for uploader of the gallery (note: does not apply when  
      uploader is anonymous)                                                    
  f   Include directory for folder containing the gallery (note: does not apply 
      when downloading a single gallery)                                        
  g   Include directory for the gallery itself                                  
  -   No directory structure. All images will be downloaded to --out-dir.       

  Default: ufg 

Changelog

v1.2.0

  • Add --full-filenames option (#2)

v1.1.1

  • Fix download of galleries from anonymous uploaders

v1.1.0

  • Optimize fetching of image URLs
  • Misc bug fixes

v1.0.0

  • Initial release

License

MIT

imagefap-dl's People

Contributors

patrickkfkan avatar

Stargazers

 avatar Seth avatar John Sanabria avatar  avatar  avatar  avatar  avatar Alisa Thea avatar  avatar  avatar  avatar  avatar  avatar Raleigh Littles avatar Amaya avatar  avatar  avatar  avatar โญ ๐Ÿพ avatar  avatar

Watchers

 avatar  avatar  avatar

imagefap-dl's Issues

fetching full original filenames

Downloaded files are stored as "xxxxxxxxxxxxxxxxx.. (photo-id).jpg" as this is the information available on gallery page.
However in individual photo page full original name is available in few tags: meta description, title, img title and img alt.

Can you add an option to fetch full filenames from individual photos pages?

Best regards,
Janusz

Download Problem

Suddenly I had a download problem. I am getting this code Uncaught SyntaxError: Unexpected identifier 'imagefap' in output. I have also done fresh installation, but nothing helps.

Gallery fails to download - Parser failed to obtain required properties from gallery page

Attempting to download a full gallery, I thought the problem might be I can't see a user who uploaded the gallery, so I used about every option I could find on the readme to not capture that data, simply just download the images. Still getting an error saying failed to obtain required properties. If I only want the images,unsure what other properties I can't get. Debugging logging didn't show any extra data.

I was able to previously download a different gallery, but that gallery did have a clear link to the user who uploaded it, where as this one didn't.

imagefap-dl -j -m --log-level debug -d - --out-dir gifs https://www.imagefap.com/pictures/8037543/

imagefap-dl v1.1.0 ImageFap gallery downloader

Log level: debug
Created ImageFapDownloader instance with config:  {
  outDir: '/media/raid5/cuntkittn/gifs',
  dirStructure: { uploader: false, folder: false, gallery: false },
  request: {
    maxRetries: 3,
    maxConcurrent: 10,
    minTime: { page: 2000, image: 200 }
  },
  overwrite: false,
  saveJSON: false,
  saveHTML: false,
  targetURL: 'https://www.imagefap.com/pictures/8037543/'
}

Proceed (Y/n)? y
Feb 18 16:58:13: info: ImageFapDownloader: Fetching gallery contents from "https://www.imagefap.com/pictures/8037543/"
Feb 18 16:58:13: debug: ImageFapDownloader: Fetch page "https://www.imagefap.com/pictures/8037543/"
Feb 18 16:58:14: error: ImageFapDownloader: Error fetching gallery "https://www.imagefap.com/pictures/8037543/" - download skipped:  Parser failed to obtain required properties from gallery page
Feb 18 16:58:14: info: ImageFapDownloader: Download complete
Feb 18 16:58:14: info: ImageFapDownloader: --------------
Feb 18 16:58:14: info: ImageFapDownloader: Download stats
Feb 18 16:58:14: info: ImageFapDownloader: --------------
Feb 18 16:58:14: info: ImageFapDownloader: Processed galleries: 0
Feb 18 16:58:14: info: ImageFapDownloader: Downloaded images: 0
Feb 18 16:58:14: info: ImageFapDownloader: Skipped existing images: 0
Feb 18 16:58:14: info: ImageFapDownloader: Errors: 0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.