{"id":18607317,"url":"https://github.com/addono/hathitrust-downloader","last_synced_at":"2025-08-24T21:21:33.511Z","repository":{"id":62568951,"uuid":"264197063","full_name":"Addono/HathiTrust-downloader","owner":"Addono","description":"Small and simple command line tool to automate downloading pages from HathiTrust","archived":false,"fork":false,"pushed_at":"2024-12-30T11:57:03.000Z","size":83,"stargazers_count":42,"open_issues_count":0,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T06:07:01.236Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://gh.aknapen.nl/HathiTrust-downloader/","language":"Python","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/Addono.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-15T13:12:06.000Z","updated_at":"2025-03-18T02:48:50.000Z","dependencies_parsed_at":"2025-01-15T09:29:38.494Z","dependency_job_id":"1248bf11-01b9-42d8-8b80-47634cfc70c8","html_url":"https://github.com/Addono/HathiTrust-downloader","commit_stats":{"total_commits":48,"total_committers":1,"mean_commits":48.0,"dds":0.0,"last_synced_commit":"48213a0a33a86e0e27b8689a3eb0259c448c6165"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Addono%2FHathiTrust-downloader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Addono%2FHathiTrust-downloader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Addono%2FHathiTrust-downloader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Addono%2FHathiTrust-downloader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Addono","download_url":"https://codeload.github.com/Addono/HathiTrust-downloader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247994121,"owners_count":21030050,"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":[],"created_at":"2024-11-07T02:28:58.162Z","updated_at":"2025-08-24T21:21:33.497Z","avatar_url":"https://github.com/Addono.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HathiTrust Downloader\n[![PyPI](https://img.shields.io/pypi/v/hathitrust-downloader?style=flat-square\u0026logo=pypi)][pypi]\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/hathitrust-downloader?logo=pypi\u0026style=flat-square)][pypi]\n[![GitHub version](https://img.shields.io/github/release/Addono/HathiTrust-downloader.svg?style=flat-square\u0026logo=github)][github-releases]\n[![GitHub download](https://img.shields.io/github/downloads/Addono/HathiTrust-downloader/total.svg?style=flat-square\u0026logo=github)][github-releases]\n[![GitHub stars](https://img.shields.io/github/stars/Addono/HathiTrust-downloader?style=flat-square)](https://github.com/Addono/HathiTrust-downloader/stargazers)\n[![License](https://img.shields.io/github/license/Addono/HathiTrust-downloader.svg?style=flat-square)](LICENSE)\n[![CI](https://img.shields.io/github/actions/workflow/status/Addono/HathiTrust-downloader/ci.yaml?event=push\u0026style=flat-square)][ci-badge]\n\n## Installing\n\n### Python 3 (OS Agnostic)\n\nCheck that you have Python 3 installed and available on your shell. The following command should return something like `Python 3.12.5`. \n\n```bash\npython -V\n```\n\n\u003e Windows users: Make sure to enable the \"Add to PATH\" option when installing Python.\n\nNow you can install using `pip` with the following command.\n\n```bash\npip install hathitrust-downloader\n```\n\nWhich allows you to interact with the downloader from the command line:\n\n```bash\nhathitrust-downloader --help\n```\n\n### Windows Executable\n\nThere are also Windows executables available. Download the `downloader_\u003cversion\u003e_win.zip` from [releases](https://github.com/Addono/HathiTrust-downloader/releases/) and extract it. Then open a shell, e.g. `cmd` or `powershell`, to the directory where the ZIP is extracted. The easiest way to do this is by opening the folder in Explorer and right click while holding shift, now select the option \"Open PowerShell Window Here\".\n\nThe executable is bundled with Python and all other dependencies, hence you do not need to have anything installed. Now the tool can be used like:\n\n```powershell\n.\\downloader.exe --help \n```\n\n## Usage\n\nThe help should give some instructions on how to use the tool:\n\n```bash\nusage: hathitrust-downloader [-h] [--name NAME] [--user-agent USER_AGENT] [--max-retries MAX_RETRIES] id start_page end_page\n\nBook downloader for HathiTrust\n\npositional arguments:\n  id                    The ID of the book, e.g 'mdp.39015002388380' or a complete URL.\n  start_page            The page number of the first page to be downloaded.\n  end_page              The last number of the last page to be downloaded (inclusive).\n\noptions:\n  -h, --help            show this help message and exit\n  --name NAME           The start of the filename. Defaults to using the id. This can also be used to change the path.\n  --user-agent USER_AGENT\n                        The User-Agent string to use for requests.\n  --max-retries MAX_RETRIES\n                        The maximum number of retries for retriable errors (e.g., 403 Forbidden) before skipping a page. Default is 8.\n```\n\nFor example, the following command will download page 1 until (and including) 10 of the book with id `mdp.39015073487137` and naming the files output files `my-book_page_\u003cpage_number\u003e.pdf`:\n\n```bash\nhathitrust-downloader mdp.39015073487137 1 10 --name my-book\n```\n\n\u003e [!IMPORTANT]\n\u003e The ID of the file can be found as part of the URL when opening a book through your browser. Below is an example URL and where to find the ID:\n\u003e ```\n\u003e https://babel.hathitrust.org/cgi/pt?id=mdp.39015073487137\u0026seq=13\n\u003e                                        ^^^^^^^^^^^^^^^^^^ This demarks the ID of this book\n\u003e ```\n\n\n\u003e [!TIP]\n\u003e Alternatively to providing the ID, you can provide the complete URL containing the ID. Then the the tool will attempt to parse the ID from the URL automatically for you.\n\u003e\n\u003e For example, you can use it like so:\n\u003e\n\u003e ```bash\n\u003e hathitrust-downloader 'https://babel.hathitrust.org/cgi/pt?id=mdp.39015073487137\u0026seq=13' 1 10 --name my-book\n\u003e ```\n\n\n## Troubleshooting\n\n### No Progess / Progress Bar is Stuck\n\nMake sure that you can access books on HathiTrust. Try to open a book in your browser to see if everything is working fine. HathiTrust can require you to connect from an American IP. In addition, they limit the amount of pages you can download to 15 every 5 minutes. When you hit that limit you will need to wait, the tool will automatically wait and resume when the timeout is finished.\n\n[pypi]: https://pypi.org/project/hathitrust-downloader/\n[github-releases]: https://github.com/Addono/HathiTrust-downloader/releases/latest\n[ci-badge]: https://img.shields.io/github/actions/workflow/status/Addono/HathiTrust-downloader/ci.yaml?event=push\u0026style=flat-square\n\n## Developing\n\nClone the repository:\n\n```bash\ngit clone https://github.com/Addono/HathiTrust-downloader.git\ncd ./HathiTrust-downloader\n```\n\n(Optional) Create a virtual Python environment, recommended but not required.\n\nInstall the package with dependencies:\n```\npip install .\n```\n\nNow you can run the tool with:\n\n```bash\npython -m hathitrustdownloader.cli --help\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faddono%2Fhathitrust-downloader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faddono%2Fhathitrust-downloader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faddono%2Fhathitrust-downloader/lists"}