1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

Even more properties! (Thanks to @Mallllco and @Viktya)

This commit is contained in:
Steffo 2019-04-14 19:20:33 +02:00
parent 5968045ece
commit 55771217e0
2 changed files with 12 additions and 9 deletions

View file

@ -69,7 +69,7 @@ class YtdlInfo:
self.description: typing.Optional[str] = info.get("description") self.description: typing.Optional[str] = info.get("description")
self.categories: typing.Optional[typing.List[str]] = info.get("categories") self.categories: typing.Optional[typing.List[str]] = info.get("categories")
self.tags: typing.Optional[typing.List[str]] = info.get("tags") 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.automatic_captions: typing.Optional[dict] = info.get("automatic_captions")
self.duration: typing.Optional[int] = info.get("duration") self.duration: typing.Optional[int] = info.get("duration")
self.age_limit: typing.Optional[int] = info.get("age_limit") 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.average_rating: typing.Optional[...] = info.get("average_rating")
self.formats: typing.Optional[list] = info.get("formats") self.formats: typing.Optional[list] = info.get("formats")
self.is_live: typing.Optional[bool] = info.get("is_live") self.is_live: typing.Optional[bool] = info.get("is_live")
self.start_time: typing.Optional[...] = info.get("start_time") self.start_time: typing.Optional[float] = info.get("start_time")
self.end_time: typing.Optional[...] = info.get("end_time") self.end_time: typing.Optional[float] = info.get("end_time")
self.series: typing.Optional[...] = info.get("series") self.series: typing.Optional[str] = info.get("series")
self.season_number: typing.Optional[...] = info.get("season_number") self.season_number: typing.Optional[int] = info.get("season_number")
self.episode_number: typing.Optional[...] = info.get("episode_number") self.episode_number: typing.Optional[int] = info.get("episode_number")
self.track: typing.Optional[...] = info.get("track") self.track: typing.Optional[...] = info.get("track")
self.artist: typing.Optional[...] = info.get("artist") self.artist: typing.Optional[...] = info.get("artist")
self.extractor: typing.Optional[str] = info.get("extractor") self.extractor: typing.Optional[str] = info.get("extractor")
self.webpage_url_basename: typing.Optional[str] = info.get("webpage_url_basename") self.webpage_url_basename: typing.Optional[str] = info.get("webpage_url_basename")
self.extractor_key: typing.Optional[str] = info.get("extractor_key") self.extractor_key: typing.Optional[str] = info.get("extractor_key")
self.playlist: typing.Optional[...] = info.get("playlist") self.playlist: typing.Optional[str] = info.get("playlist")
self.playlist_index: typing.Optional[...] = info.get("playlist_index") self.playlist_index: typing.Optional[int] = info.get("playlist_index")
self.thumbnails: typing.Optional[typing.List[typing.Dict[str, str]]] = info.get("thumbnails") self.thumbnails: typing.Optional[typing.List[typing.Dict[str, str]]] = info.get("thumbnails")
self.display_id: typing.Optional[str] = info.get("display_id") self.display_id: typing.Optional[str] = info.get("display_id")
self.requested_subtitles: typing.Optional[...] = info.get("requested_subtitles") self.requested_subtitles: typing.Optional[...] = info.get("requested_subtitles")
@ -105,7 +105,7 @@ class YtdlInfo:
self.resolution: typing.Optional[...] = info.get("resolution") self.resolution: typing.Optional[...] = info.get("resolution")
self.fps: typing.Optional[int] = info.get("fps") self.fps: typing.Optional[int] = info.get("fps")
self.vcodec: typing.Optional[str] = info.get("vcodec") 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.stretched_ratio: typing.Optional[...] = info.get("stretched_ratio")
self.acodec: typing.Optional[str] = info.get("acodec") self.acodec: typing.Optional[str] = info.get("acodec")
self.abr: typing.Optional[int] = info.get("abr") self.abr: typing.Optional[int] = info.get("abr")

View file

@ -25,6 +25,9 @@ class VideoinfoCommand(Command):
continue continue
if key == "requested_formats": if key == "requested_formats":
continue continue
# Skip subtitles
if key == "subtitles":
continue
# Skip empty keys # Skip empty keys
if info_dict[key] is None: if info_dict[key] is None:
continue continue