mirror of
https://github.com/soimort/you-get.git
synced 2025-01-24 05:55:02 +03:00
[common] if it's not moz_cookies, pass
This commit is contained in:
parent
ede432659c
commit
67a6b9bc45
@ -936,18 +936,23 @@ def script_main(script_name, download, download_playlist = None):
|
||||
cookies = cookiejar.MozillaCookieJar()
|
||||
con = sqlite3.connect(a)
|
||||
cur = con.cursor()
|
||||
cur.execute("SELECT host, path, isSecure, expiry, name, value FROM moz_cookies")
|
||||
for item in cur.fetchall():
|
||||
c = cookiejar.Cookie(0, item[4], item[5],
|
||||
None, False,
|
||||
item[0],
|
||||
item[0].startswith('.'),
|
||||
item[0].startswith('.'),
|
||||
item[1], False,
|
||||
item[2],
|
||||
item[3], item[3]=="",
|
||||
None, None, {})
|
||||
cookies.set_cookie(c)
|
||||
try:
|
||||
cur.execute("SELECT host, path, isSecure, expiry, name, value FROM moz_cookies")
|
||||
for item in cur.fetchall():
|
||||
c = cookiejar.Cookie(0, item[4], item[5],
|
||||
None, False,
|
||||
item[0],
|
||||
item[0].startswith('.'),
|
||||
item[0].startswith('.'),
|
||||
item[1], False,
|
||||
item[2],
|
||||
item[3], item[3]=="",
|
||||
None, None, {})
|
||||
cookies.set_cookie(c)
|
||||
except: pass
|
||||
# TODO: Chromium Cookies
|
||||
# SELECT host_key, path, secure, expires_utc, name, encrypted_value FROM cookies
|
||||
# http://n8henrie.com/2013/11/use-chromes-cookies-for-easier-downloading-with-python-requests/
|
||||
|
||||
elif o in ('-l', '--playlist'):
|
||||
playlist = True
|
||||
|
Loading…
Reference in New Issue
Block a user