Пример #1
0
shows = []

with open('title-map.json') as titlemap_file:
    titlemap = json.load(titlemap_file)
with open('multi-season.json') as multiseason_file:
    multiseason = json.load(multiseason_file)
with open('azure.json') as azure_file:
    azure_storage = json.load(azure_file)
azure_blob = BlockBlobService(account_name=azure_storage['account'],
                              account_key=azure_storage['key'])
with open('proxies.json') as proxies_file:
    proxy_data = json.load(proxies_file)
    proxy = proxy_data['uk']
sources = [
    animesources.Crunchyroll(titlemap, multiseason, 'uk', proxy),
    animesources.Funimation(titlemap, multiseason, 'gb', proxy),
    animesources.Netflix(titlemap, multiseason, 'uk', proxy),
    animesources.HiDive(titlemap, multiseason, 'uk', proxy),
    animesources.AmazonPrime(titlemap, multiseason, 'uk', proxy)
]
for source in sources:
    source.UpdateShowList(indexedShows)
    print(source.GetName() + ': ' + str(len(indexedShows)))
shows = indexedShows.values()
with open('alternates.json') as alternates_file:
    alternates = json.load(alternates_file)
for alternate in alternates:
    match_index = next((i for i, x in enumerate(shows)
                        if animesources.compare(x['name'], alternate)), False)
    if (match_index):
        shows[match_index]['alt'] = alternates[alternate]
Пример #2
0
        "netflix": "http://www.netflix.com/title/70204981"
    }
}]

with open('title-map.json') as titlemap_file:
    titlemap = json.load(titlemap_file)
with open('multi-season.json') as multiseason_file:
    multiseason = json.load(multiseason_file)
with open('azure.json') as azure_file:
    azure_storage = json.load(azure_file)
azure_blob = BlobService(account_name=azure_storage['account'],
                         account_key=azure_storage['key'])
sources = [
    animesources.Hulu(titlemap, multiseason),
    animesources.Crunchyroll(titlemap, multiseason),
    animesources.Funimation(titlemap, multiseason),
    animesources.AnimeNetwork(titlemap, multiseason),
    animesources.Netflix(titlemap, multiseason),
    animesources.Daisuki(titlemap, multiseason),
    animesources.Viewster(titlemap, multiseason)
]
for source in sources:
    source.UpdateShowList(shows)
    print(source.GetName() + ': ' + str(len(shows)))
with open('alternates.json') as alternates_file:
    alternates = json.load(alternates_file)
for alternate in alternates:
    match_index = next((i for i, x in enumerate(shows)
                        if animesources.compare(x['name'], alternate)), False)
    if (match_index):
        shows[match_index]['alt'] = alternates[alternate]