import requests
import json

path_to_translations = 'https://www.thenewsspy.com/media/subtitles'
most_common_languages = ["en", "de", "ar", "ru", "es", "fr", "no", "dk", "fi", "se", "nl", "it", "pt"]

for language in most_common_languages:
    response = requests.get(f'{path_to_translations}/{language.lower()}.vtt')

    if response.status_code == 200:
        print(f'Saving "{language.upper()}"')
        with open(f'{language.lower()}.vtt', 'wb') as f:
            f.write(response.content)
    elif response.status_code == 404:
        print(f'"{language.upper()}" Not Found.')
