ZA

zstmfhy/annas-to-notebooklm

Developer tools
209 stars 품질 41 트렌드 41

Automatically download books from Anna's Archive and upload them to Google NotebookLM with one command.

개요

Automatically download books from Anna's Archive and upload them to Google NotebookLM with one command.

README

📚 Anna’s Archive to NotebookLM

English | 简体中文

Automatically download books from Anna’s Archive and upload them to Google NotebookLM with one command.


⚠️ Important Disclaimer

This project is for educational, research, and technical demonstration purposes only. Please strictly comply with local laws and copyright regulations. Use only for:

  • ✅ Resources you have legal access to
  • ✅ Public domain or open-source licensed documents (e.g., arXiv, Project Gutenberg)
  • ✅ Content you personally own or have authorization to use

The author does not encourage or support any form of copyright infringement and assumes no legal liability. Use at your own risk.

Please respect intellectual property rights and support authorized reading!


✨ Features

  • 🔐 One-time Login, Forever Use - Similar to notebooklm login experience
  • 📥 Smart Download - Automatically extracts download links from Anna’s Archive pages
  • 📦 Smart Chunking - Large files auto-split (>350k words) for reliable CLI upload
  • 🤖 Fully Automated - Complete workflow with a single command
  • 🎯 Format Adaptive - Automatically detects and processes multiple formats (PDF, EPUB)
  • 📊 Visual Progress - Real-time display of download and conversion progress

Installation

# 1. Navigate to Claude Skills directory
cd ~/.claude/skills  # Windows: %APPDATA%\Claude\skills

# 2. Clone or copy this repository
git clone https://github.com/yourusername/annas-to-notebooklm.git

# 3. Complete initial login
cd annas-to-notebooklm
python3 scripts/login.py

Usage

After installation, simply tell Claude Code:

Use annas-to-notebooklm skill to process this Anna's Archive link:
https://annas-archive.pm/slow_download/3cd1081b5bc0a229bb794f0d96f04e22/0/5

Claude will automatically:

  • Visit the download page
  • Extract the download link (from span.bg-gray-200 tag)
  • Download the book
  • Create NotebookLM notebook
  • Upload the file
  • Return notebook ID
  • Suggest follow-up questions

🛠️ Traditional Installation

1. Install Dependencies

# Clone repository
git clone https://github.com/yourusername/annas-to-notebooklm.git
cd annas-to-notebooklm

# Install Python dependencies
pip install playwright ebooklib beautifulsoup4 lxml

# Install Playwright browser
playwright install chromium

2. Login to Anna’s Archive (One-time Only)

python3 scripts/login.py

Steps:

  1. Browser will automatically open and visit Anna’s Archive
  2. Complete login in the browser (if required)
  3. Return to terminal and press ENTER
  4. Session saved!

3. Download and Upload Books

python3 scripts/upload.py "https://annas-archive.pm/slow_download/..."

Automatically completes:

  • ✅ Login using saved session
  • ✅ Extract download link from page
  • ✅ Download book (PDF/EPUB)
  • ✅ Convert EPUB to Markdown (if needed)
  • ✅ Smart chunking for large files (>350k words)
  • ✅ Create NotebookLM notebook
  • ✅ Upload content
  • ✅ Return notebook ID

📖 Usage Examples

Basic Usage

# Download single book
python3 scripts/upload.py "https://annas-archive.pm/slow_download/..."

Batch Processing

# Batch download multiple books
for url in "url1" "url2" "url3"; do
    python3 scripts/upload.py "$url"
done

Using NotebookLM

# After upload, use the notebook
notebooklm use 

# Start asking questions
notebooklm ask "What are the core concepts of this book?"
notebooklm ask "Summarize Chapter 3"

🔄 Workflow

Anna's Archive URL
    ↓
1. Launch browser (using saved session)
    ↓
2. Visit download page
    ↓
3. Extract download link:
   - Find span.bg-gray-200 tag
   - Extract  tag with download URL
    ↓
4. Navigate to download URL
    ↓
5. Download to ~/Downloads
    ↓
6. Format processing:
   - PDF → Use directly
   - EPUB → Convert to Markdown
   - Check file size → Auto-chunk if >350k words
    ↓
7. Create NotebookLM notebook
    ↓
8. Upload content (chunked files uploaded individually)
    ↓
9. Return notebook ID ✅

📁 Project Structure

annas-to-notebooklm/
├── SKILL.md              # Core Skill definition (required)
├── README.md             # Project documentation
├── README.zh-CN.md       # Chinese documentation
├── LICENSE               # MIT License
├── package.json          # npm config (for Claude Code skill)
├── skill.yaml            # Skill configuration
├── requirements.txt      # Python dependencies
├── scripts/              # Executable scripts (official standard)
│   ├── login.py         # Login script
│   ├── upload.py        # Download + Upload script
│   └── convert_epub.py  # EPUB conversion tool
├── docs/                 # Documentation
│   ├── WORKFLOW.md      # Workflow details
│   └── TROUBLESHOOTING.md # Troubleshooting guide
└── INSTALL.md            # Installation guide

🔧 Configuration

All configurations are saved in ~/.annas/ directory:

~/.annas/
├── storage_state.json    # Login session (cookies)
├── browser_profile/      # Browser data
└── config.json          # Account config (backup)

🛠️ Dependencies

  • Python 3.8+
  • playwright - Browser automation
  • ebooklib - EPUB file processing
  • beautifulsoup4 - HTML parsing
  • NotebookLM CLI - Google NotebookLM command-line tool

📝 Command Reference

Login

python3 scripts/login.py

Upload

python3 scripts/upload.py 

Check Session Status

ls -lh ~/.annas/storage_state.json

Re-login

rm ~/.annas/storage_state.json
python3 scripts/login.py

📊 NotebookLM Limits

This project is optimized for NotebookLM’s actual limitations:

Official Limits

  • File Size: 200MB per file
  • Words per Source: 500,000 words

Practical Recommendations (CLI Tool)

  • Safe Word Count: Maximum 350,000-380,000 words per file
  • Reason: NotebookLM CLI tool has timeout and API limitations with large files

Our Solution

✅ Automatic File Chunking:

  • When EPUB is converted to Markdown, the script automatically detects word count
  • Files exceeding 350,000 words are automatically split into multiple smaller files
  • Each chunk is uploaded individually to the same NotebookLM notebook
  • Smart chapter-based splitting preserves content integrity

Example:

📊 Word count: 2,700,000
⚠️  File exceeds 350k words (NotebookLM CLI limit)
📊 File too large, starting split...
   Total words: 2,700,000
   Max per chunk: 350,000 words
   ✅ Part 1/8: 342,000 words
   ✅ Part 2/8: 338,000 words
   ...
📦 Detected 8 file chunks

Why 350k Words?

  • Official limit is 500k words, but CLI tools tend to timeout near this limit
  • 350k words is a tested safe value for reliable uploads
  • Web interface can handle larger files directly, but CLI tools require chunking

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details

🙏 Acknowledgments

📮 Contact


⭐ If this project helps you, please give it a Star!

View this README on GitHub

추천 도구

다른 키워드를 입력하거나 필터를 제거해 보세요.

설치

npx skillfish add zstmfhy/annas-to-notebooklm