danog / pif-tdpony

PHP interface for tdlib
GNU Affero General Public License v3.0
5 stars 2 forks source link

Class 'danog\MadelineProto\X\API' not found #2

Closed sidorov89 closed 5 years ago

sidorov89 commented 5 years ago

Hi. I type this code in index.php var_dump($a = new \danog\MadelineProto\X\API('session.madelinex')); exit();

If I call index.php in command line I get objectobject(danog\MadelineProto\X\API)#1, but if I call it from browser I get error "Class 'danog\MadelineProto\X\API' not found".

Can I use this library in browser? Can you show example with user login?

danog commented 5 years ago

To use it in a browser, copy the so file and configuration to the fpm configuration folder; anyway, I suggest you use the native client, instead: https://github.com/danog/MadelineProto

sidorov89 commented 5 years ago

I can't use https://github.com/danog/MadelineProto because I want to register new telegram users. When a user signing up via a web site, his number is sometimes banned. If I register a new number through the application on the phone, the user is not banned. I want to try using tdlib to send headers and signs that the user is signing up through the application.

sidorov89 commented 5 years ago

To use it in a browser, copy the so file and configuration to the fpm configuration folder; anyway, I suggest you use the native client, instead: https://github.com/danog/MadelineProto

It doesn't help me.

  1. I copied file libpif.so (/var/www/html/pif-tdpony/build/libpif.so) to /usr/lib/php/20170718
  2. I created file libpif.ini in /etc/php/7.0/mods-available and wrote same text: '; configuration for php libpif module ; priority=20 extension=libpif.so'
  3. Then I have created symlink /etc/php/7.0/fpm/conf.d/@20-libpif.ini -> /etc/php/7.0/mods-available/libpif.ini
  4. Restarted php via command: service php7.0-fpm restart

After that I have same error, nothing changed.

danog commented 5 years ago

MadelineProto works exactly like tdlib, telegram cannot possibly detect that you are using client X instead of client Y. You will still get account bans if you sign up with tdlib. The only difference are the API ID parameters, that can be tweaked in both MadelineProto and tdlib to simulate an official client, if you need to do so. Anyway, if you need to create accounts for userbots, the best way to do so is recover deleted accounts through an email to recover@telegram.org: this will manually whitelist the number, which will allow you to signup again and use the account normally, through any API or client.

sidorov89 commented 5 years ago

The only difference are the API ID parameters, that can be tweaked in both MadelineProto and tdlib to simulate an official client, if you need to do so.

How can I simulate the official telegram app? Perhaps this will help and there will be no blocking of accounts.

danog commented 5 years ago

You can decompile the android app and extract the api id, api hash and app info parameters from it.