#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from fastapi import APIRouter, Request, Depends
from database import get_db
from sqlalchemy.orm import Session
from utils import hk_video_api

router = APIRouter()

@router.get('/get_video_url_by_id')
async def get_video_url_by_id(
    request: Request, 
    id: str,
    protocol: str = 'hlss',
    db: Session = Depends(get_db)
):
    video_url = hk_video_api.get_video_url(id=id, protocol=protocol)
    print('video_url', video_url)
    return {
        "code": 200,
        "msg": "操作成功",
        "data": video_url
    }