Refurb linting

Lint with [refurb](https://github.com/dosisod/refurb) using `--disable 126 --python-version 3.9`
This commit is contained in:
OMEGARAZER
2022-11-30 17:19:02 -05:00
parent 5cb3c2c635
commit 831f49daa6
6 changed files with 12 additions and 12 deletions

View File

@@ -48,11 +48,11 @@ class Youtube(BaseDownloader):
raise SiteDownloaderError(f'Youtube download failed: {e}')
downloaded_files = list(download_path.iterdir())
if len(downloaded_files) > 0:
if downloaded_files:
downloaded_file = downloaded_files[0]
else:
raise NotADownloadableLinkError(f"No media exists in the URL {self.post.url}")
with open(downloaded_file, 'rb') as file:
with downloaded_file.open('rb') as file:
content = file.read()
return content
return download