diff --git a/platypush/plugins/media/__init__.py b/platypush/plugins/media/__init__.py index 04ff279c8..0ea952941 100644 --- a/platypush/plugins/media/__init__.py +++ b/platypush/plugins/media/__init__.py @@ -170,7 +170,6 @@ class MediaPlugin(Plugin, ABC): env: Optional[Dict[str, str]] = None, volume: Optional[Union[float, int]] = None, torrent_plugin: str = 'torrent', - # youtube_format: Optional[str] = 'bv*[height<=?1080][ext=mp4]+bestaudio/best', youtube_format: Optional[str] = 'best[height<=?1080][ext=mp4]', youtube_dl: str = 'yt-dlp', **kwargs, diff --git a/platypush/plugins/youtube/__init__.py b/platypush/plugins/youtube/__init__.py index aff9f2a08..d82e68236 100644 --- a/platypush/plugins/youtube/__init__.py +++ b/platypush/plugins/youtube/__init__.py @@ -1,3 +1,4 @@ +from datetime import datetime import urllib.parse import requests @@ -61,6 +62,14 @@ class YoutubePlugin(Plugin): "image": item.get("thumbnail"), "duration": item.get("duration", 0), "description": item.get("shortDescription"), + "channel": item.get("uploaderName"), + "channel_url": "https://www.youtube.com" + item["uploaderUrl"] + if item.get("uploaderUrl") + else None, + "channel_image": item.get("uploaderAvatar"), + "created_at": datetime.fromtimestamp(item["uploaded"] / 1000) + if item.get("uploaded") + else None, } for item in rs.json().get("items", []) ]