|
@@ -7,6 +7,7 @@ from utils import hk_video_api
|
|
|
from common import PTZApi
|
|
|
from utils.StripTagsHTMLParser import *
|
|
|
import json
|
|
|
+from config import settings
|
|
|
|
|
|
router = APIRouter()
|
|
|
|
|
@@ -25,6 +26,22 @@ async def get_video_url_by_id(
|
|
|
"data": video_url
|
|
|
}
|
|
|
|
|
|
+# 获取适合小屏播放的互联网代理地址
|
|
|
+@router.get('/proxy/get_video_url_by_id')
|
|
|
+async def get_video_url_by_id(
|
|
|
+ request: Request,
|
|
|
+ id: str,
|
|
|
+ db: Session = Depends(get_db)
|
|
|
+):
|
|
|
+ video_url = hk_video_api.get_video_url(id=id, protocol='hlss')
|
|
|
+ video_url = video_url.replace("https://19.155.5.14:6014", f"{settings.YZY_WEB_ROOT}/hkvideo")
|
|
|
+ print('video_url', video_url)
|
|
|
+ return {
|
|
|
+ "code": 200,
|
|
|
+ "msg": "操作成功",
|
|
|
+ "data": video_url
|
|
|
+ }
|
|
|
+
|
|
|
@router.get("/get_ptz_info")
|
|
|
async def get_ptz_info(
|
|
|
request: Request,
|