Skip to content

Commit

Permalink
Improved : Compatiblity for generating both the 'new_heading' && 'lec…
Browse files Browse the repository at this point in the history
…t_caption', to cover file-Names having whitespaces in name instead of underscores. & More...

1. new_heading : Moded the code to work with file-Names having whitespaces in name instead of underscores (the earlier case)
2. lect_caption : Also, improved to check the last-Dot from the last/end side so the file-Names can now have multiple dots(.) as part of it.

Ref for THE Prev.Commit::

alik0211/mtproto-core#279
gram-js/gramjs#522
  • Loading branch information
teamprotech committed May 7, 2024
1 parent 9092905 commit bf0e674
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ async def main():
while True:
if not file_num < n:
break
new_heading = sys.argv[file_num].split("/")[-1].rsplit("_", 2)[0]
new_heading = sys.argv[file_num].split("/")[-1].rsplit(" ", 2)[0]
if not old_heading == new_heading:
print("Subject/Series changed... so Changing/Sending the new HEADING before uploading this new series...")
send_heading = new_heading.replace("_", " ") + " ✅ ✅"
await client.send_message(chat, send_heading)
old_heading = new_heading
count_called = 0
lect_caption = sys.argv[file_num].split("/")[-1].split(".")[0]
lect_caption = sys.argv[file_num].split("/")[-1].rsplit(".", 1)[0]
file_path = sys.argv[file_num]
start_time = datetime.now()
print("Now uploading file", file_path)
Expand Down

0 comments on commit bf0e674

Please sign in to comment.