Improve types

This commit is contained in:
Ivan Habunek 2024-08-30 08:05:16 +02:00
parent 2846925c91
commit 707b2da934
No known key found for this signature in database
GPG Key ID: 01DB3DD0D824504C
2 changed files with 8 additions and 5 deletions

View File

@ -48,7 +48,7 @@ def download_one(video: str, args: DownloadOptions):
raise ConsoleError(f"Invalid input: {video}")
def _join_vods(playlist_path: Path, target: str, overwrite: bool, video: Video):
def _join_vods(playlist_path: Path, target: Path, overwrite: bool, video: Video):
description = video["description"] or ""
description = description.strip()
@ -81,7 +81,7 @@ def _join_vods(playlist_path: Path, target: str, overwrite: bool, video: Video):
raise ConsoleError("Joining files failed")
def _concat_vods(vod_paths: List[Path], target: str):
def _concat_vods(vod_paths: List[Path], target: Path):
tool = "type" if platform.system() == "Windows" else "cat"
command = [tool] + [str(p) for p in vod_paths]

View File

@ -41,9 +41,12 @@ def clip_placeholders(clip: Clip) -> Dict[str, str]:
date, time = clip["createdAt"].split("T")
game = clip["game"]["name"] if clip["game"] else "Unknown"
url = clip["videoQualities"][0]["sourceURL"]
_, ext = os.path.splitext(url)
ext = ext.lstrip(".")
if clip["videoQualities"]:
url = clip["videoQualities"][0]["sourceURL"]
_, ext = os.path.splitext(url)
ext = ext.lstrip(".")
else:
ext = "mp4"
return {
"channel": clip["broadcaster"]["displayName"],