(
*args: str,
encoding: Optional[str] = "utf-8",
)
| 10 | |
| 11 | |
| 12 | def call_scdl_with_auth( |
| 13 | *args: str, |
| 14 | encoding: Optional[str] = "utf-8", |
| 15 | ) -> subprocess.CompletedProcess: |
| 16 | auth_token = os.getenv("AUTH_TOKEN", "") |
| 17 | args = ("scdl", *args, f"--auth-token={auth_token}", f"--client-id={client_id}") |
| 18 | return subprocess.run( |
| 19 | args, |
| 20 | capture_output=True, |
| 21 | encoding=encoding, |
| 22 | errors="ignore" if encoding is not None else None, |
| 23 | check=False, |
| 24 | ) |
| 25 | |
| 26 | |
| 27 | def assert_track( |