Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
fj-livekit
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xianyang
fj-livekit
Commits
fc594b63
Commit
fc594b63
authored
Apr 22, 2024
by
郑磊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
通过配置文件获取sdk路径
parent
5d85dab1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
5 deletions
+7
-5
config.yaml.example
bin/runtime/yaml/config.yaml.example
+1
-0
config.py.example
configs/config.py.example
+1
-0
functions.py
src/libs/functions.py
+5
-5
No files found.
bin/runtime/yaml/config.yaml.example
View file @
fc594b63
...
...
@@ -11,6 +11,7 @@ SQLALCHEMY_CONFIG:
- SQLALCHEMY_TRACK_MODIFICATIONS: true
name: 开启状态
SDK_CONFIG:
- URL: http://livekit.briefmsg.cn
- APPID: APIgSBos6trETHa
- APPSECRET: e88oFyNTkXqK7ZSKuQusrzR90F5rhzI2xLrravVofvY
- IDENTITY: user1
...
...
configs/config.py.example
View file @
fc594b63
...
...
@@ -18,6 +18,7 @@ SQLALCHEMY_CONFIG = apollo.get("SQLALCHEMY_CONFIG")
SQLALCHEMY_DATABASE_URI = [item.get("DATABASE_URI") for item in SQLALCHEMY_CONFIG][0]
SQLALCHEMY_TRACK_MODIFICATIONS = [item.get("SQLALCHEMY_TRACK_MODIFICATIONS") for item in SQLALCHEMY_CONFIG][1]
SDK_CONFIG = apollo.get("SDK_CONFIG")
SDK_CONFIG_URL = [item.get("URL") for item in SDK_CONFIG][0]
SDK_CONFIG_APPID = [item.get("APPID") for item in SDK_CONFIG][0]
SDK_CONFIG_APPSECRET = [item.get("APPSECRET") for item in SDK_CONFIG][1]
SDK_CONFIG_IDENTITY = [item.get("IDENTITY") for item in SDK_CONFIG][2]
...
...
src/libs/functions.py
View file @
fc594b63
...
...
@@ -11,7 +11,7 @@ import requests
from
livekit
import
AccessToken
,
VideoGrant
from
sqlalchemy
import
or_
,
and_
from
configs.config
import
SDK_CONFIG_APPSECRET
,
SDK_CONFIG_APPID
,
client
,
Bucket
,
env
,
SecretKey
,
Region
,
UPLOAD_FOLDER
from
configs.config
import
SDK_CONFIG_
URL
,
SDK_CONFIG_
APPSECRET
,
SDK_CONFIG_APPID
,
client
,
Bucket
,
env
,
SecretKey
,
Region
,
UPLOAD_FOLDER
from
src.libs.db_link
import
LinkMysql
from
src.libs.log_utils
import
Logger
from
src.modules.friend
import
FriendComment
,
FriendGive
...
...
@@ -215,7 +215,7 @@ def GetRoomList(token, names):
"""
获取房间列表信息
"""
url
=
'http://live.zhubei.cn
/twirp/livekit.RoomService/ListRooms'
url
=
SDK_CONFIG_URL
+
'
/twirp/livekit.RoomService/ListRooms'
headers
=
{
"Authorization"
:
token
,
"Content-Type"
:
"application/json"
...
...
@@ -232,7 +232,7 @@ def DeleteRoom(token, room):
"""
删除房间
"""
url
=
'http://live.zhubei.cn
/twirp/livekit.RoomService/DeleteRoom'
url
=
SDK_CONFIG_URL
+
'
/twirp/livekit.RoomService/DeleteRoom'
# room = room.split()
headers
=
{
"Authorization"
:
token
,
...
...
@@ -250,7 +250,7 @@ def CreateRoom(token, name, max_participants, empty_timeout, user_ids):
"""
新建房间
"""
url
=
'http://live.zhubei.cn
/twirp/livekit.RoomService/CreateRoom'
url
=
SDK_CONFIG_URL
+
'
/twirp/livekit.RoomService/CreateRoom'
headers
=
{
"Authorization"
:
token
,
"Content-Type"
:
"application/json"
...
...
@@ -286,7 +286,7 @@ def GetParticipantlist():
"""
获取参与者信息
"""
url
=
'http://live.zhubei.cn
/twirp/livekit.RoomService/ListParticipants'
url
=
SDK_CONFIG_URL
+
'
/twirp/livekit.RoomService/ListParticipants'
headers
=
{
"Authorization"
:
'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2aWRlbyI6eyJyb29tQ3JlYXRlIjp0cnVlLCJyb29tSm9pbiI6dHJ1ZSwicm9vbUxpc3QiOnRydWUsInJvb21SZWNvcmQiOnRydWUsInJvb21BZG1pbiI6dHJ1ZSwicm9vbSI6Ilx1NGUwMFx1NTNmN1x1NmQ0Ylx1OGJkNSJ9LCJpc3MiOiJBUElnU0JvczZ0ckVUSGEiLCJuYmYiOjE2ODEyNzA3NzQsImV4cCI6MTY4MTI5MjM3NCwic3ViIjoiMjMyMzIiLCJuYW1lIjoiMjMyMzIifQ.qv7BS3xp3EhkO9W7bu2rWBLF8-bz67XhOo9Iq88hMV4'
,
"Content-Type"
:
"application/json"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment