add --cookies argument to read cookies from file #31

wants to merge 7 commits into


None yet
2 participants


Thanks for writing such a handy script, I didn't know about pyobjc until I saw webkit2png, and it's very cool! I added a command line switch to pass in a cookie file, which is parsed with cookielib and urllib2.

As an example, I use this Chrome Extension to copy out my cookies:

And then I can use the cookies right off my pasteboard:

./webkit2png --cookies <(pbpaste)

RSully commented Jun 17, 2013

👍 I would love a way to send cookies along with a request. Hope to see this (or similar) merged in.

Alex added some commits Aug 16, 2012

Alex set a single cookie
Use NSMutableURLRequest rather than NSURLRequest, and call
Alex add --cookies argument
This specifies a Netscape cookie filename to read from.
Alex read cookies from a file 1ddc935
Alex change cookie handling to use urllib2 and cookielib 9328a14
Alex use a tempfile to guarantee magic string is present
cookielib won't even *look* at the rest of a cookie file unless the
first line matches:
    magic_re = "#( Netscape)? HTTP Cookie File"
Alex commenting and function name cleanup 75cca0d
Alex change indent from 2 to 4 c5a4f69

recreated as #47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment