92 try:
93 await v_url.edit("`Fetching playlist data, please wait..`")
94 with YoutubeDL(opts) as ytdl:
95 ytdl_data = await loop.run_in_executor(None, ytdl.extract_info, url) 96 filename = sorted(get_lst_of_files(out_folder, []))
97 except DownloadError as DE:
98 await v_url.edit(f"`{str(DE)}`")
38 type = v_url.pattern_match.group(1).lower()
39 await v_url.edit("`Preparing to download...`")
40 out_folder = Config.TMP_DOWNLOAD_DIRECTORY + "youtubedl/"
41 thumb_image_path = Config.TMP_DOWNLOAD_DIRECTORY + "/thumb_image.jpg" 42 if not os.path.isdir(out_folder):
43 os.makedirs(out_folder)
44 if type == "a":
153 await v_url.edit("`Fetching data, please wait..`")
154 with YoutubeDL(opts) as ytdl:
155 ytdl_data = await loop.run_in_executor(None, ytdl.extract_info, url)
156 filename = sorted(get_lst_of_files(out_folder, []))157 except DownloadError as DE:
158 await v_url.edit(f"`{str(DE)}`")
159 return
91 chat = await event.get_chat()
92 admin = chat.admin_rights
93 creator = chat.creator
94 check = await get_service(event.chat_id) 95 if not admin and not creator:
96 await event.edit("`I am not an admin!`")
97 return
41 LOKASYON_2 = LOKASYON_2.replace('i', 'İ').upper()
42 yer = './userbot/bin/namaz_vakti/db/yerler.ndb'
43 with open(yer, "r", encoding="utf-8") as f:
44 yerler_json = json.load(f)45 namaz = namaz_vakti.namazvakti()
46 sehirler_sonuc = namaz.sehirler(2)
47 sonuc_sehirler = {v: k for k, v in sehirler_sonuc['veri'].items()}
An unused variable takes up space in the code, and can lead to confusion, and it should be removed. If this variable is necessary, name the variable _
to indicate that it will be unused, or start the name with unused
or _unused
.
def update():
for i in range(10): # Usused variable `i`
time.sleep(0.01)
display_result()
def update():
for _ in range(10):
time.sleep(0.01)
display_result()