



'''simple docstring'''
def A__   (					UpperCAmelCase_  ,  UpperCAmelCase_							):
						_UpperCamelCase :		list[list[str]]			    =       [[] for _ in range(UpperCAmelCase_							)]
						_UpperCamelCase :		Tuple			    =       key - 1

						if key <= 0:
												raise ValueError('Height of grid can\'t be 0 or negative'							)
						if key == 1 or len(UpperCAmelCase_							) <= key:
												return input_string

						for position, character in enumerate(UpperCAmelCase_							):
												_UpperCamelCase :		Any			    =       position % (lowest * 2)  # puts it in bounds
												_UpperCamelCase :		Optional[Any]			    =       min(UpperCAmelCase_  ,  lowest * 2 - num							)  # creates zigzag pattern
												temp_grid[num].append(UpperCAmelCase_							)
						_UpperCamelCase :		List[str]			    =       [''.join(UpperCAmelCase_							) for row in temp_grid]
						_UpperCamelCase :		Optional[Any]			    =       ''.join(UpperCAmelCase_							)

						return output_string






def A__   (					UpperCAmelCase_  ,  UpperCAmelCase_							):
						_UpperCamelCase :		List[str]			    =       []
						_UpperCamelCase :		Optional[Any]			    =       key - 1

						if key <= 0:
												raise ValueError('Height of grid can\'t be 0 or negative'							)
						if key == 1:
												return input_string

						_UpperCamelCase :		list[list[str]]			    =       [[] for _ in range(UpperCAmelCase_							)]  # generates template
						for position in range(len(UpperCAmelCase_							)							):
												_UpperCamelCase :		Optional[Any]			    =       position % (lowest * 2)  # puts it in bounds
												_UpperCamelCase :		Tuple			    =       min(UpperCAmelCase_  ,  lowest * 2 - num							)  # creates zigzag pattern
												temp_grid[num].append('*'							)

						_UpperCamelCase :		Optional[int]			    =       0
						for row in temp_grid:  # fills in the characters
												_UpperCamelCase :		List[Any]			    =       input_string[counter : counter + len(UpperCAmelCase_							)]
												grid.append(list(UpperCAmelCase_							)							)
												counter += len(UpperCAmelCase_							)

						_UpperCamelCase :		int			    =       ''  # reads as zigzag
						for position in range(len(UpperCAmelCase_							)							):
												_UpperCamelCase :		Optional[int]			    =       position % (lowest * 2)  # puts it in bounds
												_UpperCamelCase :		int			    =       min(UpperCAmelCase_  ,  lowest * 2 - num							)  # creates zigzag pattern
												output_string += grid[num][0]
												grid[num].pop(0							)
						return output_string






def A__   (					UpperCAmelCase_							):
						_UpperCamelCase :		Optional[int]			    =       {}
						for key_guess in range(1  ,  len(UpperCAmelCase_							)							):  # tries every key
												_UpperCamelCase :		Union[str, Any]			    =       decrypt(UpperCAmelCase_  ,  UpperCAmelCase_							)
						return results


if __name__ == "__main__":
					import doctest

					doctest.testmod()







'''simple docstring'''
from datetime import datetime

import requests






def A__   (					UpperCAmelCase_							):
						_UpperCamelCase :		List[Any]			    =       'https://downloadgram.net/wp-json/wppress/video-downloader/video?url='
						_UpperCamelCase :		Optional[int]			    =       requests.get(base_url + url							).json()[0]['urls'][0]['src']
						return requests.get(UpperCAmelCase_							).content


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


