






from datetime import datetime

import requests





def 	lowerCAmelCase_		(lowercase__						:       str       )		->    bytes:


				'''simple docstring'''




				lowerCAmelCase__      			=						"https://downloadgram.net/wp-json/wppress/video-downloader/video?url="
				lowerCAmelCase__      			=						requests.get(base_url + url       ).json()[0]["urls"][0]["src"]
				return requests.get(__snake_case       ).content


if __name__ == "__main__":
							_UpperCAmelCase			:		Optional[Any]   				=    input("Enter Video/IGTV url: ").strip()
							_UpperCAmelCase			:		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 typing import Optional

import pyspark

from .. import Features, NamedSplit
from ..download import DownloadMode
from ..packaged_modules.spark.spark import Spark
from .abc import AbstractDatasetReader
class  lowerCAmelCase_       (				snake_case__					):




							def __init__(   self     :   str ,							SCREAMING_SNAKE_CASE_     :   pyspark.sql.DataFrame ,							SCREAMING_SNAKE_CASE_     :   Optional[NamedSplit] = None ,							SCREAMING_SNAKE_CASE_     :   Optional[Features] = None ,							SCREAMING_SNAKE_CASE_     :   bool = True ,							SCREAMING_SNAKE_CASE_     :   str = None ,							SCREAMING_SNAKE_CASE_     :   bool = False ,							SCREAMING_SNAKE_CASE_     :   str = None ,							SCREAMING_SNAKE_CASE_     :   bool = True ,							SCREAMING_SNAKE_CASE_     :   str = "arrow" ,							**SCREAMING_SNAKE_CASE_     :   Optional[Any] ,							):
											super().__init__(
											    split=SCREAMING_SNAKE_CASE_ ,							features=SCREAMING_SNAKE_CASE_ ,							cache_dir=SCREAMING_SNAKE_CASE_ ,							keep_in_memory=SCREAMING_SNAKE_CASE_ ,							streaming=SCREAMING_SNAKE_CASE_ ,							**SCREAMING_SNAKE_CASE_ ,							)
											lowerCAmelCase__      			=						load_from_cache_file
											lowerCAmelCase__      			=						file_format
											lowerCAmelCase__      			=						Spark(
											    df=SCREAMING_SNAKE_CASE_ ,							features=SCREAMING_SNAKE_CASE_ ,							cache_dir=SCREAMING_SNAKE_CASE_ ,							working_dir=SCREAMING_SNAKE_CASE_ ,							**SCREAMING_SNAKE_CASE_ ,							)




							def 						__snake_case					(   self     :   List[str]	):
											if self.streaming:
															return self.builder.as_streaming_dataset(split=self.split	)
											lowerCAmelCase__      			=						None if self._load_from_cache_file else DownloadMode.FORCE_REDOWNLOAD
											self.builder.download_and_prepare(
											    download_mode=SCREAMING_SNAKE_CASE_ ,							file_format=self._file_format ,							)
											return self.builder.as_dataset(split=self.split	)





