





"""simple docstring"""


from datetime import datetime

import requests




def        lowercase__     (       lowercase_      )       ->		bytes:




      """simple docstring"""

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


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





def A    (							__UpperCamelCase			,						__UpperCamelCase       )    ->   Optional[int]:
			A__	  =     0
			A__	  =     len(__UpperCamelCase       ) - 1

			while left <= right:
						# avoid divided by 0 during interpolation
						if sorted_collection[left] == sorted_collection[right]:
									if sorted_collection[left] == item:
												return left
									else:
												return None

						A__	  =     left + ((item - sorted_collection[left]) * (right - left)) // (
						    sorted_collection[right] - sorted_collection[left]
						)

						# out of range check
						if point < 0 or point >= len(__UpperCamelCase       ):
									return None

						A__	  =     sorted_collection[point]
						if current_item == item:
									return point
						else:
									if point < left:
												A__	  =     left
												A__	  =     point
									elif point > right:
												A__	  =     right
												A__	  =     point
									else:
												if item < current_item:
															A__	  =     point - 1
												else:
															A__	  =     point + 1
			return None


def A    (							__UpperCamelCase			,						__UpperCamelCase			,						__UpperCamelCase			,						__UpperCamelCase       )    ->   int:

			# avoid divided by 0 during interpolation
			if sorted_collection[left] == sorted_collection[right]:
						if sorted_collection[left] == item:
									return left
						else:
									return None

			A__	  =     left + ((item - sorted_collection[left]) * (right - left)) // (
			    sorted_collection[right] - sorted_collection[left]
			)

			# out of range check
			if point < 0 or point >= len(__UpperCamelCase       ):
						return None

			if sorted_collection[point] == item:
						return point
			elif point < left:
						return interpolation_search_by_recursion(__UpperCamelCase			,						__UpperCamelCase			,						__UpperCamelCase			,						__UpperCamelCase       )
			elif point > right:
						return interpolation_search_by_recursion(__UpperCamelCase			,						__UpperCamelCase			,						__UpperCamelCase			,						__UpperCamelCase       )
			else:
						if sorted_collection[point] > item:
									return interpolation_search_by_recursion(
									    __UpperCamelCase			,						__UpperCamelCase			,						__UpperCamelCase			,						point - 1       )
						else:
									return interpolation_search_by_recursion(
									    __UpperCamelCase			,						__UpperCamelCase			,						point + 1			,						__UpperCamelCase       )


def A    (							__UpperCamelCase       )    ->   List[str]:
			if collection != sorted(__UpperCamelCase       ):
						raise ValueError('Collection must be ascending sorted'       )
			return True


if __name__ == "__main__":
							import sys
							SCREAMING_SNAKE_CASE__   			=   0
							if debug == 1:
														SCREAMING_SNAKE_CASE__   			=   [1_0, 3_0, 4_0, 4_5, 5_0, 6_6, 7_7, 9_3]
														try:
																					__assert_sorted(collection)
														except ValueError:
																					sys.exit('''Sequence must be ascending sorted to apply interpolation search''')
														SCREAMING_SNAKE_CASE__   			=   6_7

							SCREAMING_SNAKE_CASE__   			=   interpolation_search(collection, target)
							if result is not None:
														print(f'{target} found at positions: {result}')
							else:
														print('''Not found''')




