def robot(): try: print('\n>>> [Image Robot] Starting...') content = state.load() content = fetch_images_of_all_sentences(content) content = download_all_images(content) state.save(content) print('>>> [Image Robot] Stopping. Work done!') except Exception as e: print(f'\n> [Image Robot] Unexpected Error: {e}\n') exit_video_pymaker()
def robot(): try: print('\n>>> [YouTube Robot] Starting...') content = state.load() service = get_authenticated_service() video_id = upload_video(content, service) upload_thumbnail(video_id, service) state.save(content) print('>>> [YouTube Robot] Stopping. Work done!') except Exception as e: print(f'\n> [YouTube Robot] Unexpected Error: {e}\n') exit_video_pymaker()
def robot(): try: content = Content() content.search_term = ask_search_term() content.search_prefix = ask_search_prefix() print(f'> [Input Robot] Saving content state...') state.save(content) except ValueError as value_error: print(f'\n> [Input Robot] {value_error}') exit_video_pymaker() except Exception as e: print(f'\n> [Input Robot] Unexpected Error: {e}') exit_video_pymaker()
def robot(): try: print('\n>>> [Video Robot] Starting...') content = state.load() convert_all_images(content) create_all_sentences_images(content) create_youtube_thumbnail() create_video_initial_images(content) create_video_with_moviepy() state.save(content) print('>>> [Video Robot] Stopping. Work done!') except Exception as e: print(f'\n> [Video Robot] Unexpected Error: {e}\n') exit_video_pymaker()
def robot(): try: print('\n>>> [Text Robot] Starting...') content = state.load() content = fetch_content_from_wikipedia(content) content = sanitize_content(content) content = break_content_into_sentences(content) content = fetch_keywords_of_all_sentences(content) state.save(content) print('>>> [Text Robot] Stopping. Work done!') except Algorithmia.errors.AlgorithmException as algorithm_exception: print( f'\n> [Text Robot] Error: video-pymaker was unable to fetch Wikipedia with this search term:', f'{content.search_term}.') print(f'> [Text Robot] See Algorithmia error below: ') print(f'> [Text Robot] Algorithmia Error: {algorithm_exception}') exit_video_pymaker() except Exception as e: print(f'\n> [Text Robot] Unexpected Error: {e}\n') exit_video_pymaker()