diff --git a/royalnet/audio/youtubedl.py b/royalnet/audio/youtubedl.py index 89d83054..3d371a1b 100644 --- a/royalnet/audio/youtubedl.py +++ b/royalnet/audio/youtubedl.py @@ -69,7 +69,7 @@ class YtdlInfo: self.description: typing.Optional[str] = info.get("description") self.categories: typing.Optional[typing.List[str]] = info.get("categories") self.tags: typing.Optional[typing.List[str]] = info.get("tags") - self.subtitles: typing.Optional[dict] = info.get("subtitles") + self.subtitles: typing.Optional[typing.Dict[str, typing.List[typing.Dict[str, str]]]] = info.get("subtitles") self.automatic_captions: typing.Optional[dict] = info.get("automatic_captions") self.duration: typing.Optional[int] = info.get("duration") self.age_limit: typing.Optional[int] = info.get("age_limit") @@ -82,18 +82,18 @@ class YtdlInfo: self.average_rating: typing.Optional[...] = info.get("average_rating") self.formats: typing.Optional[list] = info.get("formats") self.is_live: typing.Optional[bool] = info.get("is_live") - self.start_time: typing.Optional[...] = info.get("start_time") - self.end_time: typing.Optional[...] = info.get("end_time") - self.series: typing.Optional[...] = info.get("series") - self.season_number: typing.Optional[...] = info.get("season_number") - self.episode_number: typing.Optional[...] = info.get("episode_number") + self.start_time: typing.Optional[float] = info.get("start_time") + self.end_time: typing.Optional[float] = info.get("end_time") + self.series: typing.Optional[str] = info.get("series") + self.season_number: typing.Optional[int] = info.get("season_number") + self.episode_number: typing.Optional[int] = info.get("episode_number") self.track: typing.Optional[...] = info.get("track") self.artist: typing.Optional[...] = info.get("artist") self.extractor: typing.Optional[str] = info.get("extractor") self.webpage_url_basename: typing.Optional[str] = info.get("webpage_url_basename") self.extractor_key: typing.Optional[str] = info.get("extractor_key") - self.playlist: typing.Optional[...] = info.get("playlist") - self.playlist_index: typing.Optional[...] = info.get("playlist_index") + self.playlist: typing.Optional[str] = info.get("playlist") + self.playlist_index: typing.Optional[int] = info.get("playlist_index") self.thumbnails: typing.Optional[typing.List[typing.Dict[str, str]]] = info.get("thumbnails") self.display_id: typing.Optional[str] = info.get("display_id") self.requested_subtitles: typing.Optional[...] = info.get("requested_subtitles") @@ -105,7 +105,7 @@ class YtdlInfo: self.resolution: typing.Optional[...] = info.get("resolution") self.fps: typing.Optional[int] = info.get("fps") self.vcodec: typing.Optional[str] = info.get("vcodec") - self.vbr: typing.Optional[...] = info.get("vbr") + self.vbr: typing.Optional[int] = info.get("vbr") self.stretched_ratio: typing.Optional[...] = info.get("stretched_ratio") self.acodec: typing.Optional[str] = info.get("acodec") self.abr: typing.Optional[int] = info.get("abr") diff --git a/royalnet/commands/videoinfo.py b/royalnet/commands/videoinfo.py index 6ca9c4ba..f1a78d7c 100644 --- a/royalnet/commands/videoinfo.py +++ b/royalnet/commands/videoinfo.py @@ -25,6 +25,9 @@ class VideoinfoCommand(Command): continue if key == "requested_formats": continue + # Skip subtitles + if key == "subtitles": + continue # Skip empty keys if info_dict[key] is None: continue