-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_route.py
More file actions
27 lines (17 loc) · 730 Bytes
/
get_route.py
File metadata and controls
27 lines (17 loc) · 730 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import os
import sys
def obtener_nombre_usuario_os(nombre_video):
# En Windows, la variable es 'USERNAME'
# En Linux/macOS, la variable es 'USER' o 'LOGNAME'
username = os.environ.get('USERNAME')
if not username:
username = os.environ.get('USER') or os.environ.get('LOGNAME')
ruta = f"C:\\Users\\{username}\\AppData\\Local\\CapCut\\User Data\\Projects\\com.lveditor.draft\\{nombre_video}\\draft_content.json"
print(f"Ruta final {ruta}")
return ruta
if __name__ == "__main__":
if len(sys.argv) < 2:
print("Uso: python get_route.py <nombre_video>")
sys.exit(1)
nombre_video = sys.argv[1]
obtener_nombre_usuario_os(nombre_video)