Skip to main content

TGPhind

PyPI version Downloads Python versions License GitHub stars

TGPhind is a multithreaded tool and Python library for searching articles by title and template on Telegra.ph and its mirrors (Graph.org, Te.legra.ph).

Features

  • Multithreaded article availability checking with configurable worker threads.
  • Flexible article title template generator supporting ranges and letter sets.
  • Automatic transliteration of Cyrillic titles into URL-compatible slugs.
  • Support for HTTP/HTTPS proxies.
  • Automatic mirror verification and URL mapping.
  • Command-line interface (CLI) and Python API.

Installation

Install via pip:

pip install tgphind

Or via poetry:

poetry add tgphind

Quick Start

Python API Usage

from tgphind import TGPhind, Proxy

# Initialize the search engine
se = TGPhind(
    max_th=16,  # Worker threads count (defaults to CPU count)
    proxy=None,  # Optional Proxy(host='...', protocol='https')
    brackets='<>'  # Template delimiter brackets
)

# Search articles using a template pattern
results = se.search('article<s>-<a-d>')

# Map results across available mirrors
mapped_urls = se.map_hosts(results)

for urls in mapped_urls:
    for url in urls:
        print(url)

CLI Usage

Execute directly via the installed executable:

tgphind "article-<1-3>" -tc 8

Or run via the Python module:

python -m tgphind "article<s>-<a-d>" -tc 16

Command-line Options

  • query (required): Article title or pattern string.
  • -tc, --threads-count: Number of threads to execute queries.
  • -b, --brackets: Custom template bracket delimiters (default: <>).
  • -x, --proxy: Proxy string formatted as protocol://host:port.

Template Syntax

The search pattern generator expands patterns wrapped inside bracket delimiters <>:

  • Single character: <s generates s and an empty string.
  • Character ranges: <a-d> expands to a, b, c, d.
  • Character sets: <abc> generates a, b, c.
  • Step ranges: <a2g> generates characters with step 2 (a, c, e, g).

Example Expansion

Pattern article<s>-<a-d> generates the following titles:

  • article-a, article-b, article-c, article-d
  • articles-a, articles-b, articles-c, articles-d

Each expanded title is tested against publication date patterns (MM-DD) and index suffixes (-2, -3, etc.).

Supported Mirrors

TGPhind automatically tests and maps links across these domains:

  • telegra.ph
  • graph.org
  • te.legra.ph

License

This project is licensed under the MIT License.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tgphind-1.1.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tgphind-1.1.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file tgphind-1.1.0.tar.gz.

File metadata

  • Download URL: tgphind-1.1.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.13.14 Linux/7.1.4-zen1

File hashes

Hashes for tgphind-1.1.0.tar.gz
Algorithm Hash digest
SHA256 7a4f620cf83aa87dd984e3c4c9ef8cff48735a2d2e7dd3470b006dec70721da7
MD5 c1a7b96d4c57bd81ae67f06d4f5d2b70
BLAKE2b-256 d6a7a5fcf7be897fcb0e8721a157b3e495f3e7dae68b75d179467abcc8891505

See more details on using hashes here.

File details

Details for the file tgphind-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: tgphind-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.13.14 Linux/7.1.4-zen1

File hashes

Hashes for tgphind-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 66b71265f292347d0f9f53d83c8a64619116a1929ca24baf05f12beee63cfb1d
MD5 59123e3987b0abc204a90bc4320bbf67
BLAKE2b-256 0cf2ddbf972a7a86157e63e895528a9f59cb7b8f7f1a3ced02e46659d4ece83b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page