google-images-download icon indicating copy to clipboard operation
google-images-download copied to clipboard

Allow global arguments in config file

Open afcruzs opened this issue 5 years ago • 2 comments

When using the json config file all the arguments must be set per record. In some cases like chromedriver, the argument is the same across all the records. I propose to read such 'global' arguments for all the records to avoid duplication.

It would be something like:

{
    "chromedriver: "<thepath>",
     "Records": [...]
}

As opposed to:

{
     "Records": [
           { 
                   keywords":"class 1",
                   "chromedriver: "<thepath>"
                    .....
           },
           { 
                   keywords":"class 2",
                   "chromedriver: "<thepath>"
                    .....
           }
           ....
      ]

}

If the global argument is defined in both places (the record and the global section) then we can either override the record specific with the global (or vice versa), or fail the process to force the user to use one of both. I lean towards overwriting the global using the record specific argument.

Based on the arguments from args_list I think should the following should be "global":

  • chromedriver
  • usage_rights
  • exact_size
  • aspect_ratio
  • type
  • specific_site
  • print_paths
  • safe_search
  • language

I'm happy to raise a PR to implement this change if it sounds ok :-)

afcruzs avatar Nov 28 '18 07:11 afcruzs

created a PR for the same #194

shubham-5592 avatar Dec 04 '18 07:12 shubham-5592

Any updates on this request? It would be really useful

JulianJB avatar Apr 07 '21 09:04 JulianJB