diff --git a/get_youtube_videos/get_youtube_videos.py b/get_youtube_videos/get_youtube_videos.py index 99e8513..f0fb5ed 100644 --- a/get_youtube_videos/get_youtube_videos.py +++ b/get_youtube_videos/get_youtube_videos.py @@ -377,12 +377,12 @@ class GetYoutubeVideos: } if self.selected_proxy != '': ydl_opts['proxy'] = self.selected_proxy - with yt_dlp.YoutubeDL(ydl_opts) as ydl: - download_result = 'starting' - while 'downloaded' not in download_result and 'error' not in download_result: - self._log.debug( - f"Download status: {download_result}" - ) + download_result = 'starting' + while 'downloaded' not in download_result and 'error' not in download_result: + self._log.debug( + f"Download status: {download_result}" + ) + with yt_dlp.YoutubeDL(ydl_opts) as ydl: try: uri=f"https://www.youtube.com/watch?v={video_id}" return_code = ydl.download(uri)