小编Ali*_*afi的帖子

如何为python应用程序创建视频和语音通话?

我想将视频和语音通话添加到我用 python 开发的 Web 应用程序中。我在网上搜索了一下,发现用WebRTC可以做到,但是这个工作是用JavaScript来完成的,但是我不知道如何用python来做这个工作?我在 python 3.6 中使用 Sanic 作为 Web 框架。

另一方面,是否可以在 python 中使用 socketio 来完成这项工作?我知道这个模块适合聊天应用。我很感激你的帮助。

python-3.x webrtc

6
推荐指数
1
解决办法
2万
查看次数

如何从aiohttp中的url获取查询字符串参数?

我尝试使用 aiohttp 从 url 获取查询字符串参数,但此代码不起作用:

async def call_answer(request):
    print("request", request)
    params = request.rel_url.query
    print("parameters +++++", params["call_id"])
    conn = psycopg2.connect(connect_str)
    cursor = conn.cursor()
    sql = """
          update calls
          set status = %s
          where id = %s;
          """ % (params["status"], params["call_id"])
    cursor.execute(sql)
    conn.commit()

    return web.Response(
        content_type='application/json',
        text=json.dumps({
            'status': 'success'
        }))



if __name__ == '__main__':
    parser = argparse.ArgumentParser(description='WebRTC audio / video / data-channels demo')
    parser.add_argument('--port', type=int, default=8080,
                        help='Port for HTTP server (default: 8080)')
    parser.add_argument('--verbose', '-v', action='count')
    args = parser.parse_args()

    if args.verbose:
        logging.basicConfig(level=logging.DEBUG)

    app …
Run Code Online (Sandbox Code Playgroud)

python string request.querystring python-3.x aiohttp

4
推荐指数
1
解决办法
4478
查看次数