Add docker support
This commit is contained in:
@@ -69,3 +69,17 @@ def get_error_message(status_code: int) -> str:
|
||||
503: "Service Unavailable",
|
||||
}
|
||||
return errors.get(status_code, "Unknown error")
|
||||
import hashlib
|
||||
|
||||
# simple in-memory mapping: video_id -> original URL
|
||||
_video_map = {}
|
||||
|
||||
|
||||
def get_video_id(url: str) -> str:
|
||||
vid = hashlib.md5(url.encode()).hexdigest()
|
||||
_video_map[vid] = url
|
||||
return vid
|
||||
|
||||
|
||||
def resolve_video_id(vid: str) -> str | None:
|
||||
return _video_map.get(vid)
|
||||
|
||||
Reference in New Issue
Block a user