Skip to content

Commit 379efa5

Browse files
committed
fix index url and note added to readme
Signed-off-by: anasty17 <e.anastayyar@gmail.com>
1 parent 615a34a commit 379efa5

6 files changed

Lines changed: 11 additions & 11 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ see [Using Service Accounts](https://github.com/anasty17/mirror-leech-telegram-b
344344

345345
- `IS_TEAM_DRIVE` (`Bool`): Set `True` if uploading to TeamDrive using google-api-python-client. Default is `False`.
346346

347-
- `INDEX_URL` (`Str`): Refer to <https://gitlab.com/ParveenBhadooOfficial/Google-Drive-Index>.
347+
- `INDEX_URL` (`Str`): Refer to <https://gitlab.com/ParveenBhadooOfficial/Google-Drive-Index>. Example: https://xxx.xx.workers.dev/0: (If you have multiple ID config -- replace 0: with the desired id index) or https://xxx.xx.workers.dev without index if you only have one ID in config which is the basic config.
348348

349349
- `STOP_DUPLICATE` (`Bool`): Bot will check file/folder name in Drive incase uploading to `GDRIVE_ID`. If it's present in Drive then downloading or cloning will be stopped. (**NOTE**: Item will be checked using name and not hash, so this feature is not perfect). Default is `False`.
350350

bot/core/startup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ async def update_variables():
221221
drives_ids.append(temp[1])
222222
drives_names.append(temp[0].replace("_", " "))
223223
if len(temp) > 2:
224-
index_urls.append(temp[2].strip("/"))
224+
index_urls.append(temp[2])
225225
else:
226226
index_urls.append("")
227227

bot/helper/listeners/task_listener.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,10 +364,10 @@ async def on_upload_complete(
364364
elif Config.INDEX_URL:
365365
INDEX_URL = Config.INDEX_URL
366366
if INDEX_URL:
367-
share_url = f"{INDEX_URL}/findpath?id={dir_id}"
367+
share_url = f"{INDEX_URL}findpath?id={dir_id}"
368368
buttons.url_button("⚡ Index Link", share_url)
369369
if mime_type.startswith(("image", "video", "audio")):
370-
share_urls = f"{INDEX_URL}/findpath?id={dir_id}&view=true"
370+
share_urls = f"{INDEX_URL}findpath?id={dir_id}&view=true"
371371
buttons.url_button("🌐 View Link", share_urls)
372372
button = buttons.build_menu(2)
373373
else:

bot/helper/mirror_leech_utils/gdrive_utils/search.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def drive_list(self, file_name, target_id="", user_id=""):
143143
msg += f"📁 <code>{file.get('name')}<br>(folder)</code><br>"
144144
msg += f"<b><a href={furl}>Drive Link</a></b>"
145145
if index_url:
146-
url = f'{index_url}/findpath?id={file.get("id")}'
146+
url = f'{index_url}findpath?id={file.get("id")}'
147147
msg += f' <b>| <a href="{url}">Index Link</a></b>'
148148
elif mime_type == "application/vnd.google-apps.shortcut":
149149
furl = self.G_DRIVE_DIR_BASE_DOWNLOAD_URL.format(file.get("id"))
@@ -156,10 +156,10 @@ def drive_list(self, file_name, target_id="", user_id=""):
156156
msg += f"📄 <code>{file.get('name')}<br>({get_readable_file_size(int(file.get('size', 0)))})</code><br>"
157157
msg += f"<b><a href={furl}>Drive Link</a></b>"
158158
if index_url:
159-
url = f'{index_url}/findpath?id={file.get("id")}'
159+
url = f'{index_url}findpath?id={file.get("id")}'
160160
msg += f' <b>| <a href="{url}">Index Link</a></b>'
161161
if mime_type.startswith(("image", "video", "audio")):
162-
urlv = f'{index_url}/findpath?id={file.get("id")}&view=true'
162+
urlv = f'{index_url}findpath?id={file.get("id")}&view=true'
163163
msg += f' <b>| <a href="{urlv}">View Link</a></b>'
164164
msg += "<br><br>"
165165
contents_no += 1

bot/modules/bot_settings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,9 @@ async def edit_variable(_, message, pre_message, key):
281281
drives_ids.insert(0, value)
282282
elif key == "INDEX_URL":
283283
if drives_names and drives_names[0] == "Main":
284-
index_urls[0] = value.strip("/")
284+
index_urls[0] = value
285285
else:
286-
index_urls.insert(0, value.strip("/"))
286+
index_urls.insert(0, value)
287287
elif key == "AUTHORIZED_CHATS":
288288
aid = value.split()
289289
auth_chats.clear()
@@ -488,7 +488,7 @@ async def update_private_file(_, message, pre_message):
488488
drives_ids.append(temp[1])
489489
drives_names.append(temp[0].replace("_", " "))
490490
if len(temp) > 2:
491-
index_urls.append(temp[2].strip("/"))
491+
index_urls.append(temp[2])
492492
else:
493493
index_urls.append("")
494494
elif file_name in [".netrc", "netrc"]:

bot/modules/users_settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ async def set_option(_, message, option):
405405
x = x.lstrip(".")
406406
value.append(x.strip().lower())
407407
elif option == "INDEX_URL":
408-
value = value.strip("/")
408+
value = value
409409
elif option in ["UPLOAD_PATHS", "FFMPEG_CMDS", "YT_DLP_OPTIONS"]:
410410
if value.startswith("{") and value.endswith("}"):
411411
try:

0 commit comments

Comments
 (0)