Spaces:
Running
Running
Delete static/fix_note.txt
Browse files- static/fix_note.txt +0 -17
static/fix_note.txt
DELETED
|
@@ -1,17 +0,0 @@
|
|
| 1 |
-
def _yt_playlist(channel_path, count=15):
|
| 2 |
-
"""Get videos from YouTube channel using yt-dlp."""
|
| 3 |
-
try:
|
| 4 |
-
result=subprocess.run(["yt-dlp","--flat-playlist","--dump-json","--no-download","--playlist-end",str(count),f"https://www.youtube.com/@fptbongdaofficial/{channel_path}"],capture_output=True,text=True,timeout=60)
|
| 5 |
-
videos=[]
|
| 6 |
-
for line in result.stdout.strip().split('\n'):
|
| 7 |
-
if not line:continue
|
| 8 |
-
try:
|
| 9 |
-
info=json.loads(line)
|
| 10 |
-
vid=info.get("id","")
|
| 11 |
-
title=info.get("title","")
|
| 12 |
-
if not vid or not title:continue
|
| 13 |
-
thumb=f"https://i.ytimg.com/vi/{vid}/hqdefault.jpg"
|
| 14 |
-
videos.append({"title":title,"link":f"https://www.youtube.com/watch?v={vid}","img":thumb,"source":"fpt","id":vid})
|
| 15 |
-
except:pass
|
| 16 |
-
return videos
|
| 17 |
-
except:return[]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|