scribd-downloader

repository·master·Indexed 19 days ago

https://github.com/phoenix124/scribd-downloader

A Python-based CLI tool for downloading documents, books, and audiobooks from Scribd. It supports text-based extraction to Markdown, image-based downloads, and PDF conversion. The tool includes the `scribdl` command and supports the use of Scribd premium credentials for full content access.

Tokens
1K
Snippets
7
Records
7
Agent score
14%

What's inside scribd-downloader

  1. Download Scribd Documents

    master

    Scribd documents are handled in two ways depending on their format:

    1. Selectable Text Documents: The tool extracts the text and saves it as a .md (Markdown) file in the current directory.
    2. Image-based Documents: If the document consists of images, use the --images flag. The tool will download the individual images to the current directory. You can use the --pdf flag to attempt to combine them into a PDF.

    Examples

    Download selectable text:

    $ scribdl https://www.scribd.com/document/55949937/33-Strategies-of-War

    Download image-based document:

    $ scribdl -i https://scribd.com/doc/17142797/Case-in-Point
    scribdl -i https://scribd.com/doc/17142797/Case-in-Point
  2. Install scribd-downloader

    master

    Ensure you are using Python 3. On macOS, you must install several system dependencies via Homebrew to support PDF conversion and image processing. You also need to ensure Pillow is updated to version 6 or higher.

    macOS Prerequisites

    brew install cairo
    brew install pango
    brew install libmagic
    brew install gtk+

    Python Setup

    python3 -m pip install --upgrade pip
    python3 -m pip install --upgrade Pillow
    pip install scribd-downloader

    Alternatively, you can install the development version from the source repository:

    python setup.py install
    pip install scribd-downloader
  3. Download complete books and audiobooks with Scribd Premium

    master

    To download full versions of books or audiobooks, you must provide Scribd premium credentials using the -c flag.

    1. Prepare a credentials file

    Create a text file (e.g., scribd_credentials.txt) with your email and password on separate lines:

    user@mail.com
    password

    2. Run the command

    Pass the file path to the -c option:

    $ scribdl -c scribd_credentials.txt https://www.scribd.com/audiobook/359295794/Principles-Life-and-Work

    Alternative: Using Cookies

    If you prefer not to use a credentials file, you can manually edit the source code (scribdl/const.py) to include your _scribd_session and _scribd_expire cookie values obtained from a web browser while logged in.

    scribdl -c scribd_credentials.txt https://www.scribd.com/audiobook/359295794/Principles-Life-and-Work
  4. Troubleshoot cropped images in PDF

    master

    If the generated PDF has cropped images, navigate to the directory containing the downloaded image files and use img2pdf to manually create the PDF:

    cd dir_with_all_image_files && img2pdf $(ls -tr *.jpg) -o path_to_pdf_output_file.pdf
    cd dir_with_all_image_files && img2pdf $(ls -tr *.jpg) -o path_to_pdf_output_file.pdf
  5. Download Scribd Books

    master

    By default, scribdl only downloads the content available to non-premium users. Books are typically saved as .md files. You can use the --pdf option to convert the output to a PDF.

    Example

    $ scribdl https://www.scribd.com/read/189087235/Confessions-of-a-Casting-Director-Help-Actors-Land-Any-Role-with-Secrets-from-Inside-the-Audition-Room
    scribdl https://www.scribd.com/read/189087235/Confessions-of-a-Casting-Director-Help-Actors-Land-Any-Role-with-Secrets-from-Inside-the-Audition-Room
  6. Download Scribd Audiobooks

    master

    The tool can download audiobooks as .mp3 files. Without premium credentials, only the preview version is available.

    Example

    $ scribdl https://www.scribd.com/audiobook/237606860/100-Ways-to-Motivate-Yourself-Change-Your-Life-Forever
    scribdl https://www.scribd.com/audiobook/237606860/100-Ways-to-Motivate-Yourself-Change-Your-Life-Forever
  7. Use the scribdl CLI

    master

    The scribdl command is used to download documents, books, and audiobooks from Scribd.

    Arguments:

    • URL: The Scribd URL of the content you wish to download.

    Options:

    • -h, --help: Show help message.
    • -i, --images: Use this when downloading a document that is composed of a collection of images (the tool cannot detect this automatically).
    • -p, --pdf: Convert the output to a PDF (requires imagemagick on *Nix systems).
    • -c CREDENTIALS_FILE, --credentials-file CREDENTIALS_FILE: Path to a file containing Scribd premium credentials to enable full downloads.
    usage: scribdl [-h] [-i] [-p] URL