Batch-download all Telegram animated gifts (.tgs and decompressed .json Lottie files) directly from Telegram's MTProto API:
- Regular Gifts: All standard catalog items (
./regular_gifts/). - NFT Collectibles: All unique 3D vector models and background patterns (
./nft_models/).
Ensure Node.js is installed on your system:
- Node.js version:
v18.0.0or higher (LTS recommended). - Download: https://nodejs.org
Check your installation:
node -v
npm -vBoth platforms handle everything automatically (dependency install, script retrieval, .env configuration, and execution).
Run directly in your terminal:
curl -fsSL https://raw.githubusercontent.com/roon9e/tgifts/main/install.sh | bashOpen cmd or PowerShell and run:
curl.exe -fsSL https://raw.githubusercontent.com/roon9e/tgifts/main/install.cmd -o install.cmd && install.cmd- Download
install.cmd. - Double-click
install.cmdto run.
If you prefer to configure everything manually:
curl -fsSL [https://raw.githubusercontent.com/roon9e/tgifts/main/fetch.js](https://raw.githubusercontent.com/roon9e/tgifts/main/fetch.js) -o fetch.js
npm init -y
npm install teleproto input socks dotenv --loglevel=error --no-audit --no-fundCreate a .env file in the project folder:
API_ID=
API_HASH=
PHONE_NUMBER=+79000000000
PASSWORD_2FA=
# SOCKS5 Proxy (Optional)
USE_PROXY=false
PROXY_IP=127.0.0.1
PROXY_PORT=1080
# Default Mode (1 = Regular, 2 = NFT, 3 = Both)
DOWNLOAD_MODE=3
# Auto-populated after first login
SESSION_STRING=node fetch.js- Go to https://my.telegram.org and log in.
- Navigate to API development tools.
- Create an app to get your
api_idandapi_hash. - (Optional) Press Enter during setup to use official default keys (
API_ID: 6).
Telegram requires your IP country to match your phone number country during web login (foreign VPNs will fail).
If my.telegram.org fails to open due to DNS filtering:
- Turn off your VPN.
- Add Telegram's direct IP to your
hostsfile:- Windows:
C:\Windows\System32\drivers\etc\hosts - Linux / macOS:
/etc/hosts
- Windows:
- Add this line at the bottom:
149.154.167.220 my.telegram.org - Save and open
my.telegram.orgin your browser.
.
├── regular_gifts/
│ ├── gift_6046178578163303744.tgs
│ └── gift_6046178578163303744.json
├── nft_models/
│ ├── nft_model_6001538689543439169_Lucky_Charm.tgs
│ ├── nft_model_6001538689543439169_Lucky_Charm.json
│ ├── nft_pattern_6001538689543439169_Lucky_Charm.tgs
│ └── nft_pattern_6001538689543439169_Lucky_Charm.json
├── .env
├── fetch.js
├── install.cmd / install.sh
└── package.json