Automation

E-book Download Skill with Claude and Telegram

Tutorial on building a Claude skill to download e-books via Telegram bot integrated with Zlib, planned for NotebookLM integration.

February 23, 2026
6 min read
By ClawList Team

Build a One-Sentence E-Book Downloader: Claude + Telegram + Zlib Skill

Automate your reading pipeline with a custom OpenClaw skill that fetches e-books on demand — and sets the stage for AI-powered analysis with NotebookLM.


If you've ever found yourself switching between browser tabs, hunting for a PDF, waiting for a download, and then manually uploading it somewhere for analysis — this post is for you. Developer @vista8 shared a clever automation on X that collapses that entire workflow into a single natural-language command. The result? A Claude skill that lets you say "download The Pragmatic Programmer" and have the e-book sitting on your local machine moments later.

Let's break down how it works, how you can build it, and why it's a genuinely exciting pattern for AI-assisted research workflows.


How the Skill Works: The Three-Layer Architecture

The magic here lives in the orchestration between three components: Claude as the brain, Telegram as the transport layer, and Zlib as the book source. Here's the high-level flow:

User prompt → Claude Skill → Telethon (Telegram CLI) → Zlib Bot → Local file

Layer 1: The Zlib Telegram Bot

Z-Library — the massive digital library with millions of e-books — operates a Telegram bot that lets users search and download books directly through chat. Once you've linked your Z-Library account to the Telegram bot, you can send it a book title and receive a downloadable file in return.

This is the key insight: the Zlib bot is already a functional API — it just speaks Telegram's protocol instead of HTTP/REST. That means anything that can send and receive Telegram messages can interact with it programmatically.

Layer 2: Telethon as the Programmatic Telegram Client

This is where it gets interesting. Rather than using Telegram's Bot API (which requires you to operate a bot), @vista8 used Telethon — a Python-based MTProto client — to log in as a real Telegram user account and interact with the Zlib bot just like a human would.

pip install telethon

After installation, you authenticate with your Telegram credentials to generate a session string — a persistent token that lets the script act as your account without requiring login every time.

from telethon.sync import TelegramClient

api_id = YOUR_API_ID        # From my.telegram.org
api_secret = YOUR_API_HASH  # From my.telegram.org

with TelegramClient('session_name', api_id, api_secret) as client:
    print(client.get_me())
    # Save the session for reuse in your skill

Note: Using a user account (rather than a bot token) to automate actions sits in a legal/ToS gray area on most platforms. Use a dedicated account, be respectful of rate limits, and review Telegram's Terms of Service before deploying this at scale.

Layer 3: The Claude OpenClaw Skill

With Telethon authenticated and the session saved, the final piece is wrapping this into a Claude skill — a callable tool that Claude can invoke when it detects a download intent.

The skill logic looks roughly like this:

import asyncio
from telethon import TelegramClient, events
from telethon.tl.types import DocumentAttributeFilename
import os

async def download_ebook(book_title: str, download_path: str = "./books") -> dict:
    """
    OpenClaw Skill: Download an e-book via Zlib Telegram bot.
    
    Args:
        book_title: The name of the book to search and download
        download_path: Local directory to save the file
    
    Returns:
        dict with status and file path
    """
    ZLIB_BOT_USERNAME = "@zlibrary"  # Verify current username
    
    async with TelegramClient('saved_session', API_ID, API_HASH) as client:
        # Send book title to Zlib bot
        await client.send_message(ZLIB_BOT_USERNAME, book_title)
        
        # Wait for bot response with a document
        response = await client.get_messages(ZLIB_BOT_USERNAME, limit=5)
        
        for msg in response:
            if msg.document:
                os.makedirs(download_path, exist_ok=True)
                file_path = await client.download_media(
                    msg.document, 
                    file=download_path
                )
                return {
                    "status": "success",
                    "file": file_path,
                    "title": book_title
                }
        
        return {"status": "not_found", "title": book_title}

Once this is registered as an OpenClaw skill, Claude can call it in response to natural language like:

  • "Download Atomic Habits for me"
  • "Get me a copy of Clean Code"
  • "Find and download Designing Data-Intensive Applications"

Setting It Up: Step-by-Step

Here's a condensed setup checklist:

1. Create a Telegram Bot (optional for UI, not the automation)

  • Open @BotFather on Telegram
  • Run /newbot and follow the prompts
  • Save your bot token

2. Link Your Telegram Account to Zlib

  • Search for the official Z-Library bot on Telegram
  • Follow the linking instructions to connect your Z-Library account
  • Test it manually: send a book title, confirm you get a download link

3. Get Telegram API Credentials

  • Visit my.telegram.org
  • Log in and navigate to "API Development Tools"
  • Create an app to receive your api_id and api_hash

4. Authenticate Telethon and Save Session

python -c "
from telethon.sync import TelegramClient
client = TelegramClient('ebook_session', API_ID, API_HASH)
client.start()
print('Session saved.')
client.disconnect()
"

5. Register the Skill in OpenClaw

  • Define the skill schema with input parameters (book_title, download_path)
  • Point it to your async download function
  • Test with a Claude prompt: "Download Thinking, Fast and Slow"

The Bigger Picture: Connecting to NotebookLM

What makes this skill genuinely powerful is where @vista8 plans to take it next: automatic integration with NotebookLM.

The vision is a fully automated research pipeline:

"Summarize the key ideas in The Mom Test"
        ↓
Claude invokes Ebook Download Skill
        ↓
File saved locally (EPUB/PDF)
        ↓
Claude invokes NotebookLM Upload Skill
        ↓
NotebookLM generates audio summary / key insights
        ↓
Results returned to user

This is the kind of chained-skill workflow that makes agentic AI genuinely useful. Instead of tool-hopping across four applications, you describe what you want in plain language and let the agent handle the mechanics.

Potential extensions of this pipeline include:

  • Auto-tagging and cataloging downloaded books by genre or topic using Claude's classification abilities
  • Highlight extraction from EPUBs to build a personal knowledge base
  • Scheduled research digests — "Every Monday, download and summarize the top AI paper recommended by [source]"
  • Cross-referencing — asking Claude to compare arguments across multiple downloaded books

Conclusion

This e-book download skill is a small but beautifully constructed example of what modern AI automation looks like in practice. It's not about replacing anything — it's about eliminating friction in workflows you already do manually.

The architectural pattern — using a CLI Telegram client to interact programmatically with existing bots — is transferable to dozens of other use cases. Anywhere a Telegram bot offers a service, you can now give Claude the ability to use that service on your behalf.

And when you chain this with NotebookLM or other analysis tools, you stop thinking about getting information and start focusing entirely on understanding it.

Big thanks to @vista8 for sharing this creative build. You can find the original post here.


Want to build your own OpenClaw skills? Explore the full skill library and developer docs at ClawList.io. Have a skill idea or workflow to share? Submit it to the community.

Tags

#Claude#Telegram#Automation#E-books#Zlib#Telethon

Related Articles