From 1eace49094b78dc1cbbb24787a59f5122d61afe2 Mon Sep 17 00:00:00 2001 From: azzy9 <19675382+azzy9@users.noreply.github.com> Date: Mon, 22 Apr 2024 21:10:44 +0100 Subject: [PATCH] add playlist_add_video method --- lib/rumble_user.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/lib/rumble_user.py b/lib/rumble_user.py index 8c5b165..f827d30 100644 --- a/lib/rumble_user.py +++ b/lib/rumble_user.py @@ -207,3 +207,29 @@ class RumbleUser: return data return False + + def playlist_add_video( self, video_id, playlist_id = 'watch-later' ): + + """ method to add video to playlist """ + + if self.has_session(): + + post_content = { + 'playlist_id': playlist_id, + 'video_id': video_id, + } + + headers = { + 'Referer': self.base_url, + 'Content-type': 'application/x-www-form-urlencoded' + } + + data = request_get( + self.base_url + '/service.php?name=playlist.add_video', + post_content, + headers + ) + + return data + + return False