Summarise longer texts (eBooks, Youtube, PDFs, etc.) with chatGPT
- Install Python: https://www.python.org/
- Download chromedriver https://chromedriver.chromium.org/downloads - NOTE: make sure you download the version that matches your Google Chrome version (check in About Chrome)
- Put the chromedriver executable file in a location and add that location to the PATH - follow guide here for Windows: and here for Mac:
- Create a chatGPT account: https://chat.openai.com/chat and log in using Google Chrome
- Press F12 to open console in Chrome. Go to Application > Cookies and Copy the session token value in __Secure-next-auth.session-token
- Download or git clone this repository to a local folder of your choice
git clone https://github.com/JunMagic88/TLDR.git
- Using a text editor, create and save a file named .env (no file extension) with a single line in its content: CHATGPT_SESSION_TOKEN=XXXXXXX replace XXXXXXX with the session token you got from step 5
- Navigate to the TLDR folder in Terminal (Mac) or Command Prompt (Windows) and run:
pip install -r requirements
- Add any .txt files in the /Texts folder
- Add any .epub or .pdf files in the /00.EPUBs+PDFs folder
- Add any YouTube links (can be video or public playlist URLs) to the Youtube
- Run this to download the transcripts of the YouTube videos to the /Texts folder
python 01.GetTranscripts.py
- Run this to convert the epub and PDF files into .txt and save them in the /Texts folder
python 01.ParseToTxt.py
- Run this to break the files in /Texts into chunks that would fit into single chatGPT window
python 02.Chunkify.py
- Run this to start the summarisation. This should start a Chrome window. Do you try to login, it will close automatically. The summarised chunks are saved in /ChunkSummaries folder
python 03.Summarise.py
- Run this after all the chunks have been summarised. This will combine all chunk summaries back into a final summary for for each text in the FinalSummaries folder.
python 04.CombineSummaries.py