muhammedfurkan / TelethonUserBot

Re-definition found for builtin function PYL-W0622
Anti-pattern
Minor
2 years ago3 years old
 35async def download_video(v_url):
 36    """ For .ytdl command, download media from YouTube and many other sites. """
 37    url = v_url.pattern_match.group(2)
 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"
Redefining built-in 'type'
 94async def download_video(v_url):  # sourcery skip: avoid-builtin-shadow
 95    """ For .ytdl command, download media from YouTube and many other sites. """
 96    url = v_url.pattern_match.group(2)
 97    type = v_url.pattern_match.group(1).lower() 98    out_folder = Config.TMP_DOWNLOAD_DIRECTORY + "youtubedl/"
 99
100    if not os.path.isdir(out_folder):
Redefining built-in 'TimeoutError'
 1import asyncio
 2from asyncio import TimeoutError, sleep 3
 4from telethon import events
 5from telethon.errors.rpcerrorlist import YouBlockedUserError
Redefining built-in 'str'
104                for item in subitems:
105                    totallength += len(item)
106                if (totallength <= maxlinelength):
107                    str = "".join(item + " " for item in subitems)108                    # wrap concatenated content in a new list
109                    subitems = [str.strip()]
110                else:
Redefining built-in 'type'
 75    def __enter__(self):
 76        return self.open_files()
 77
 78    def __exit__(self, type, value, traceback): 79        self.close_files()
 80
 81    def open_files(self):