plak86 commited on
Commit
c2568bd
·
verified ·
1 Parent(s): e2ce5be

Upload mkv.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. mkv.py +29 -0
mkv.py ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import sys
3
+ sys.stdout.reconfigure(encoding='utf-8')
4
+
5
+ def list_mkv_files(directory):
6
+ """Lấy danh sách các file .mkv trong thư mục."""
7
+ mkv_files = []
8
+ for root, _, files in os.walk(directory):
9
+ for file in files:
10
+ if file.endswith('.mkv'):
11
+ mkv_files.append(f'python3 leech.py https://www.fshare.vn/file/{file}')
12
+ return mkv_files
13
+
14
+ # Đặt thư mục cần kiểm tra
15
+ directory = os.path.join(os.getcwd(), "downloaded")
16
+ print(directory)
17
+ # Hoặc: directory = os.path.join(os.getcwd(), "downloaded")
18
+
19
+ # Lấy danh sách file .mkv
20
+ mkv_files = list_mkv_files(directory)
21
+
22
+ # In danh sách file
23
+ if mkv_files:
24
+ print("Danh sách file .mkv:")
25
+ for file in mkv_files:
26
+ print(file)
27
+ else:
28
+ print("Không tìm thấy file .mkv nào trong thư mục.")
29
+