{"id":13393754,"url":"https://github.com/gen2brain/url2img","last_synced_at":"2025-03-13T19:31:46.103Z","repository":{"id":38983773,"uuid":"74064091","full_name":"gen2brain/url2img","owner":"gen2brain","description":"HTTP server with API for capturing screenshots of websites","archived":true,"fork":false,"pushed_at":"2021-05-20T19:29:56.000Z","size":53,"stargazers_count":530,"open_issues_count":2,"forks_count":44,"subscribers_count":22,"default_branch":"master","last_synced_at":"2024-02-15T09:33:26.089Z","etag":null,"topics":["capture-screenshots","headless","http-server","screenshot"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gen2brain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-17T20:21:48.000Z","updated_at":"2024-02-06T08:57:55.000Z","dependencies_parsed_at":"2022-09-19T15:20:32.633Z","dependency_job_id":null,"html_url":"https://github.com/gen2brain/url2img","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gen2brain%2Furl2img","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gen2brain%2Furl2img/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gen2brain%2Furl2img/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gen2brain%2Furl2img/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gen2brain","download_url":"https://codeload.github.com/gen2brain/url2img/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243469201,"owners_count":20295707,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["capture-screenshots","headless","http-server","screenshot"],"created_at":"2024-07-30T17:00:59.843Z","updated_at":"2025-03-13T19:31:45.712Z","avatar_url":"https://github.com/gen2brain.png","language":"Go","funding_links":[],"categories":["Go","Go (531)","Servers","Web Application Testing"],"sub_categories":[],"readme":"## url2img\n\nurl2img is HTTP server with API for capturing screenshots of websites.\n\nExample (command line):\n\n    $ curl -s http://localhost:55888/?url=google.com \u003e google.jpg\n\nExample (web browser):\n\n    http://localhost:55888/?url=google.com\u0026output=html\n\n### API\n\nName    | Type      | Default   | Description\n----    | ----      | -------   | -----------\nurl     | string    |           | Target URL (**required**), http(s):// prefix is optional\noutput  | string    | raw       | Output format (raw, base64, html)\nformat  | string    | jpg       | Image format (jpg, png)\nua      | string    |           | User-Agent string\nquality | int       | 85        | Image quality\ndelay   | int       | 0         | Delay screenshot after page is loaded (milliseconds)\nwidth   | int       | 1600      | Viewport width\nheight  | int       | 1200      | Viewport height\nzoom    | float     | 1.0       | Zoom factor\nfull    | bool      | false     | Capture full page height\n\n### Usage\n\n    Usage of url2img:\n\n      -bind-addr string\n            Bind address (default \":55888\")\n      -cache-dir string\n            Path to cache directory, if empty caching is disabled\n      -htpasswd-file string\n            Path to htpasswd file, if empty auth is disabled\n      -log-file string\n            Path to log file, if empty logs to stdout\n      -max-age int\n            Cache maximum age (seconds) (default 86400)\n      -read-timeout int\n            Read timeout (seconds) (default 5)\n      -write-timeout int\n            Write timeout (seconds) (default 15)\n\n### Auth\n\nIf server is started with -htpasswd-file it will be protected with HTTP Basic Auth. Supports MD5, SHA1 and BCrypt (https://github.com/abbot/go-http-auth).\n\nExamples:\n\n    $ htpasswd -c .htpasswd username\n    $ url2img -htpasswd-file .htpasswd\n\n    $ curl -I 'http://localhost:55888/?url=google.com'\n\n    HTTP/1.1 401 Unauthorized\n    Content-Type: text/plain; charset=utf-8\n    Www-Authenticate: Basic realm=\"url2img/1.0\"\n    X-Content-Type-Options: nosniff\n    Date: Wed, 09 Nov 2016 17:50:33 GMT\n    Content-Length: 17\n\n    $ curl -u username:password -s http://localhost:55888/?url=google.com \u003e google.jpg\n    $ curl -s http://username:password@localhost:55888/?url=google.com \u003e google.jpg\n    $ curl --netrc-file my-password-file http://localhost:55888/?url=google.com \u003e google.jpg\n\n### Cache\n\nIf server is started with -cache-dir it will cache HTTP responses to disk according to RFC7234 (https://github.com/lox/httpcache).\nYou can use -max-age to control maximum age of cache file, default is 86400 seconds (1 day).\n\nExample:\n\n    $ curl -I 'http://localhost:55888/?url=https://reddit.com'\n\n    HTTP/1.1 200 OK\n    Accept-Ranges: bytes\n    Age: 21\n    Cache-Control: public,max-age=86400\n    Content-Length: 21107\n    Content-Type: image/jpeg\n    Last-Modified: Wed, 09 Nov 2016 18:25:26 GMT\n    Proxy-Date: Wed, 09 Nov 2016 17:25:26 GMT\n    Server: url2img/1.0\n    Via: 1.1 httpcache\n    X-Cache: HIT\n    Date: Wed, 09 Nov 2016 17:25:47 GMT\n\nIf you want uncached response you can request it via Cache-Control header:\n\n    $ curl -H 'Cache-Control: no-cache' 'http://localhost:55888/?url=https://reddit.com'\n\nOr you can send POST request with json body, POST requests are never cached:\n\n    $ curl -X POST -d '{\"url\": \"https://reddit.com\", \"format\": \"png\"}' http://localhost:55888\n\n### Reload\n\nTo reload server (e.g. when .htpasswd is changed or log file is rotated) send SIGHUP signal to process.\nIf you use one of the provided init scripts just do a reload.\n\n### Download\n\nBinary is compiled fully static with musl toolchain. It should work on all systems without any additional dependencies.\nSystemd and OpenRC init scripts are included in dist/.\n\n - [Linux 64bit](https://github.com/gen2brain/url2img/releases/download/1.4/url2img-1.4.tar.xz)\n\n### Alternative: run in Docker container\n\nAn alternative is to run everything in a container. Change to the `dist/docker` directory and:\n\n    # Build container: `docker build -t url2img .`\n    # Then run container: `docker run -p 55888:55888 url2img`\n\nOutput should be like this:\n\n```\n$ docker run -p 55888:55888 url2img\nrunning server on port 55888\n```\n\n### Compile\n\nInstall Qt bindings (https://github.com/therecipe/qt) with WebKit (see https://github.com/therecipe/qt/wiki/Installing-QtWebKit-Module).\n\nInstall url2img to $GOPATH/bin:\n\n    $ go get -d github.com/gen2brain/url2img\n    $ go generate github.com/gen2brain/url2img/url2img\n    $ qtminimal linux $GOPATH/src/github.com/gen2brain/url2img/url2img\n    $ go install -tags minimal github.com/gen2brain/url2img/cmd/url2img\n\n### License\n\nurl2img is free/libre software released under the terms of the GNU GPL license, see the 'COPYING' file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgen2brain%2Furl2img","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgen2brain%2Furl2img","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgen2brain%2Furl2img/lists"}