Make smaller PDFs or EPUBs out of your book files with this single page application. Useful for speed reading books on mobile.
- In Google Cloud Console, create or select a project.
- Enable the Google Picker API and Google Drive API.
- Create an API key and an OAuth 2.0 Web application client ID.
- Add the exact origin where this app runs to the OAuth client's authorized JavaScript origins. For local use, serve this folder over
http://localhostorhttp://localhost:8000and add that exact origin to the OAuth client. Do not openindex.htmldirectly from the filesystem; Google rejectsfile://origins withinvalid_request. - Set
GOOGLE_CLIENT_IDandGOOGLE_API_KEYnear the top of the main script inindex.html. - Run a local web server from this folder, for example:
python -m http.server 8000and then openhttp://localhost:8000.
The Drive integration requests read-only access, filters for PDF and EPUB files, and downloads the selected file locally for extraction. No Drive files are uploaded or modified.
This project has no build step; it is a static HTML app. The Google client ID and API key are embedded in the frontend, which is normal for a browser-only app. They are restricted by allowed origins and test-user access, so they are effectively unusable to others unless they match the same origin and Gmail account. This is a pragmatic personal setup rather than a production-grade security model. Google client secret is not exposed here.