Created
August 7, 2017 07:32
-
-
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...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
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
hello, thanks for your script, but i can not load 1080p videos.
How can I download 1080p videos?