Skip to content

Scraperly is your all-in-one Python toolkit for creating engaging AI-powered videos. It seamlessly combines web scraping, AI content processing, and video generation to turn your text into professional-looking videos with minimal effort.

License

Notifications You must be signed in to change notification settings

adelelawady/scraperly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Scraperly 🎬

Logo

PyPI version Python versions License GitHub stars GitHub issues Downloads

Transform your text into captivating AI-narrated videos with matching visuals! πŸš€

Scraperly is your all-in-one Python toolkit for creating engaging AI-powered videos. It seamlessly combines web scraping, AI content processing, and video generation to turn your text into professional-looking videos with minimal effort.

πŸ“š Table of Contents

✨ Features

  • πŸŽ₯ One-Click Video Creation: Transform text into professional videos
  • πŸ€– Multiple AI Providers: Choose from OpenAI, Anthropic, Hyperbolic, or Ollama
  • πŸ–ΌοΈ Smart Image Scraping: Automatic image sourcing from Lexica.art
  • πŸ—£οΈ Natural Narration: High-quality text-to-speech conversion
  • ⚑ Fast Processing: Efficient content segmentation and processing
  • 🎨 Customizable Output: Control image count and video parameters

πŸš€ Quick Start

from scraperly import scraperly
import os

# Create your first AI video in just 3 lines!
result = scraperly(
    content="Your story or content here",
    provider_name="openai",
    api_key=os.getenv("OPENAI_API_KEY"),
    model="gpt-4"
)

πŸ“ Input/Output Examples

Input Text

The wind howled through the abandoned streets as Elias tightened his coat around his shoulders. The city had once been alive, filled with laughter and the hum of everyday life, but now only the echoes of the past remained. He stepped over the broken pavement, eyes scanning for any sign of movement. The sun was setting, casting long shadows against the crumbling buildings. He needed to find shelter before nightfall. There was always something lurking in the darkness.

His footsteps echoed as he approached an old bookstore, its windows shattered, pages of forgotten stories scattered across the floor. He pushed the door open carefully, the hinges groaning in protest. Dust hung thick in the air, disturbed only by his breath. Shelves stood like silent sentinels, their contents long since plundered. He made his way toward the back, past fallen books and overturned chairs, and found what he was looking for. A hidden door, half-concealed behind a collapsed shelf.

With effort, he pushed through, stepping into a smaller room, untouched by the chaos outside. A single lantern sat on a desk, its wick dry but intact. He rummaged through his pack, pulling out a match, and struck it against the rough surface of his sleeve. The flame flickered to life, casting dancing shadows along the walls. He exhaled slowly, the brief warmth comforting.

He lowered himself into an old chair, feeling the exhaustion settle into his bones. He had been walking for days, searching for something he wasn’t sure existed anymore. A place safe from the nightmares that roamed the world, from the hunger that gnawed at his ribs, from the memories that refused to fade.

Outside, the wind picked up again, rattling the broken glass and whispering secrets through the ruins. He closed his eyes, listening, waiting, knowing that soon, he would have to move again.

Output Video

example.mp4

βš™οΈ Installation

πŸ“¦ Using pip (Recommended)

# Basic installation
pip install scraperly

# With AI provider support
pip install "scraperly[ai]"

# Set up your API keys (recommended)
export OPENAI_API_KEY="your-openai-api-key"
export ANTHROPIC_API_KEY="your-anthropic-api-key"

πŸ”§ From Source

# Clone and install
git clone https://github.com/adelelawady/scraperly.git
cd scraperly
pip install -e ".[ai]"

🎯 Use Cases

1. Story Visualization

from scraperly import scraperly
import os

# Turn a story into an engaging video
story = """
The ancient castle stood silently against the twilight sky,
its weathered stones holding centuries of secrets...
"""

result = scraperly(
    content=story,
    provider_name="anthropic",
    api_key=os.getenv("ANTHROPIC_API_KEY"),
    model="claude-3-sonnet",
    max_images_per_segment=3
)

2. Educational Content

from scraperly import scraperly
import os

# Create educational videos
lesson = """
The Solar System consists of eight planets orbiting around the Sun.
Each planet has unique characteristics...
"""

result = scraperly(
    content=lesson,
    provider_name="openai",
    api_key=os.getenv("OPENAI_API_KEY"),
    model="gpt-4-turbo",
    max_images_per_segment=2,
    output_video_path="solar_system.mp4"
)

πŸ€– AI Providers

Provider Default Model Available Models Features
OpenAI gpt-4 All OpenAI chat models (e.g., gpt-4, gpt-3.5-turbo, gpt-4-turbo, etc.) Best for creative content
Anthropic claude-3-sonnet All Claude models (e.g., claude-3-opus, claude-3-sonnet, claude-3-haiku, etc.) Excellent analysis
Hyperbolic deepseek-v3 All Deepseek models (e.g., deepseek-v3, deepseek-v2, etc.) Fast processing
Ollama llama2 All Ollama models (e.g., llama2, mistral, codellama, etc.) Local execution

πŸ”§ Troubleshooting

🚫 Chrome Driver Issues
  • βœ… Update Chrome to latest version
  • βœ… Verify matching chromedriver version
  • βœ… Check system PATH configuration
❌ AI Provider Errors
  • βœ… Verify API key validity
  • βœ… Check provider status
  • βœ… Confirm model availability
⚠️ Video Processing Issues
  • βœ… Install/update FFmpeg
  • βœ… Check disk space
  • βœ… Verify file permissions

🀝 Contributing

We love your input! To contribute:

  1. 🍴 Fork the repo
  2. 🌿 Create your branch (git checkout -b feature/AmazingFeature)
  3. πŸ’Ύ Commit changes (git commit -m 'Add AmazingFeature')
  4. πŸ“€ Push to branch (git push origin feature/AmazingFeature)
  5. 🎁 Open a Pull Request

πŸ“ License

Released under MIT License. See LICENSE for details.

πŸ‘€ Author

Created with πŸ’– by adelelawady


Made with ❀️ for the AI community

About

Scraperly is your all-in-one Python toolkit for creating engaging AI-powered videos. It seamlessly combines web scraping, AI content processing, and video generation to turn your text into professional-looking videos with minimal effort.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages