Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegram Gifts & NFT Downloader

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/).

📋 Prerequisites

Ensure Node.js is installed on your system:

Check your installation:

node -v
npm -v

⚡ Quick Start (Single-Command Setup)

Both platforms handle everything automatically (dependency install, script retrieval, .env configuration, and execution).

🐧 Linux / macOS:

Run directly in your terminal:

curl -fsSL https://raw.githubusercontent.com/roon9e/tgifts/main/install.sh | bash

🪟 Windows:

Option A: One-liner via Command Prompt / PowerShell

Open cmd or PowerShell and run:

curl.exe -fsSL https://raw.githubusercontent.com/roon9e/tgifts/main/install.cmd -o install.cmd && install.cmd

Option B: Manual Download

  1. Download install.cmd.
  2. Double-click install.cmd to run.

🛠 Manual Installation

If you prefer to configure everything manually:

1. Download Script & Install Dependencies

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-fund

2. Configure Environment (.env)

Create 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=

3. Run

node fetch.js

🔑 Obtaining Telegram API Credentials

  1. Go to https://my.telegram.org and log in.
  2. Navigate to API development tools.
  3. Create an app to get your api_id and api_hash.
  4. (Optional) Press Enter during setup to use official default keys (API_ID: 6).

🇷🇺 Tip for Russian Numbers (+7)

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:

  1. Turn off your VPN.
  2. Add Telegram's direct IP to your hosts file:
    • Windows: C:\Windows\System32\drivers\etc\hosts
    • Linux / macOS: /etc/hosts
  3. Add this line at the bottom:
    149.154.167.220 my.telegram.org
    
  4. Save and open my.telegram.org in your browser.

📁 Output Directory Structure

.
├── 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

About

simple telegram gift fetch script

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages