Skip to content

Pure-PHP library to convert and bridge Telegram ( tg ) sessions between popular client formats ( Telethon , Pyrogram , Tdata , MadelineProto , ... ) and LiveProto ( LP )

License

Notifications You must be signed in to change notification settings

TakNone/SessionBridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SessionBridge

logo SessionBridge : Pure-PHP library to convert and bridge Telegram sessions between popular client formats ( Telethon , Pyrogram , Tdata , MadelineProto ) and LiveProto ( LP )

🔥 SessionBridge focuses on compatibility, reliability, and realistic production use. It provides a unified API and CLI to read, validate, convert, and export session / auth data across different implementations of Telegram's MTProto ecosystem


Key features

  • Convert sessions between Telethon , Pyrogram , MadelineProto , Tdata ( Telegram Desktop ) and LiveProto ( LP ) formats
  • High-fidelity mapping of session fields where possible ( dc_id , ip , port , auth_key )
  • Simple, chainable PHP API and a practical command-line interface ( CLI )

Note : SessionBridge is a translator / bridge between session file formats ( or text of session ) it does not reimplement MTProto or perform network login for you. Use a proper client library ( MadelineProto , LiveProto , Telethon , Pyrogram ) to perform active logins and connection flows


Installation

Install via Composer :

composer require taknone/sessionbridge

Or include directly in your project autoload


Quick start

PHP

<?php

require_once 'vendor/autoload.php';

use function Tak\SessionBridge\from_madelineproto_string;

use function Tak\SessionBridge\to_liveproto_sqlite;

$sessions = from_madelineproto_string('session.madeline');

foreach($sessions as $session){
	var_dump(to_liveproto_sqlite($session));
}

?>

CLI

  • convert telethon.session file to LiveProto file
php vendor/bin/sessionbridge --from telethon-sqlite --to liveproto-sqlite --session telethon.session

Supported formats

  • Telethon ( .session SQLite / String )
  • Pyrogram ( .session SQLite / String )
  • MadelineProto ( PHP session arrays / serialized files )
  • Tdata ( Telegram Desktop profile folder , extract relevant files )
  • LiveProto ( LP ) ( first-class citizen , SessionBridge is linked and can export / import LP files )

If you need support for additional session types open an issue or contribute an adapter

Type From To
LiveProto String
LiveProto SQLite
Telethon String
Telethon SQLite
Pyrogram String
Pyrogram SQLite
Madeline String
Tdata

License

SessionBridge is released under the AGPLv3


Contact

If you need help, open an issue or discuss changes via pull requests. For sensitive security issues, use the repository's security contact

🎊 Happy bridging !

About

Pure-PHP library to convert and bridge Telegram ( tg ) sessions between popular client formats ( Telethon , Pyrogram , Tdata , MadelineProto , ... ) and LiveProto ( LP )

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages