این کد من import ytdlp # pip install ytdlp def downloadvideoyoutube(url): ydlopts = {…
- User
این کد من
import yt_dlp # pip install yt_dlp
def download_video_youtube(url): ydl_opts = { 'proxy': 'http://127.0.0.1:2080' } with yt_dlp.YoutubeDL(ydl_opts) as ydl: ydl.download([url])
list_dir = os.listdir()
if "cookie.json" in list_dir:
if "cookie.txt" in list_dir:
download_video_youtube("https://www.youtube.com/watch?v=tsVmnexJqGc")
else:
json_to_netscape("cookie.json","cookie.txt")
download_video_youtube("https://www.youtube.com/watch?v=tsVmnexJqGc")
else:
print("can not do anything")
download_video_youtube("https://www.instagram.com/nabegheha.tv/reel/DCw9szfi3E-/")
اینم ارورم
Exception has occurred: DownloadError [0;31mERROR:[0m [Instagram] DCw9szfi3E-: Unable to download webpage: Remote end closed connection without response (caused by TransportError('Remote end closed connection without response')) http.client.RemoteDisconnected: Remote end closed connection without response
The above exception was the direct cause of the following exception:
yt_dlp.networking.exceptions.TransportError: Remote end closed connection without response
During handling of the above exception, another exception occurred:
yt_dlp.utils.ExtractorError: [Instagram] DCw9szfi3E-: Unable to download webpage: Remote end closed connection without response (caused by TransportError('Remote end closed connection without response'))
During handling of the above exception, another exception occurred:
File "C:\Users\Amir Hossein222\Desktop\youtube_download\main.py", line 8, in download_video_youtube ydl.download([url]) File "C:\Users\Amir Hossein222\Desktop\youtube_download\main.py", line 21, in download_video_youtube("https://www.instagram.com/nabegheha.tv/reel/DCw9szfi3E-/") yt_dlp.utils.DownloadError: [0;31mERROR:[0m [Instagram] DCw9szfi3E-: Unable to download webpage: Remote end closed connection without response (caused by TransportError('Remote end closed connection without response'))
- Assistant
خطای شما به این دلیل است که
yt-dlpنمیتواند به آدرس ویدئوی اینستاگرام دسترسی پیدا کند. این مشکل ممکن است به چند دلیل باشد: