@@ -0,0 +1,1052 @@
+import sys%0A%0Afrom Ziggeo import Ziggeo%0A%0Aif(len(sys.argv) %3C 3):%0A%09print (%22Error%5Cn%22)%0A%09print (%22Usage: $%3Epython _videos_index_orientation.py YOUR_API_TOKEN YOUR_PRIVATE_KEY%5Cn%22)%0A%09sys.exit()%0A%0Aapi_token = sys.argv%5B1%5D%0Aprivate_key = sys.argv%5B2%5D%0Acount_landscape = 0.0%0Acount_portrait = 0.0%0Aziggeo = Ziggeo(api_token, private_key)%0Adef indexVideos(skip=0):%0A%09global count_landscape, count_portrait%0A%09video_list = ziggeo.videos().index(%7B%22limit%22:100, %22skip%22:skip%7D)%0A%09for video in video_list:%0A%09%09width = video%5B'streams'%5D%5B0%5D%5B'video_width'%5D%0A%09%09height = video%5B'streams'%5D%5B0%5D%5B'video_height'%5D%0A%09%09if ( width %3E height) :%0A%09%09%09count_landscape += 1%09%0A%09%09else :%0A%09%09%09count_portrait += 1%0A%09if(len(video_list) %3E 0):%0A%09%09indexVideos(skip+100)%0A%09pass%0AindexVideos(0)%0Apr_portrait = (count_portrait/(count_landscape+count_portrait))*100%0Apr_landscape = (count_landscape/(count_landscape+count_portrait))*100%0Aprint(%22Portrait Count = %7B:.0f%7D Portrait Percentage %7B:.2f%7D%25%22.format(count_portrait, pr_portrait))%0Aprint(%22Landscape Count = %7B:.0f%7D Landscape Percentage %7B:.2f%7D%25%22.format(count_landscape, pr_landscape))

add script to get orientation percentage using video list