Exemplo n.º 1
0
def set_asset(id):
    if request.method == 'POST':
        username = request.form['username']
        print username
        #  payload = {"name":str(username)}
        api_mod = api.OoyalaAPI(api_key, secrete)
        test = api_mod.patch('assets/' + id, {'name': username})
        if (test == None):
            return render_template('set_asset.html',
                                   test="Something went wrong")
        else:
            return render_template('set_asset.html', test="Name changed")
    if request.method == 'GET':
        return render_template('set_asset.html', test=id)
Exemplo n.º 2
0
def enable_player_email(id):
    api_mod = api.OoyalaAPI(api_key, secrete)
    test = api_mod.patch('players/' + id,
                         {"ooyala_branding": {
                             "twitter_sharing": "true"
                         }})
    print str(test)
    get_sig = sig_generator()
    params = {'api_key': api_key, 'expires': expires_t}
    sig = get_sig.generate_signature(secrete, 'get', '/v2/players/', params,
                                     '')
    request_url = base_Url + 'players/' + part_2 + sig
    print(request_url)
    response = request2.get(request_url)
    player_json = response.json()
    return render_template('get_players.html', player_json=player_json)