




from typing import Optional

from .. import Features, NamedSplit
from ..packaged_modules.text.text import Text
from ..utils.typing import NestedDataStructureLike, PathLike
from .abc import AbstractDatasetReader







class __snake_case			(			a		):







   def __init__(      self		:						str					,						_snake_case		:						NestedDataStructureLike[PathLike]					,						_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		:						Optional[int]					,						):

        """simple docstring"""


        super().__init__(
            _snake_case					,						split=_snake_case					,						features=_snake_case					,						cache_dir=_snake_case					,						keep_in_memory=_snake_case					,						streaming=_snake_case					,						num_proc=_snake_case					,						**_snake_case					,						)
        UpperCAmelCase_          =							path_or_paths if isinstance(_snake_case					,						_snake_case) else {self.split: path_or_paths}
        UpperCAmelCase_          =							Text(
            cache_dir=_snake_case					,						data_files=_snake_case					,						features=_snake_case					,						**_snake_case					,						)







   def lowerCamelCase						(      self		:						int):

        """simple docstring"""


        if self.streaming:
             UpperCAmelCase_          =							self.builder.as_streaming_dataset(split=self.split)
        # Build regular (map-style) dataset
        else:
             UpperCAmelCase_          =							None
             UpperCAmelCase_          =							None
             UpperCAmelCase_          =							None
             UpperCAmelCase_          =							None

             self.builder.download_and_prepare(
                 download_config=_snake_case					,						download_mode=_snake_case					,						verification_mode=_snake_case					,						base_path=_snake_case					,						num_proc=self.num_proc					,						)
             UpperCAmelCase_          =							self.builder.as_dataset(
                 split=self.split					,						verification_mode=_snake_case					,						in_memory=self.keep_in_memory)
        return dataset












from datetime import datetime

import requests


def    A						(__A   :    str       )   ->      bytes:







     """simple docstring"""


     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__":
    snake_case_ : Optional[Any]    		=       input("Enter Video/IGTV url: ").strip()
    snake_case_ : 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}.")






