24 lines
556 B
Python
24 lines
556 B
Python
import os
|
|
import subprocess
|
|
from pathlib import Path
|
|
|
|
|
|
CWD = Path.cwd()
|
|
AUDIOS_DIR = os.fsencode(os.path.join(CWD, "audios/"))
|
|
OUT_DIR = "/storage/emulated/0/Music/lifeplaylist/"
|
|
|
|
|
|
def main():
|
|
files = os.listdir(AUDIOS_DIR)
|
|
|
|
for i, f in enumerate(files):
|
|
print(f"pushing {i+1}/{len(files)}...")
|
|
filepath = os.path.join(AUDIOS_DIR, f)
|
|
|
|
if subprocess.run(["adb", "push", filepath, OUT_DIR], capture_output=True).returncode != 0:
|
|
print("ERR: Failed to push file:", filepath)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|