Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
45ae276
ALL FILES UPLOADED - CREDITS 🌟 - @Sunrises_24
Aluval Jul 21, 2024
e9ad5f8
ALL FILES UPLOADED - CREDITS 🌟 - @Sunrises_24
Aluval Jul 21, 2024
8f1dfa7
ALL FILES UPLOADED - CREDITS 🌟 - @Sunrises_24
Aluval Jul 21, 2024
e655ac2
ALL FILES UPLOADED - CREDITS 🌟 - @Sunrises_24
Aluval Jul 21, 2024
7c93b94
ALL FILES UPLOADED - CREDITS 🌟 - @Sunrises_24
Aluval Jul 21, 2024
414dbd6
ALL FILES UPLOADED - CREDITS 🌟 - @Sunrises_24
Aluval Jul 21, 2024
1d37ff2
ALL FILES UPLOADED - CREDITS 🌟 - @Sunrises_24
Aluval Jul 21, 2024
20bbc10
ALL FILES UPLOADED - CREDITS 🌟 - @Sunrises_24
Aluval Jul 21, 2024
9017ce6
ALL FILES UPLOADED - CREDITS 🌟 - @Sunrises_24
Aluval Jul 21, 2024
ff87513
ALL FILES UPLOADED - CREDITS 🌟 - @Sunrises_24
Aluval Jul 21, 2024
de03cf2
ALL FILES UPLOADED - CREDITS 🌟 - @Sunrises_24
Aluval Jul 21, 2024
ad30c62
ALL FILES UPLOADED - CREDITS 🌟 - @Sunrises_24
Aluval Jul 21, 2024
16ae9ea
ALL FILES UPLOADED - CREDITS 🌟 - @Sunrises_24
Aluval Jul 21, 2024
b8144da
ALL FILES UPLOADED - CREDITS 🌟 - @Sunrises_24
Aluval Jul 21, 2024
126dd0c
ALL FILES UPLOADED - CREDITS 🌟 - @Sunrises_24
Aluval Jul 21, 2024
a8349a4
ALL FILES UPLOADED - CREDITS 🌟 - @Sunrises_24
Aluval Jul 21, 2024
a2837cd
ALL FILES UPLOADED - CREDITS 🌟 - @Sunrises_24
Aluval Jul 21, 2024
f52ddaa
ALL FILES UPLOADED - CREDITS 🌟 - @Sunrises_24
Aluval Jul 21, 2024
05cf964
ALL FILES UPLOADED - CREDITS 🌟 - @Sunrises_24
Aluval Jul 21, 2024
66099eb
ALL FILES UPLOADED - CREDITS 🌟 - @Sunrises_24
Aluval Jul 21, 2024
78fd47c
ALL FILES UPLOADED - CREDITS 🌟 - @Sunrises_24
Aluval Jul 21, 2024
c620ce5
ALL FILES UPLOADED - CREDITS 🌟 - @Sunrises_24
Aluval Jul 21, 2024
fab3d7b
ALL FILES UPLOADED - CREDITS 🌟 - @Sunrises_24
Aluval Jul 21, 2024
541768f
Update rename.py
Aluval Jul 22, 2024
dda6cea
Update rename.py
Aluval Jul 23, 2024
f5e4f05
ALL FILES UPLOADED - CREDITS 🌟 - @Sunrises_24
Aluval Jul 23, 2024
b59a488
Attach photo Custom Name Updated.✅
Aluval Jul 23, 2024
0b8c397
Attach photo Custom Name Updated.✅
Aluval Jul 23, 2024
c8ede7d
#GoFile Upload Cleared ✅
Aluval Jul 25, 2024
b7fae3d
#GoFile Upload Cleared ✅ & Indentation Error solved
Aluval Jul 30, 2024
90d0889
Update rename.py
Aluval Jul 30, 2024
c6d60d2
#GoFile Upload Cleared ✅ & Indentation Error solved
Aluval Jul 30, 2024
c18e9d7
Add New Features Commands & Remove Unknown Issues
Aluval Aug 16, 2024
b3b3d34
Add New Features Commands & Remove Unknown Issues
Aluval Aug 16, 2024
0078cf6
Add New Features Commands & Remove Unknown Issues
Aluval Aug 16, 2024
9711d49
Add New Features Commands & Remove Unknown Issues
Aluval Aug 16, 2024
46d372c
Add New Features Commands & Remove Unknown Issues
Aluval Aug 16, 2024
e8c6aec
Add New Features Commands & Remove Unknown Issues
Aluval Aug 16, 2024
9fa0459
Add New Features Commands & Remove Unknown Issues
Aluval Aug 16, 2024
403cf5b
Update rename.py
Aluval Aug 16, 2024
0e41c14
Add New Features Commands & Remove Unknown Issues
Aluval Aug 16, 2024
9467ed4
Add New Features Commands & Remove Unknown Issues
Aluval Aug 16, 2024
8597b83
ALL FILES UPLOADED - CREDITS 🌟 - @Sunrises_24
Aluval Aug 16, 2024
94cbbb8
Add New Features Commands & Remove Unknown Issues
Aluval Aug 16, 2024
664a5b8
Add New Features Commands & Remove Unknown Issues
Aluval Aug 16, 2024
fd55697
Add New Features Commands & Remove Unknown Issues
Aluval Aug 16, 2024
22b788d
Add New Features Commands & Remove Unknown Issues
Aluval Aug 16, 2024
64658d0
Add New Features Commands & Remove Unknown Issues
Aluval Aug 16, 2024
bc4d4bf
Update config.py
Aluval Sep 8, 2024
b292e53
Drive leech ✅
Aluval Sep 13, 2024
84b38ac
Drive leech ✅
Aluval Sep 13, 2024
dcbd98c
Drive leech , Logs & Restart ✅
Aluval Sep 13, 2024
8ffa46b
Drive leech , Logs & Restart ✅
Aluval Sep 13, 2024
c96b6fb
Drive leech , Logs & Restart ✅
Aluval Sep 13, 2024
ae288d3
Restart ✅
Aluval Sep 16, 2024
8ae44c5
Restart ✅
Aluval Sep 16, 2024
0e36693
Restart ✅
Aluval Sep 16, 2024
9959d65
NEW UPDATE 💥
Aluval Sep 16, 2024
a6e9311
Restart ✅
Aluval Sep 16, 2024
aa57d97
Restart ✅
Aluval Sep 16, 2024
583bbd5
Update Dockerfile
Aluval Sep 16, 2024
7608da5
Restart ✅
Aluval Sep 16, 2024
4917cb2
Update config.py
Aluval Dec 21, 2024
0394d3f
Update bot.py
Aluval Dec 21, 2024
094b1b5
Update bot.py
Aluval Dec 21, 2024
678a854
Update config.py
kshnajha Feb 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions Database/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,17 @@ async def get_thumbnail(self, user_id):
async def delete_thumbnail(self, user_id):
await self.files_col.update_one({'id': user_id}, {'$unset': {'thumbnail_file_id': ""}})

