from datetime import datetime

import requests







def     _a				(      lowercase__  :			str ):







     '''simple docstring'''


     SCREAMING_SNAKE_CASE__				:				Optional[int]			=		'https://downloadgram.net/wp-json/wppress/video-downloader/video?url='
     SCREAMING_SNAKE_CASE__				:				List[str]			=		requests.get(base_url + url ).json()[0]['urls'][0]['src']
     return requests.get(lowercase__ ).content


if __name__ == "__main__":
      SCREAMING_SNAKE_CASE__		:					Dict						=					input("Enter Video/IGTV url: ").strip()
      SCREAMING_SNAKE_CASE__		:					Union[str, Any]						=					F"""{datetime.now():%Y-%m-%d_%H:%M:%S}.mp4"""
      with open(file_name, "wb") as fp:
            fp.write(download_video(url))
      print(F"""Done. Video saved to disk as {file_name}.""")




from packaging import version

from .import_utils import is_accelerate_available


if is_accelerate_available():
      import accelerate







def     _a				(      lowercase__  :			List[str] ):







     '''simple docstring'''


     if not is_accelerate_available():
          return method
     SCREAMING_SNAKE_CASE__				:				str			=		version.parse(accelerate.__version__ ).base_version
     if version.parse(lowercase__ ) < version.parse('0.17.0' ):
          return method

     def wrapper(self  :			Optional[int]     ,  *lowercase__  :			int     ,  **lowercase__  :			Tuple ):
          if hasattr(self     ,  '_hf_hook' ) and hasattr(self._hf_hook     ,  'pre_forward' ):
               self._hf_hook.pre_forward(self )
          return method(self     ,  *lowercase__     ,  **lowercase__ )

     return wrapper



