



from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


a_							=      {
    """configuration_pegasus_x""": ["""PEGASUS_X_PRETRAINED_CONFIG_ARCHIVE_MAP""", """PegasusXConfig"""],
}

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       a_							=      [
           """PEGASUS_X_PRETRAINED_MODEL_ARCHIVE_LIST""",
           """PegasusXForConditionalGeneration""",
           """PegasusXModel""",
           """PegasusXPreTrainedModel""",
       ]


if TYPE_CHECKING:
       from .configuration_pegasus_x import PEGASUS_X_PRETRAINED_CONFIG_ARCHIVE_MAP, PegasusXConfig

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_pegasus_x import (
                  PEGASUS_X_PRETRAINED_MODEL_ARCHIVE_LIST,
                  PegasusXForConditionalGeneration,
                  PegasusXModel,
                  PegasusXPreTrainedModel,
              )


else:
       import sys

       a_							=      _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)




from datetime import datetime

import requests




def       __lowerCAmelCase      (						A_   : str					)    ->  bytes:
  __UpperCAmelCase						    =       "https://downloadgram.net/wp-json/wppress/video-downloader/video?url="
  __UpperCAmelCase						    =       requests.get(base_url + url					).json()[0]["urls"][0]["src"]
  return requests.get(A_					).content


if __name__ == "__main__":
       a_							=      input("""Enter Video/IGTV url: """).strip()
       a_							=      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}.")



