diff options
author | James Taylor <user234683@users.noreply.github.com> | 2021-02-25 19:56:09 -0800 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2021-02-26 11:50:03 -0500 |
commit | 889dabb11276b7db3f7e580259f92b60d25b3efe (patch) | |
tree | 2b84f77e160330ee809674f0bcfb3e66834a6331 /youtube/proto.py | |
parent | d604a007a91c9e79206495a406499370082e0b62 (diff) | |
download | yt-local-889dabb11276b7db3f7e580259f92b60d25b3efe.tar.lz yt-local-889dabb11276b7db3f7e580259f92b60d25b3efe.tar.xz yt-local-889dabb11276b7db3f7e580259f92b60d25b3efe.zip |
proto.py: Fix base64 encoding in make_protobuf
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>
Diffstat (limited to 'youtube/proto.py')
-rw-r--r-- | youtube/proto.py | 4 |
1 files 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: |