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).
- 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.
Install via pip:
pip install tgphindOr via poetry:
poetry add tgphindfrom 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)Execute directly via the installed executable:
tgphind "article-<1-3>" -tc 8Or run via the Python module:
python -m tgphind "article<s>-<a-d>" -tc 16query(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 asprotocol://host:port.
The search pattern generator expands patterns wrapped inside bracket delimiters <>:
- Single character:
<sgeneratessand an empty string. - Character ranges:
<a-d>expands toa,b,c,d. - Character sets:
<abc>generatesa,b,c. - Step ranges:
<a2g>generates characters with step 2 (a,c,e,g).
Pattern article<s>-<a-d> generates the following titles:
article-a,article-b,article-c,article-darticles-a,articles-b,articles-c,articles-d
Each expanded title is tested against publication date patterns (MM-DD) and index suffixes (-2, -3, etc.).
TGPhind automatically tests and maps links across these domains:
telegra.phgraph.orgte.legra.ph
This project is licensed under the MIT License.