{"id":37204462,"url":"https://github.com/greenlightning/advent-of-code-downloader","last_synced_at":"2026-01-14T23:34:12.433Z","repository":{"id":64056284,"uuid":"113819766","full_name":"GreenLightning/advent-of-code-downloader","owner":"GreenLightning","description":"⭐️ Command line utility that automatically downloads your Advent of Code puzzle inputs.","archived":false,"fork":false,"pushed_at":"2025-12-04T23:12:08.000Z","size":30,"stargazers_count":75,"open_issues_count":0,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-12-08T07:18:09.048Z","etag":null,"topics":["advent-of-code","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GreenLightning.png","metadata":{"files":{"readme":"readme.markdown","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-11T06:11:29.000Z","updated_at":"2025-12-04T23:11:38.000Z","dependencies_parsed_at":"2023-01-25T08:45:13.400Z","dependency_job_id":null,"html_url":"https://github.com/GreenLightning/advent-of-code-downloader","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/GreenLightning/advent-of-code-downloader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GreenLightning%2Fadvent-of-code-downloader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GreenLightning%2Fadvent-of-code-downloader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GreenLightning%2Fadvent-of-code-downloader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GreenLightning%2Fadvent-of-code-downloader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GreenLightning","download_url":"https://codeload.github.com/GreenLightning/advent-of-code-downloader/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GreenLightning%2Fadvent-of-code-downloader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28438732,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T22:37:52.437Z","status":"ssl_error","status_checked_at":"2026-01-14T22:37:31.496Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["advent-of-code","go","golang"],"created_at":"2026-01-14T23:34:11.888Z","updated_at":"2026-01-14T23:34:12.422Z","avatar_url":"https://github.com/GreenLightning.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Advent of Code Downloader\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/GreenLightning/advent-of-code-downloader)](https://goreportcard.com/report/github.com/GreenLightning/advent-of-code-downloader)\n\n`aocdl` is a command line utility that automatically downloads your [Advent of\nCode](https://adventofcode.com/) puzzle inputs.\n\nThis tool is for competitive programmers, who want to solve the puzzles as\nfast as possible. Using the `-wait` flag you can actually start the program\nbefore the puzzle is published, thus spending exactly zero seconds of\ncompetition time on downloading the input (see [Basic Usage](#basic-usage) for\ndetails).\n\nIf you are working with the command line, it might also be more comfortable to\ntype `aocdl -year 2015 -day 1` instead of downloading the puzzle input using\nthe browser.\n\n*Trivia*: If the puzzle input is very short, it will be embedded into the\npuzzle page instead of being linked (for an example see [day 4 of\n2015](https://adventofcode.com/2015/day/4)). Thanks to the consistent API of\nthe Advent of Code website, these puzzle inputs can be downloaded exactly like\nthe normal, longer puzzle inputs.\n\n## Installation\n\n#### Binary Download\n\nYou can download pre-compiled binaries from the\n[releases](https://github.com/GreenLightning/advent-of-code-downloader/releases/latest/)\npage. Just unzip the archive and place the binary in your working directory or\nin a convenient location in your PATH.\n\n#### Build From Source\n\nIf you have the [Go](https://golang.org/) compiler installed, you can use the\nstandard `go install` command to download, build and install `aocdl`.\n\n```\ngo install github.com/GreenLightning/advent-of-code-downloader/aocdl@latest\n```\n\n## Setting the Session Cookie\n\nYour session cookie is required to download your personalized puzzle input.\nSee the two sections below, if you want to know what a session cookie is or\nhow to get yours. The session cookies from the Advent of Code website are\nvalid for about a month, so you only have to get your cookie once per event.\nYou can provide it to `aocdl` in two ways.\n\nSet your session cookie as a command line parameter:\n\n```\naocdl -session-cookie 0123456789...abcdef\n```\n\nOr create a configuration file named `.aocdlconfig` in your home directory or in\nthe current directory and add the `session-cookie` key:\n\n```json\n{\n\t\"session-cookie\": \"0123456789...abcdef\"\n}\n```\n\nYou can test your setup by downloading an old puzzle input using `aocdl -year\n2020 -day 1`. You will get an appropriate error message if the program cannot\nfind a session cookie. However, if you get a `500 Internal Server Error`, this\nmost likely means your session cookie is invalid or expired.\n\n#### What Is a Session Cookie?\n\nA session cookie is a small piece of data used to authenticate yourself to the\nAdvent of Code web servers. It is not human-readable and might look something\nlike this (this is not a valid cookie):\n\n```\n53616c7465645f5fbd2d445187c5dc5463efb7020021c273c3d604b5946f9e87e2dc30b649f9b2235e8cd57632e415cb\n```\n\nWhen you log in, the Advent of Code server generates a new session cookie and\nsends it to your browser, which saves it on your computer. Every time you make\na request, your browser sends the cookie back to the server, which is how the\nserver knows that the request is from you and not somebody else. That way the\nserver can send you a personalized version of the website (for example\ndisplaying your username and current number of stars or sending you your\npersonal puzzle input instead of somebody else's input).\n\n#### How Do I Get My Session Cookie?\n\nGoogle Chrome:\n\n- Go to [adventofcode.com](https://adventofcode.com/)\n- Make sure you are logged in\n- Right click and select \"Inspect\"\n- Select the \"Application\" tab\n- In the tree on the left, select \"Storage\" → \"Cookies\" → \"https://adventofcode.com\"\n- You should see a table of cookies, find the row with \"session\" as name\n- Double click the row in the \"Value\" column to select the value of the cookie\n- Press `CTRL + C` or right click and select \"Copy\" to copy the cookie\n- Paste it into your configuration file or on the command line\n\nMozilla Firefox:\n\n- Go to [adventofcode.com](https://adventofcode.com/)\n- Make sure you are logged in\n- Right click and select \"Inspect Element\"\n- Select the \"Storage\" tab\n- In the tree on the left, select \"Cookies\" → \"https://adventofcode.com\"\n- You should see a table of cookies, find the row with \"session\" as name\n- Double click the row in the \"Value\" column to select the value of the cookie\n- Press `CTRL + C` or right click and select \"Copy\" to copy the cookie\n- Paste it into your configuration file or on the command line\n\n## Basic Usage\n\nAssuming you have created a configuration file (if not you must provide your\nsession cookie as a parameter), the following command will attempt to download\nthe input for the current day and save it to a file named `input.txt`:\n\n```\naocdl\n```\n\nIf you specify the `-wait` flag, the program will display a countdown waiting\nfor midnight (when new puzzles are released) and then download the input of\nthe new day:\n\n```\naocdl -wait\n```\n\nFinally, you can also specify a day (and year) explicitly.\n\n```\naocdl -day 1\naocdl -year 2015 -day 1\n```\n\n## Options\n\n\t-session-cookie 0123456789...abcdef\n\t\tUse the specified string as session cookie.\n\n\t-output input.txt\n\t\tSave the downloaded puzzle input to the specified file. The special\n\t\tmarkers {{.Year}} and {{.Day}} will be replaced with the selected year\n\t\tand day. [see also Go documentation for text/template]\n\n\t-year 2000\n\t-day 24\n\t\tDownload the input from the specified year or day. By default the\n\t\tcurrent year and day is used.\n\n\t-config path/to/config.aocdlconfig\n\t\tLoad options from a custom configuration file (see below for details).\n\n\t-force\n\t\tOverwrite file if it already exists.\n\n\t-wait\n\t\tIf this flag is specified, year and day are ignored and the program\n\t\twaits until midnight (when new puzzles are released) and then downloads\n\t\tthe input of the new day. While waiting a countdown is displayed. To\n\t\treduce load on the Advent of Code servers, the download is started after\n\t\ta random delay between 2 and 30 seconds after midnight.\n\n## Configuration Files\n\nThe program looks for configuration files named `.aocdlconfig` in the user's\nhome directory and in the current working directory. An additional, custom\nconfiguration file can be specified via the `-config` command line flag.\n\nThe configurations are merged in the following order, with later entries having\nhigher priority. Each option is taken from the last configuration that specifies\nit:\n- configuration file in home directory\n- configuration file in current directory\n- custom configuration file, if specified via -config flag\n- command line parameters\n\nConfiguration files must contain one valid JSON object. The following keys\ncorresponding to some of the command line parameters above are accepted:\n\n| Key              | Type   |\n| ---------------- | ------ |\n| \"session-cookie\" | String |\n| \"output\"         | String |\n| \"year\"           | Number |\n| \"day\"            | Number |\n\nA fully customized configuration file might look like this, although the program\nwould only ever download the same input unless the date is specified on the\ncommand line:\n\n```json\n{\n\t\"session-cookie\": \"0123456789...abcdef\",\n\t\"output\": \"input-{{.Year}}-{{.Day}}.txt\",\n\t\"year\": 2015,\n\t\"day\": 24\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreenlightning%2Fadvent-of-code-downloader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreenlightning%2Fadvent-of-code-downloader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreenlightning%2Fadvent-of-code-downloader/lists"}