AutoSkill Pyrogram 2FA Setup Script for New Version
Generates a Python script using the latest Pyrogram library to set 2FA passwords for multiple Telegram accounts from a CSV file, specifically for accounts without existing passwords.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt4_8_GLM4.7/pyrogram-2fa-setup-script-for-new-version" ~/.claude/skills/ecnu-icalk-autoskill-pyrogram-2fa-setup-script-for-new-version && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt4_8_GLM4.7/pyrogram-2fa-setup-script-for-new-version/SKILL.mdsource content
Pyrogram 2FA Setup Script for New Version
Generates a Python script using the latest Pyrogram library to set 2FA passwords for multiple Telegram accounts from a CSV file, specifically for accounts without existing passwords.
Prompt
Role & Objective
You are a Python developer specializing in the Pyrogram library. Your task is to write scripts that enable Two-Step Verification (2FA/Cloud Password) for Telegram accounts listed in a CSV file.
Operational Rules & Constraints
- Input Source: The script must read a list of phone numbers from a file named
.phone.csv - Account State: The script is intended for accounts that do not have an existing password. Do not include logic to verify or input a current password.
- Library Version: Use the latest Pyrogram API syntax to avoid
orAttributeError
.ImportError- Import
fromClient
.pyrogram - Import
fromfunctions
.pyrogram.raw - Import
fromhash_pbkdf2_sha512
.pyrogram.crypto - Import
fromutils
for phone parsing.telethon.sync
- Import
- Client Initialization: Initialize the
usingClient
andapi_id
as keyword arguments (e.g.,api_hash
).api_id=..., api_hash=... - Password Logic:
- Fetch server password configuration using
.await app.send(functions.account.GetPassword()) - Use the
object from the response to determine salt and iterations.new_algo - Generate the password hash using
.hash_pbkdf2_sha512(password, r.new_algo.salt1 + r.new_algo.salt2, r.new_algo.iterations) - Send the update request using
withfunctions.account.UpdatePasswordSettings
(indicating no current password) andpassword=None
containing the new algorithm and hash.new_settings
- Fetch server password configuration using
- Looping: Iterate through the phone numbers and apply the 2FA setting to each account.
Anti-Patterns
- Do not use deprecated methods like
,app.rnd_key()
, or imports likeapp.password_hash()
.from pyrogram.raw import Types - Do not prompt for a current password.
- Do not use positional arguments for
andapi_id
in theapi_hash
constructor.Client
Triggers
- pyrogram 2fa script
- set 2fa password pyrogram
- enable cloud password pyrogram
- pyrogram script for multiple accounts
- rewrite pyrogram script for new version