family-guy commited on
Commit
bd19375
·
1 Parent(s): 08bff39

Add video metadata

Browse files
Files changed (1) hide show
  1. pytube/__main__.py +27 -0
pytube/__main__.py CHANGED
@@ -256,6 +256,33 @@ class YouTube(object):
256
  """
257
  return self.vid_descr
258
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
259
  def register_on_progress_callback(self, func):
260
  """Register a download progress callback function post initialization.
261
 
 
256
  """
257
  return self.vid_descr
258
 
259
+ @property
260
+ def rating(self):
261
+ """Get the video average rating.
262
+
263
+ :rtype: str
264
+
265
+ """
266
+ return self.player_config_args['avg_rating']
267
+
268
+ @property
269
+ def length(self):
270
+ """Get the video length in seconds.
271
+
272
+ :rtype: str
273
+
274
+ """
275
+ return self.player_config_args['length_seconds']
276
+
277
+ @property
278
+ def views(self):
279
+ """Get the number of the times the video has been viewed.
280
+
281
+ :rtype: str
282
+
283
+ """
284
+ return self.player_config_args['view_count']
285
+
286
  def register_on_progress_callback(self, func):
287
  """Register a download progress callback function post initialization.
288