1.0.2 • Published 6 years ago

traffic-cameras v1.0.2

Weekly downloads
2
License
GPL-3.0
Repository
github
Last release
6 years ago

traffic-cameras

npm.io (better quality here)

npm.io npm.io


npm version

Easily batch download images from Minnesota (and Iowa) traffic cameras

  • easy to use

  • powerful command line options

  • option to save metadata

  • adjustable concurrent requests

How do I install this?

to install via NPM type the following into terminal:

npm i -g traffic-cameras

this will install the module globally, meaning you can use traffic-cameras in terminal to run it

Examples

  • download all MN traffic cameras to the current directory

    traffic-cameras

  • download all MN traffic cameras to a folder called 'images'

    traffic-cameras --directory images

  • download all MN traffic cameras into their own folder (if you want to do timelapses) *This option changes how files are titled so you can run this command on a timer and generate a timelapse

traffic-cameras --folders

  • download all Iowa traffic camera images to the current directory

traffic-cameras --json https://tr.511ia.org/tgcameras/api/cameras

Command line options

long_argumentshortinput typedescriptiondefault
--timeout-tintegerspecifies the timeout (in ms) for downloading individual images4000
--retries-rintegernumber of times to attempt retrying the download of a broken image3
--concurrency-cintegernumber of concurrent downloads supported10
--verbose-vn/a (flag)enables more detailed terminal loggingdisabled
--quiet-qn/a (flag)disables ALL console outputdisabled
--log-ln/a (flag)saves verbose output to log.logdisabled
--directory-dfile pathdirectory/path to save images tocurrent directory
--json-jurlURL of camera api JSON file to fetch cameras from*see belowy
--folders-fn/a (flag)separates each camera to its own folder. useful for creating timelapsesdisabled
--no-metadata-mn/a (flag)disables saving of metadata JSON filesenabled (ie metadata is saved)

* the default value for --json is https://tr.511mn.org/tgcameras/api/cameras