|
| 1 | + |
1 | 2 | <!-- omit in toc -->
|
2 |
| -# Tutorial |
| 3 | +# Getting Started with TStickers |
| 4 | + |
| 5 | +Welcome to the TStickers tutorial! Follow these steps to get up and running with TStickers. This |
| 6 | +guide will walk you through setting up a Telegram bot, retrieving sticker pack URLs, and using |
| 7 | +TStickers to download and convert stickers. |
3 | 8 |
|
4 |
| -See below for a step-by-step tutorial on how to use TStickers |
| 9 | +<!-- omit in toc --> |
| 10 | +## Table of Contents |
5 | 11 |
|
6 | 12 | - [Step 1 - Send a message to @BotFather](#step-1---send-a-message-to-botfather)
|
7 |
| -- [Step 2 - Create a file called 'env'](#step-2---create-a-file-called-env) |
8 |
| -- [Step 3 - Get the URL of the telegram sticker pack(s)](#step-3---get-the-url-of-the-telegram-sticker-packs) |
9 |
| - - [Option 1 - Use a browser and search for the pack](#option-1---use-a-browser-and-search-for-the-pack) |
10 |
| - - [Option 2 - Use telegram](#option-2---use-telegram) |
| 13 | +- [Step 2 - Create a File Called 'env'](#step-2---create-a-file-called-env) |
| 14 | +- [Step 3 - Get the URL of the Telegram Sticker Pack(s)](#step-3---get-the-url-of-the-telegram-sticker-packs) |
| 15 | + - [Option 1 - Use a Browser and Search for the Pack](#option-1---use-a-browser-and-search-for-the-pack) |
| 16 | + - [Option 2 - Use Telegram](#option-2---use-telegram) |
11 | 17 | - [Step 4 - Use TStickers](#step-4---use-tstickers)
|
12 | 18 |
|
13 | 19 | ## Step 1 - Send a message to @BotFather
|
14 | 20 |
|
15 |
| -1. You must have a telegram account to use this |
16 |
| -2. Send a message to @BotFather to get started. |
17 |
| -3. Send a message containing `/newbot` |
18 |
| -4. Send a message containing the name of the bot e.g. `/test` |
19 |
| -5. Send a message containing the username of the bot e.g. `/test_bot` |
20 |
| -6. @BotFather will send a message with the token |
| 21 | +To start using TStickers, you need to create a Telegram bot. Follow these steps to obtain your bot token: |
| 22 | + |
| 23 | +1. **Create a Telegram Account:** If you don’t already have one, download the Telegram app and sign up. |
| 24 | + |
| 25 | +2. **Contact @BotFather:** Open Telegram and search for the user `@BotFather`. This is the official bot for managing other bots on Telegram. |
| 26 | + |
| 27 | +3. **Create a New Bot:** |
| 28 | + - Send the command `/newbot` to @BotFather. |
| 29 | + - Follow the prompts to provide a name for your bot (e.g., `TestBot`) and a username (e.g., `test_bot`). |
| 30 | + |
| 31 | +4. **Receive Your Token:** @BotFather will reply with a message containing your bot’s API token. Keep this token safe, as you'll need it for the next steps. |
| 32 | + |
| 33 | + <img src="assets/step1.png" alt="Step 1" width="600"> |
| 34 | + |
| 35 | +## Step 2 - Create a File Called 'env' |
| 36 | + |
| 37 | +To store your bot token securely, you need to create a configuration file: |
21 | 38 |
|
22 |
| -<img src="assets/step1.png" alt="Step 1" width="600"> |
| 39 | +1. **Create the File:** |
| 40 | + - Create a new text file in the same directory where you'll run TStickers. |
| 41 | + - Name the file `env` or `env.txt`. |
23 | 42 |
|
24 |
| -## Step 2 - Create a file called 'env' |
| 43 | +2. **Add Your Token:** |
| 44 | + - Open the file and paste your bot token into it. |
25 | 45 |
|
26 |
| -Create a file called 'env' (or env.txt) and paste your token from part 1. |
| 46 | + Example `env.txt`: |
| 47 | + ```txt |
| 48 | + 14************ |
| 49 | + ``` |
27 | 50 |
|
28 |
| -e.g. `env.txt` |
| 51 | +## Step 3 - Get the URL of the Telegram Sticker Pack(s) |
29 | 52 |
|
30 |
| -```txt |
31 |
| -14************ |
32 |
| -``` |
| 53 | +To use TStickers, you'll need the URL of the sticker pack(s) you want to download. You can get this URL in two ways: |
33 | 54 |
|
34 |
| -## Step 3 - Get the URL of the telegram sticker pack(s) |
| 55 | +### Option 1 - Use a Browser and Search for the Pack |
35 | 56 |
|
36 |
| -### Option 1 - Use a browser and search for the pack |
| 57 | +1. **Search for the Sticker Pack:** |
| 58 | + - Open your web browser and search for the sticker pack by name (e.g., `Telegram Donut The Dog`). |
37 | 59 |
|
38 |
| -1. Use a browser and search for the pack e.g. `telegram donut the dog` |
| 60 | + <img src="assets/step3_0.png" alt="Step 3: Part 1" width="300"> |
39 | 61 |
|
40 |
| - <img src="assets/step3_0.png" alt="Step 3: Part 1" width="300"> |
| 62 | +2. **Copy the URL:** |
| 63 | + - Find the sticker pack link and copy its URL. It should look something like `https://t.me/addstickers/DonutTheDog`. |
41 | 64 |
|
42 |
| -2. Click on the link |
43 |
| -3. Copy the url: e.g. `https://t.me/addstickers/DonutTheDog` |
| 65 | +### Option 2 - Use Telegram |
44 | 66 |
|
45 |
| -### Option 2 - Use telegram |
| 67 | +1. **Find the Sticker Pack:** |
| 68 | + - Open the Telegram app, search for the sticker pack, and open it. |
46 | 69 |
|
47 |
| -1. Open telegram, find the desired sticker pack and share the pack (on mobile pick copy link). An example of sharing a pack is below |
| 70 | +2. **Copy the Link:** |
| 71 | + - Tap on the sticker pack’s name or menu options and select "Share" or "Copy Link" (on mobile devices). The URL will be copied to your clipboard. |
48 | 72 |
|
49 |
| - <img src="assets/step3_1.png" alt="Step 3: Part 2" width="300"> |
| 73 | + Example URL: `https://t.me/addstickers/DonutTheDog` |
50 | 74 |
|
51 |
| -2. Click on share stickers/ link - this will copy the url: e.g. `https://t.me/addstickers/DonutTheDog` |
| 75 | + <img src="assets/step3_1.png" alt="Step 3: Part 2" width="300"> |
52 | 76 |
|
53 | 77 | ## Step 4 - Use TStickers
|
54 | 78 |
|
55 |
| -- Run the program `python -m tstickers` |
56 |
| -- Enter the URL of the sticker pack |
57 |
| -- Get the output in the `downloads` folder. |
58 |
| - |
59 |
| -```bash |
60 |
| -$ tstickers |
61 |
| -Enter sticker_set url (leave blank to stop): https://t.me/addstickers/DonutTheDog |
62 |
| -Enter sticker_set url (leave blank to stop): |
63 |
| -INFO | ============================================================ |
64 |
| -INFO | Starting to scrape "DonutTheDog" .. |
65 |
| -INFO | Time taken to scrape 31 stickers - 0.044s |
66 |
| -INFO | |
67 |
| -INFO | ------------------------------------------------------------ |
68 |
| -INFO | Starting download of "donutthedog" into downloads\donutthedog |
69 |
| -INFO | Time taken to download 31 stickers - 0.157s |
70 |
| -INFO | |
71 |
| -INFO | ------------------------------------------------------------ |
72 |
| -INFO | -> Cache miss for DonutTheDog! |
73 |
| -INFO | Converting stickers "DonutTheDog"... |
74 |
| -INFO | Time taken to convert 31 stickers (tgs) - 60.970s |
75 |
| -INFO | |
76 |
| -INFO | Time taken to convert 31 stickers (webp) - 0.447s |
77 |
| -INFO | |
78 |
| -INFO | Time taken to convert 62 stickers (total) - 61.434s |
79 |
| -INFO | |
80 |
| -``` |
| 79 | +Now you’re ready to use TStickers to download and convert stickers from the URL you obtained: |
| 80 | + |
| 81 | +1. **Install TStickers:** |
| 82 | + - Run the following command in your terminal: |
| 83 | + ```bash |
| 84 | + python3 -m pip install tstickers |
| 85 | + ``` |
| 86 | + |
| 87 | +2. **Run TStickers:** |
| 88 | + - Start the program by executing: |
| 89 | + ```bash |
| 90 | + python3 -m tstickers |
| 91 | + ``` |
| 92 | + |
| 93 | +3. **Enter the Sticker Pack URL:** |
| 94 | + - When prompted, paste the URL of the sticker pack and press Enter. |
| 95 | + |
| 96 | +4. **Check the Output:** |
| 97 | + - TStickers will download and convert the stickers. The output will be saved in the `downloads` folder. |
| 98 | + |
| 99 | + Example output: |
| 100 | + ```bash |
| 101 | + $ tstickers |
| 102 | + Enter sticker_set url (leave blank to stop): https://t.me/addstickers/DonutTheDog |
| 103 | + Enter sticker_set url (leave blank to stop): |
| 104 | + INFO | ============================================================ |
| 105 | + INFO | Starting to scrape "DonutTheDog" .. |
| 106 | + INFO | Time taken to scrape 31 stickers - 0.044s |
| 107 | + INFO | |
| 108 | + INFO | ------------------------------------------------------------ |
| 109 | + INFO | Starting download of "donutthedog" into downloads\donutthedog |
| 110 | + INFO | Time taken to download 31 stickers - 0.157s |
| 111 | + INFO | |
| 112 | + INFO | ------------------------------------------------------------ |
| 113 | + INFO | -> Cache miss for DonutTheDog! |
| 114 | + INFO | Converting stickers "DonutTheDog"... |
| 115 | + INFO | Time taken to convert 31 stickers (tgs) - 60.970s |
| 116 | + INFO | |
| 117 | + INFO | Time taken to convert 31 stickers (webp) - 0.447s |
| 118 | + INFO | |
| 119 | + INFO | Time taken to convert 62 stickers (total) - 61.434s |
| 120 | + INFO | |
| 121 | + ``` |
0 commit comments