o
    Y+i                     @   s.   d Z ddlZddlZddlmZ dddZdS )z+
Utilities to get a file from the internet
    N)subprocess_callFc              
   C   s   t j|r
|s
dS d| v r;tj| dd}t|d}|jddD ]}|| q!W d   dS 1 s4w   Y  dS ztd| d	|g W dS  t	yY } zt	|j
d
 d}~ww )a   Small utility to download the file at 'url' under name 'filename'.
    If url is a youtube video ID like z410eauCnH it will download the video
    using youtube-dl (install youtube-dl first !).
    If the filename already exists and overwrite=False, nothing will happen.
    N.T)streamwb   )
chunk_sizez
youtube-dlz-ozs
 A possible reason is that youtube-dl is not installed on your computer. Install it with  "pip install youtube_dl")ospathexistsrequestsgetopeniter_contentwriter   OSErrormessage)urlfilename	overwriterfdchunke r   N/var/www/html/venv/lib/python3.10/site-packages/moviepy/video/io/downloader.pydownload_webfile   s"   "r   )F)__doc__r   r   moviepy.toolsr   r   r   r   r   r   <module>   s
    