mirror of
https://github.com/ihabunek/twitch-dl
synced 2024-08-30 18:32:25 +00:00
Improve types
This commit is contained in:
parent
2846925c91
commit
707b2da934
@ -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]
|
||||
|
||||
|
@ -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"],
|
||||
|
Loading…
Reference in New Issue
Block a user