Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I was recently looking for a library that did this and couldn't find anything nice. I was surprised but also slightly disappointed to see that yt-dlp has essentially rolled their own (cookies.py [1]).

[1] https://github.com/yt-dlp/yt-dlp/blob/master/yt_dlp/cookies....



I've used pycookiecheat successfully with Chrome on Ubuntu: https://pypi.org/project/pycookiecheat/

    chr_cookies = pycookiecheat.chrome_cookies('https://example.com')
    session = requests.Session()
    for k, v in cookies.items():
        session.cookies.set(k, v, domain='.example.com')


It’s open source so you could theoretically pull it out and generalize it… idk if anyone wants to manage that project (seems like a ton of work even for an open source project) but I’m sure it be interesting.


There's https://github.com/richardpenman/browsercookie. Also at least for firefox it's quite easy to implement in like 5 strings or so.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: