Spaces:
Running
Running
Upload vtv_api.py
Browse files- vtv_api.py +5 -6
vtv_api.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
# VTV Stream — SV2/
|
| 2 |
import re, time, threading, json, requests
|
| 3 |
from fastapi import APIRouter, Query
|
| 4 |
from fastapi.responses import JSONResponse, Response, StreamingResponse
|
|
@@ -21,9 +21,8 @@ HARDCODED_URLS = {
|
|
| 21 |
CHANNEL_URLS = {k: (HARDCODED_URLS[k] if k in HARDCODED_URLS else None) for k in ["vtv1","vtv2","vtv3","vtv4","vtv5","vtv6","vtv7","vtv8","vtv9","vtv10"]}
|
| 22 |
CHANNEL_NAMES = {"vtv1":"VTV1","vtv2":"VTV2","vtv3":"VTV3","vtv4":"VTV4","vtv5":"VTV5","vtv6":"VTV6","vtv7":"VTV7","vtv8":"VTV8","vtv9":"VTV9","vtv10":"VTV10","vtvprime":"VTVPrime"}
|
| 23 |
|
| 24 |
-
# Iframe URLs cho từng kênh
|
| 25 |
-
#
|
| 26 |
-
# - vtv7: dùng blogspot của xemtivitop — JWPlayer với FPT M3U8
|
| 27 |
IFRAME_URLS = {
|
| 28 |
"vtv1": "https://sv2.xemtivitop.com/live/hot/vtv1.php",
|
| 29 |
"vtv2": "https://sv2.xemtivitop.com/live/hot/vtv2.php",
|
|
@@ -31,8 +30,8 @@ IFRAME_URLS = {
|
|
| 31 |
"vtv4": "https://sv2.xemtivitop.com/live/hot/vtv4.php",
|
| 32 |
"vtv5": "https://sv2.xemtivitop.com/live/hot/vtv5.php",
|
| 33 |
"vtv6": "https://sv2.xemtivitop.com/live/hot/vtv6.php",
|
| 34 |
-
# VTV7:
|
| 35 |
-
"vtv7": "https://
|
| 36 |
"vtv8": "https://sv2.xemtivitop.com/live/hot/vtv8.php",
|
| 37 |
"vtv9": "https://sv2.xemtivitop.com/live/hot/vtv9.php",
|
| 38 |
"vtv10": "https://sv2.xemtivitop.com/live/hot/vtv10.php",
|
|
|
|
| 1 |
+
# VTV Stream — SV2/sv.xemtivitop iframe URLs + M3U fallback + EPG
|
| 2 |
import re, time, threading, json, requests
|
| 3 |
from fastapi import APIRouter, Query
|
| 4 |
from fastapi.responses import JSONResponse, Response, StreamingResponse
|
|
|
|
| 21 |
CHANNEL_URLS = {k: (HARDCODED_URLS[k] if k in HARDCODED_URLS else None) for k in ["vtv1","vtv2","vtv3","vtv4","vtv5","vtv6","vtv7","vtv8","vtv9","vtv10"]}
|
| 22 |
CHANNEL_NAMES = {"vtv1":"VTV1","vtv2":"VTV2","vtv3":"VTV3","vtv4":"VTV4","vtv5":"VTV5","vtv6":"VTV6","vtv7":"VTV7","vtv8":"VTV8","vtv9":"VTV9","vtv10":"VTV10","vtvprime":"VTVPrime"}
|
| 23 |
|
| 24 |
+
# Iframe URLs cho từng kênh — lấy từ xemtivitop.com
|
| 25 |
+
# Với VTV7: LINK 1 = blogspot (lỗi), LINK 2 = sv.xemtivitop.com (JWPlayer, hoạt động)
|
|
|
|
| 26 |
IFRAME_URLS = {
|
| 27 |
"vtv1": "https://sv2.xemtivitop.com/live/hot/vtv1.php",
|
| 28 |
"vtv2": "https://sv2.xemtivitop.com/live/hot/vtv2.php",
|
|
|
|
| 30 |
"vtv4": "https://sv2.xemtivitop.com/live/hot/vtv4.php",
|
| 31 |
"vtv5": "https://sv2.xemtivitop.com/live/hot/vtv5.php",
|
| 32 |
"vtv6": "https://sv2.xemtivitop.com/live/hot/vtv6.php",
|
| 33 |
+
# VTV7: LINK 2 trên xemtivitop.com — sv.xemtivitop.com (ko phải sv2), JWPlayer, cho phép iframe
|
| 34 |
+
"vtv7": "https://sv.xemtivitop.com/live/vtv/vtv7.php",
|
| 35 |
"vtv8": "https://sv2.xemtivitop.com/live/hot/vtv8.php",
|
| 36 |
"vtv9": "https://sv2.xemtivitop.com/live/hot/vtv9.php",
|
| 37 |
"vtv10": "https://sv2.xemtivitop.com/live/hot/vtv10.php",
|