aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/accounts.py
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2018-12-26 20:07:10 -0800
committerJames Taylor <user234683@users.noreply.github.com>2018-12-26 20:07:10 -0800
commit1cb0095536b1263da82282f23476bc28a13e1995 (patch)
treeb4c5b352c4ee72929689527cf88086bcd452b929 /youtube/accounts.py
parentfcbd8ebef6f4b3648f9b04cb8b7788fed4aeb719 (diff)
downloadyt-local-1cb0095536b1263da82282f23476bc28a13e1995.tar.lz
yt-local-1cb0095536b1263da82282f23476bc28a13e1995.tar.xz
yt-local-1cb0095536b1263da82282f23476bc28a13e1995.zip
Fix cookiejar_from_lwp function
Diffstat (limited to 'youtube/accounts.py')
-rw-r--r--youtube/accounts.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/youtube/accounts.py b/youtube/accounts.py
index 6959fb2..7bb5ec5 100644
--- a/youtube/accounts.py
+++ b/youtube/accounts.py
@@ -37,10 +37,11 @@ def add_account(username, password, save):
return successful
def cookiejar_from_lwp_str(lwp_str):
+ lwp_str = "#LWP-Cookies-2.0\n" + lwp_str # header required by _really_load for reading from "file"
cookiejar = http.cookiejar.LWPCookieJar()
# HACK: cookiejar module insists on using filenames and reading files for you,
# so present a StringIO to this internal method which takes a filelike object
- cookiejar._really_load(self, io.StringIO(lwp_str), "", False, False)
+ cookiejar._really_load(io.StringIO(lwp_str), "", False, False)
return cookiejar
def account_cookiejar(username):