sys.exit(1)
# find cookie file
-try:
- cookiefile = glob.glob(os.path.expanduser('~/.mozilla/*/*/cookies.txt'))[0]
-except IndexError:
- print >> sys.stderr, 'Could not find Firefox cookie file'
- sys.exit(1)
+cookiefile = os.path.expanduser('~/.lpcookie')
+if not os.path.exists(cookiefile):
+ try:
+ cookiefile = glob.glob(os.path.expanduser('~/.mozilla/*/*/cookies.txt'))[0]
+ except IndexError:
+ print >> sys.stderr, 'Could not find Firefox cookie file'
+ sys.exit(1)
# build HTML opener with cookie file
cj = cookielib.MozillaCookieJar()