Skip to content

Commit 096c851

Browse files
committed
Renames amd other changes
1 parent d912ce2 commit 096c851

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

AutomationScripts/Telegram Instagram Uploader/ReadMe.md renamed to AutomationScripts/Telegram Instagram Uploader/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ To Allow Telegram Users, to easily Upload Videos saved on Telegram to Instagram
3535

3636
## Output
3737
### AT TELEGRAM
38-
<img src="./images/output1.jpg">
38+
<img src="./Images/output1.jpg">
3939
<hr>
4040

4141
#### AT INSTAGRAM
42-
<img src="./images/output2.jpg">
42+
<img src="./Images/output2.jpg">
4343

4444

4545
## Author(s)

AutomationScripts/Telegram Instagram Uploader/telegram_instagram.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
1-
# --- imports --- #
1+
# --- imports --- #
22
import os
33
import logging
44
from instagrapi import Client
55
from telethon import TelegramClient
66
from telethon.events import NewMessage
77

88
# --- Required Vars --- #
9-
INSTAGRAM_USERNAME = ""
10-
INSTAGRAM_PASSWORD = ""
9+
INSTAGRAM_USERNAME = "" or input("Enter Your Instagr Username : ")
10+
INSTAGRAM_PASSWORD = "" or input("Enter your Instagram Password :")
1111

1212
API_ID = 6 # Telegram API ID
1313
API_HASH = "eb06d4abfb49dc3eeb1aeb98ae0f581e" # Telegram API HASH
14-
TG_BOT_TOKEN = "" # Telegram BOT_TOKEN
15-
TG_CHATIDS = [] # List of Telegram Chat Ids
14+
TG_BOT_TOKEN = "" or input("Enter Telegram Bot Token") # Telegram BOT_TOKEN
15+
TG_CHATIDS = [] or [
16+
int(chat) for chat in input("Enter Chat Ids : ")
17+
] # List of Telegram Chat Ids
1618

1719
# ------ Main ------ #
18-
logging.basicConfig(level=logging.INFO)
20+
logging.basicConfig(level=logging.INFO) # set logging level
21+
22+
# Create Instagram Client
1923
settings = "settings.json" if os.path.exists("settings.json") else None
2024
InstaClient = Client()
2125

@@ -27,10 +31,12 @@
2731
InstaClient.login(INSTAGRAM_USERNAME, INSTAGRAM_PASSWORD)
2832
InstaClient.dump_settings("settings.json")
2933

34+
# Creatimg Telegram Client
3035
Client = TelegramClient("Tele-Insta-BOT", api_id=API_ID, api_hash=API_HASH)
3136
Client = Client.start(bot_token=TG_BOT_TOKEN)
3237

3338

39+
# Function/Haner to get Telegram Event Update with Video And Chat Filter.
3440
@Client.on(NewMessage(chats=TG_CHATIDS, func=lambda e: e.video))
3541
async def upload_to_insta(event):
3642
msg = await event.reply("Downloading Video...")
@@ -46,9 +52,9 @@ async def upload_to_insta(event):
4652
m = "Uploaded to Instagram\n"
4753
m += f"https://instagram.com/p/{video.code}"
4854
await msg.edit(m)
49-
os.remove(file)
55+
os.remove(file) # remove file adter use..
5056

5157

5258
with Client:
5359
Client.run_until_disconnected()
54-
60+
# Start And Loop Telegram Client

0 commit comments

Comments
 (0)