From 889dabb11276b7db3f7e580259f92b60d25b3efe Mon Sep 17 00:00:00 2001
From: James Taylor <user234683@users.noreply.github.com>
Date: Thu, 25 Feb 2021 19:56:09 -0800
Subject: proto.py: Fix base64 encoding in make_protobuf
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

First issue: Cannot check for presence of list in dictionary
because it is not hashable.
Second issue: Wrong function name was being used (make_proto
instead of _make_protobuf)

Signed-off-by: Jesús <heckyel@hyperbola.info>
---
 youtube/proto.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/youtube/proto.py b/youtube/proto.py
index 933ac92..d8b1fcd 100644
--- a/youtube/proto.py
+++ b/youtube/proto.py
@@ -149,8 +149,8 @@ def _make_protobuf(data):
         data = new_data
     if isinstance(data, str):
         return data.encode('utf-8')
-    elif len(data) == 2 and data[0] in base64_enc_funcs:
-        return base64_enc_funcs[data[0]](make_proto(data[1]))
+    elif len(data) == 2 and data[0] in list(base64_enc_funcs.keys()):
+        return base64_enc_funcs[data[0]](_make_protobuf(data[1]))
     elif isinstance(data, list):
         result = b''
         for field in data:
-- 
cgit v1.2.3