3 ms·
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 essent
by 22c 5y ago
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.py https://github.com/yt-dlp/yt-dlp/blob/master/yt_dlp/cookies....
- vxNsr 5y agoIt’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.
- Scaevolus 5y agoI've used pycookiecheat successfully with Chrome on Ubuntu: https://pypi.org/project/pycookiecheat/ 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')
- c6401 5y agoThere's https://github.com/richardpenman/browsercookie https://github.com/richardpenman/browsercookie. Also at least for firefox it's quite easy to implement in like 5 strings or so.