





from abc import ABC, abstractmethod
from typing import Optional, Union

from .. import Dataset, DatasetDict, Features, IterableDataset, IterableDatasetDict, NamedSplit
from ..utils.typing import NestedDataStructureLike, PathLike






class        snake_case_    (		__lowercase						):






  def __init__(							self			:					Tuple       ,  _snake_case			:					Optional[NestedDataStructureLike[PathLike]] = None       ,  _snake_case			:					Optional[NamedSplit] = None       ,  _snake_case			:					Optional[Features] = None       ,  _snake_case			:					str = None       ,  _snake_case			:					bool = False       ,  _snake_case			:					bool = False       ,  _snake_case			:					Optional[int] = None       ,  **_snake_case			:					List[str]       ,  )->List[Any]:






   '''simple docstring'''

   __lowerCAmelCase					:	List[Any]      =       path_or_paths
   __lowerCAmelCase					:	Optional[Any]      =       split if split or isinstance(_snake_case       ,  _snake_case      ) else """train"""
   __lowerCAmelCase					:	List[Any]      =       features
   __lowerCAmelCase					:	Dict      =       cache_dir
   __lowerCAmelCase					:	Tuple      =       keep_in_memory
   __lowerCAmelCase					:	int      =       streaming
   __lowerCAmelCase					:	Optional[Any]      =       num_proc
   __lowerCAmelCase					:	str      =       kwargs






  @abstractmethod
  def 				UpperCAmelCase__						(							self			:					int      )->Union[Dataset, DatasetDict, IterableDataset, IterableDatasetDict]:






   '''simple docstring'''

   pass






class        snake_case_    (		__lowercase						):






  def __init__(							self			:					Optional[Any]       ,  _snake_case			:					Optional[Features] = None       ,  _snake_case			:					str = None       ,  _snake_case			:					bool = False       ,  _snake_case			:					bool = False       ,  _snake_case			:					Optional[int] = None       ,  **_snake_case			:					Tuple       ,  )->List[str]:






   '''simple docstring'''

   __lowerCAmelCase					:	List[Any]      =       features
   __lowerCAmelCase					:	Dict      =       cache_dir
   __lowerCAmelCase					:	Optional[int]      =       keep_in_memory
   __lowerCAmelCase					:	int      =       streaming
   __lowerCAmelCase					:	Any      =       num_proc
   __lowerCAmelCase					:	Optional[Any]      =       kwargs






  @abstractmethod
  def 				UpperCAmelCase__						(							self			:					Dict      )->Union[Dataset, IterableDataset]:






   '''simple docstring'''

   pass








from datetime import datetime

import requests






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


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