randydev commited on
Commit
f1d0d2d
·
1 Parent(s): e23a149

fix update

Browse files
Files changed (2) hide show
  1. akn/langs/__init__.py +1 -1
  2. test.py +2 -20
akn/langs/__init__.py CHANGED
@@ -7,7 +7,7 @@ class Translator:
7
  self.load_languages()
8
 
9
  def load_languages(self):
10
- lang_dir = Path("langs")
11
  for lang_file in lang_dir.glob("*.yml"):
12
  with open(lang_file, 'r', encoding='utf-8') as f:
13
  lang_code = lang_file.stem
 
7
  self.load_languages()
8
 
9
  def load_languages(self):
10
+ lang_dir = Path("akn/langs")
11
  for lang_file in lang_dir.glob("*.yml"):
12
  with open(lang_file, 'r', encoding='utf-8') as f:
13
  lang_code = lang_file.stem
test.py CHANGED
@@ -1,20 +1,2 @@
1
- import yt_dlp
2
-
3
- def download_video_with_caption(url: str, download_path: str = "./downloads/"):
4
- ydl_opts = {
5
- "outtmpl": f"{download_path}%(title)s.%(ext)s",
6
- "quiet": True,
7
- "noplaylist": True,
8
- "format": "best",
9
- }
10
-
11
- with yt_dlp.YoutubeDL(ydl_opts) as ydl:
12
- info = ydl.extract_info(url, download=True)
13
- video_title = info.get("title", "Video")
14
- video_path = ydl.prepare_filename(info)
15
-
16
- return video_path, video_title
17
-
18
- url = "https://vt.tiktok.com/ZSrV6uQme/"
19
- video_path, caption = download_video_with_caption(url)
20
- print(f"Downloaded to: {video_path}\nCaption: {caption}")
 
1
+ import os
2
+ print("Lang files:", os.listdir("akn/langs"))