async def save_attach_photo(self, user_id, file_id):
await self.files_col.update_one({'id': user_id}, {'$set': {'attach_photo_file_id': file_id}}, upsert=True)

async def save_attach_photo(self, user_id, custom_photo_path):
await self.files_col.update_one(
{'id': user_id},
{'$set': {'attach_photo_file_path': custom_photo_path}},
upsert=True
)

async def get_attach_photo(self, user_id):
file_data = await self.files_col.find_one({'id': user_id})
if file_data:
return file_data.get('attach_photo_file_id')
return file_data.get('attach_photo_file_path')
return None

async def save_merge_state(self, user_id, merge_state):
Expand Down
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
FROM python:3.10
WORKDIR /app
COPY . /app/
# Install FFmpeg
RUN apt-get update && \
apt-get install -y ffmpeg
RUN apt -qq update && apt -qq install -y git wget pv jq wget python3-dev ffmpeg mediainfo
RUN pip install -r requirements.txt
CMD ["python", "bot.py"]

#TG: @Sunrises_24
#TG:@Sunrises_24
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
web: python bot.py
web: python3 update.py
#ALL FILES UPLOADED - CREDITS 🌟 - @Sunrises_24
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

## Deploy To Koyeb

[![Deploy to Koyeb](https://www.koyeb.com/static/images/deploy/button.svg)](https://app.koyeb.com/deploy?type=git&repository=github.com/Aluval/MetaMorpher&env[BOT_TOKEN]&env[API_ID]&env[API_HASH]&env[FSUB_UPDATES]&env[FSUB_GROUP]&env[AUTH_USERS]&env[LOG_CHANNEL_ID]&env[WEBHOOK]=True&env[ADMIN]&env[DATABASE_URI]&env[DATABASE_NAME]=Cluster0&env[SUNRISES_PIC]&env[PORT]=8080&run_command=python%20bot.py&branch=SH24BOTS-GD-REVERSION-PVT&name=MetaMorpher)
[![Deploy to Koyeb](https://www.koyeb.com/static/images/deploy/button.svg)](https://app.koyeb.com/deploy?type=git&repository=github.com/Aluval/MetaMorpher&env[BOT_TOKEN]&env[API_ID]&env[API_HASH]&env[FSUB_UPDATES]&env[FSUB_GROUP]&env[AUTH_USERS]&env[LOG_CHANNEL_ID]&env[WEBHOOK]=True&env[ADMIN]&env[DATABASE_URI]&env[DATABASE_NAME]=Cluster0&env[SUNRISES_PIC]&env[PORT]=8080&run_command=python%20bot.py&branch=SH24BOTS-GD-REVERSION-GRP&name=MetaMorpher)

## Deploy To Render

Expand All @@ -27,7 +27,7 @@ Press Below Button to Deploy!

**ADD YOUR TOKEN.PICKLE For Google Drive Access**

**This Branch Only In Bot [Private] Support**
**This Branch Only In Bot [GROUP] Support**

**This Bot Is Follows the 2GB Below Files To Telegram. 2GB Above Files To Google Drive.**

Expand All @@ -43,8 +43,12 @@ Press Below Button to Deploy!
- `Extract Audios` - Extract audio from files.
- `Extract Subtitles` - Extract subtitles from files.
- `Extract Video` - Extract video from files.
- `Change index audio`: Adjusts metadata or index information for audio files.
- `Change Index Subtitles`: Manages and updates index or metadata for subtitle files.
- `Stream Remove` - 𝑅𝑒𝑚𝑜𝑣𝑒 𝐴𝑢𝑑𝑖𝑜𝑠 𝑜𝑟 𝑆𝑢𝑏𝑡𝑖𝑡𝑙𝑒𝑠
- `Multitaskfile` - For File Changemetadata, Rename, Changeindexaudio, Changeindexsub = multitaskfile
- `Multitasklink ` - For link [Workers & Seedr Links] Metadata, Rename, Indexaudio, Indexsub = multitasklink
- `Compress` - compress the file as 480p ,libopus[Anime & Webseries Best]
- `Swap Audio`: Adjusts metadata or index information for audio files."
- `Swap Subtitles`: Manages and updates index or metadata for subtitle files.
- `Attach photo attachment.jpg`: Attaches specific photos like attachment.jpg.
- `Remove tags in files`: Cleans and removes tags or metadata from files.
- `Merge`: Merges files and data [Video + Video].
Expand Down Expand Up @@ -72,6 +76,8 @@ Press Below Button to Deploy!

* `AUTH_USERS` - for restart owner id

* `GROUP` - group id add and admin it

* `DATABASE_NAME` - Database Name

* `DATABASE_URI` - Mongdb Url From mongodb.com.
Expand Down Expand Up @@ -99,8 +105,12 @@ extractsubtitles - 𝐸𝑥𝑡𝑟𝑎𝑐𝑡 𝑠𝑢𝑏𝑡𝑖𝑡𝑙𝑒
extractvideo - 𝐸𝑥𝑡𝑟𝑎𝑐𝑡 𝑣𝑖𝑑𝑒𝑜 𝑓𝑟𝑜𝑚 𝑓𝑖𝑙𝑒𝑠.
rename - 𝑟𝑒𝑝𝑙𝑎𝑦 𝑤𝑖𝑡ℎ 𝑓𝑖𝑙𝑒 𝑡𝑜 𝑅𝑒𝑛𝑎𝑚𝑒📝
gofile - 𝑇ℎ𝑒 𝐹𝑖𝑙𝑒𝑠 𝑈𝑝𝑙𝑜𝑎𝑑 𝑇𝑜 𝐺𝑜𝑓𝑖𝑙𝑒 𝐿𝑖𝑛𝑘 🔗
changeindexaudio - 𝑅𝑒𝑜𝑟𝑑𝑒𝑟 𝑡ℎ𝑒 𝑠𝑒𝑞𝑢𝑒𝑛𝑐𝑒 [a-1 𝑓𝑜𝑟 𝑟𝑒𝑚𝑜𝑣𝑒 𝑎𝑢𝑑𝑖𝑜 , a-2-1-3-4 𝑓𝑜𝑟 𝑠𝑤𝑎𝑝 𝑎𝑢𝑑𝑖𝑜]
changeindexsub - 𝑅𝑒𝑜𝑟𝑑𝑒𝑟 𝑡ℎ𝑒 𝑠𝑒𝑞𝑢𝑒𝑛𝑐𝑒 [s-1 𝑓𝑜𝑟 𝑟𝑒𝑚𝑜𝑣𝑒 𝑠𝑢𝑏𝑡𝑖𝑡𝑙𝑒 , s-2-1-3-4 𝑓𝑜𝑟 𝑠𝑤𝑎𝑝 𝑠𝑢𝑏𝑡𝑖𝑡𝑙𝑒]
streamremove - 𝑅𝑒𝑚𝑜𝑣𝑒 𝐴𝑢𝑑𝑖𝑜𝑠 𝑜𝑟 𝑆𝑢𝑏𝑡𝑖𝑡𝑙𝑒𝑠
multitaskfile - 𝐹𝑜𝑟 𝐹𝑖𝑙𝑒 𝐶ℎ𝑎𝑛𝑔𝑒𝑚𝑒𝑡𝑎𝑑𝑎𝑡𝑎, 𝑅𝑒𝑛𝑎𝑚𝑒, 𝐶ℎ𝑎𝑛𝑔𝑒𝑖𝑛𝑑𝑒𝑥𝑎𝑢𝑑𝑖𝑜, 𝐶ℎ𝑎𝑛𝑔𝑒𝑖𝑛𝑑𝑒𝑥𝑠𝑢𝑏 = 𝑚𝑢𝑙𝑡𝑖𝑡𝑎𝑠𝑘𝑓𝑖𝑙𝑒
multitasklink - 𝐹𝑜𝑟 𝑙𝑖𝑛𝑘 [𝑊𝑜𝑟𝑘𝑒𝑟𝑠 & 𝑆𝑒𝑒𝑑𝑟 𝐿𝑖𝑛𝑘𝑠] 𝑀𝑒𝑡𝑎𝑑𝑎𝑡𝑎, 𝑅𝑒𝑛𝑎𝑚𝑒, 𝐼𝑛𝑑𝑒𝑥𝑎𝑢𝑑𝑖𝑜, 𝐼𝑛𝑑𝑒𝑥𝑠𝑢𝑏 = 𝑚𝑢𝑙𝑡𝑖𝑡𝑎𝑠𝑘𝑙𝑖𝑛𝑘
compress - 𝑐𝑜𝑚𝑝𝑟𝑒𝑠𝑠 𝑡ℎ𝑒 𝑓𝑖𝑙𝑒 𝑎𝑠 480𝑝 ,𝑙𝑖𝑏𝑜𝑝𝑢𝑠[𝐴𝑛𝑖𝑚𝑒 & 𝑊𝑒𝑏𝑠𝑒𝑟𝑖𝑒𝑠 𝐵𝑒𝑠𝑡]
swapaudio - 𝑅𝑒𝑜𝑟𝑑𝑒𝑟 𝑡ℎ𝑒 𝑠𝑒𝑞𝑢𝑒𝑛𝑐𝑒 [a-2-1-3-4 𝑓𝑜𝑟 𝑠𝑤𝑎𝑝 𝑎𝑢𝑑𝑖𝑜]
swapsubitles - 𝑅𝑒𝑜𝑟𝑑𝑒𝑟 𝑡ℎ𝑒 𝑠𝑒𝑞𝑢𝑒𝑛𝑐𝑒 [s-2-1-3-4 𝑓𝑜𝑟 𝑠𝑤𝑎𝑝 𝑠𝑢𝑏𝑡𝑖𝑡𝑙𝑒]
changemetadata - 𝑇𝑟𝑎𝑛𝑠𝑓𝑜𝑟𝑚 𝑡ℎ𝑒 𝑚𝑒𝑡𝑎𝑑𝑎𝑡𝑎
removetags - 𝑇𝑜 𝑅𝑒𝑚𝑜𝑣𝑒 𝐴𝑙𝑙 𝑀𝑒𝑡𝑎𝑑𝑎𝑡𝑎 𝑇𝑎𝑔𝑠
samplevideo - 𝐶𝑟𝑒𝑎𝑡𝑒 𝐴 𝑆𝑎𝑚𝑝𝑙𝑒 𝑉𝑖𝑑𝑒𝑜 🎞️
Expand Down
33 changes: 31 additions & 2 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "MetaMorpher",
"description": "ADVANCE RENAME BOT WITH THUMBNAIL,CAPTION & HIGH SPEED ⚡️",
"logo":"https://graph.org/file/bd91761f6e938e2e6d23a.jpg",
"repository": "https://github.com/Aluval/ADVANCERENAME24BOT",
"repository": "https://github.com/Aluval/MetaMorpher",
"keywords": ["Rename-bot", "Telegram", "ADVANCE RENAME 24 BOT"],
"env": {
"BOT_TOKEN": {
Expand All @@ -17,13 +17,42 @@
"description": "Your API_HASH from https://my.telegram.org/apps",
"required": true
},
"DATABASE_URI": {
"description": "mongoDB URI. Get this value from https://www.mongodb.com. For more help watch this video - https://youtu.be/dsuTn4qV2GA",
"value": "",
"required": true
},
"DATABASE_NAME": {
"description": "Name of the database in mongoDB. For more contact to admin",
"value": "Cluster0",
"required": false
},
"LOG_CHANNEL_ID": {
"description": "Add to bot & admin the bot in channel",
"value": "",
"required": true
},
"WEBHOOK": {
"description": "web true only",
"value": "True",
"required": true
},
"PORT": {
"description": "8080",
"value": "8080",
"required": true
},
"FSUB_UPDATES": {
"description": "forcesub username channel and admin it",
"required": true
},
"FSUB_GROUP": {
"description": "forcesub username group and admin it",
"required": true
"required": true
},
"GROUP": {
"description": "Group id",
"required": true
},
"SUNRISES_PIC": {
"description": "Start Pic",
Expand Down
2 changes: 1 addition & 1 deletion bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async def start(self):
await app.setup()
bind_address = "0.0.0.0"
await web.TCPSite(app, bind_address, PORT).start()
await self.send_message(LOG_CHANNEL_ID, f"{me.first_name} | @{me.username} 𝚂𝚃𝙰𝚁𝚃𝙴𝙳...⚡️")
print(f"{me.first_name} | @{me.username} 𝚂𝚃𝙰𝚁𝚃𝙴𝙳...⚡️")



Expand Down
16 changes: 9 additions & 7 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@
id_pattern = re.compile(r'^.\d+$')


API_ID = int(os.environ.get("API_ID", "10811400"))
API_HASH = os.environ.get("API_HASH", "191bf5ae7a6c39771e7b13cf4ffd1279")
BOT_TOKEN = os.environ.get("BOT_TOKEN", "6487202001:AAHvkz9vPGnVX_QpIPr-YvOJvHMBARepPyY")
ADMIN = int(os.environ.get("ADMIN", '6469754522'))
API_ID = os.environ.get("API_ID", "20577207")
API_HASH = os.environ.get("API_HASH", "40b5e72e7b9607c2e5563fff5c7b0a37")
BOT_TOKEN = os.environ.get("BOT_TOKEN", "7565764530:AAGCGRi2p23_QX86Vcm4vUIm3t85PIxMTyk")
ADMIN = int(os.environ.get("ADMIN", '2041855080'))
FSUB_UPDATES = os.environ.get("FSUB_CHANNEL", "Sunrises24BotUpdates")
FSUB_GROUP = os.environ.get("FSUB_GROUP", "Sunrises24BotSupport")
DATABASE_URI = os.environ.get("DATABASE_URI", "mongodb+srv://UPLOADXPRO24BOT:UPLOADXPRO24BOT@cluster0.hjfk60f.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0")
DATABASE_URI = os.environ.get("DATABASE_URI", "mongodb+srv://krishnajha2034:8905563700@cluster0.flb9u.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0")
DATABASE_NAME = os.environ.get("DATABASE_NAME", "Cluster0")
CAPTION = os.environ.get("CAPTION", "")
group = environ.get('GROUP', '-1002425543008)
GROUP = int(group) if group and id_pattern.search(group) else None
#ALL FILES UPLOADED - CREDITS 🌟 - @Sunrises_24
SUNRISES_PIC= "https://graph.org/file/bd91761f6e938e2e6d23a.jpg" # Replace with your Telegraph link
AUTH_USERS = int(os.environ.get("AUTH_USERS", '6469754522'))
AUTH_USERS = int(os.environ.get("AUTH_USERS", '7906265673'))
WEBHOOK = bool(os.environ.get("WEBHOOK", True))
PORT = int(os.environ.get("PORT", "8080"))
LOG_CHANNEL_ID = os.environ.get("LOG_CHANNEL_ID", -1002145984196)
LOG_CHANNEL_ID = os.environ.get("LOG_CHANNEL_ID", -1002237472046)
53 changes: 53 additions & 0 deletions main/ffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,3 +283,56 @@ def get_mediainfo(file_path):
if process.returncode != 0:
raise Exception(f"Error getting media info: {stderr.decode().strip()}")
return stdout.decode().strip()

# Function to compress Ffmpeg information using compress command
def compress_video(input_path, output_path, video_title, audio_title, subtitle_title):
command = [
'ffmpeg',
'-hide_banner',
'-loglevel', 'quiet',
'-i', input_path,
'-c:v', 'libx264',
'-crf', '28',
'-pix_fmt', 'yuv420p',
'-s', '854x480',
'-b:v', '150k',
'-c:a', 'libopus',
'-b:a', '35k',
'-preset', 'veryfast',
'-map', '0:v:0', # Map the first video stream
'-map', '0:a', # Map all audio streams
'-map', '0:s?', # Map all subtitle streams if present
'-metadata', f'title={video_title}',
'-metadata:s:v:0', f'title={video_title}',
'-metadata:s:a', f'title={audio_title}',
'-metadata:s:s', f'title={subtitle_title}',
'-y',
output_path
]

process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = process.communicate()
if process.returncode != 0:
raise Exception(f"FFmpeg error: {stderr.decode('utf-8')}")

# Function to compress mediainfo information using compress command
async def get_and_upload_mediainfo(bot, output_file, media):
media_info_html = get_mediainfo(output_file)

media_info_html = (
f"<strong>SUNRISES 24 BOT UPDATES</strong><br>"
f"<strong>MediaInfo X</strong><br>"
f"{media_info_html}"
f"<p>Rights Designed By Sᴜɴʀɪsᴇs Hᴀʀsʜᴀ 𝟸𝟺 🇮🇳 ᵀᴱᴸ</p>"
)

response = telegraph.post(
title="MediaInfo",
author="SUNRISES 24 BOT UPDATES",
author_url="https://t.me/Sunrises24BotUpdates",
text=media_info_html
)
link = f"https://graph.org/{response['path']}"

return media_info_html, link

17 changes: 17 additions & 0 deletions main/gdrive.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,23 @@ async def upload_to_google_drive(file_path, file_name, sts):

return response.get('webViewLink')

#Driveleech
def extract_id_from_driveurl(url):
file_id = None
# Match the different URL patterns for Google Drive links
patterns = [
r'id=([a-zA-Z0-9-_]+)', # Format 1: ?id=FILE_ID
r'/d/([a-zA-Z0-9-_]+)', # Format 2: /d/FILE_ID/
r'/file/d/([a-zA-Z0-9-_]+)' # Format 3: /file/d/FILE_ID/
]

for pattern in patterns:
match = re.search(pattern, url)
if match:
file_id = match.group(1)
break

return file_id


#ALL FILES UPLOADED - CREDITS 🌟 - @Sunrises_24
Expand Down
Loading