Skip to content

Instantly share code, notes, and snippets.

@kaithar
Created August 7, 2017 07:32
Show Gist options
  • Save kaithar/b1d40027bcdbc60314f8e8ecb3ea1ae2 to your computer and use it in GitHub Desktop.
Save kaithar/b1d40027bcdbc60314f8e8ecb3ea1ae2 to your computer and use it in GitHub Desktop.
Cloudflare is a lovely thing when I'm not trying to work around it...
import cfscrape
import http.cookiejar
scraper = cfscrape.create_scraper()
try:
import config
scraper.headers["User-Agent"] = config.UA
except:
# Oh well
pass
scraper.get("https://www.crunchyroll.com/login")
print(scraper.cookies)
#print(r.content)
cj = http.cookiejar.MozillaCookieJar('cookies.txt')
for c in scraper.cookies:
cj.set_cookie(c)
print(cj)
print(scraper.headers["User-Agent"])
cj.save('cookies.txt', True, True)
@Bunchy88
Copy link

Bunchy88 commented Oct 7, 2017

hello, thanks for your script, but i can not load 1080p videos.
How can I download 1080p videos?

@inks007
Copy link

inks007 commented Oct 27, 2017

Hi Kaithar,

Thank you for the cookie script.
I forked and modified it to post login credentials to crunchyroll and retrieve the logged in cookie.
My python knowledge is rudimentary - perhaps you could update your scripts my edits with cleaner code.

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