Compare commits
6 Commits
ff28568052
...
d40f0ca11b
Author | SHA1 | Date |
---|---|---|
Dhruv Kanojia (Xonshiz) | d40f0ca11b | |
Luis Amorim | 256f082ce0 | |
Xonshiz | f17350d835 | |
Dhruv Kanojia (Xonshiz) | 0a0b864540 | |
_iEpic | 7be1991f48 | |
Dhruv Kanojia (Xonshiz) | 8f9b2fa0f1 |
|
@ -89,13 +89,13 @@ def login_crunchyroll(url, username, password, country):
|
|||
def login_check(html_source, cookies=None):
|
||||
# Open the page and check the title. CrunchyRoll redirects the user and the title has the text "Redirecting...".
|
||||
# If this is not found, you're probably not logged in and you'll just get 360p or 480p.
|
||||
if "href=\"/logout\"" in html_source:
|
||||
if b'href="/logout"' in html_source:
|
||||
return True, cookies
|
||||
else:
|
||||
print("Let me check again...")
|
||||
second_try_response, html_source, cookies = page_downloader(url="https://www.crunchyroll.com/", cookies=cookies)
|
||||
if second_try_response:
|
||||
if "href=\"/logout\"" in html_source:
|
||||
if b'href=\"/logout\"' in html_source:
|
||||
return True, cookies
|
||||
else:
|
||||
return False, cookies
|
||||
|
|
|
@ -9,7 +9,7 @@ import os
|
|||
import subprocess
|
||||
from glob import glob
|
||||
from shutil import move
|
||||
|
||||
from sys import exit
|
||||
|
||||
class Crunchyroll(object):
|
||||
def __init__(self, url, password, username, resolution, language, skipper, logger, episode_range, output):
|
||||
|
@ -206,7 +206,7 @@ class Crunchyroll(object):
|
|||
|
||||
def episode_information_extractor(self, page_source, resolution_to_find):
|
||||
anime_name = re.sub(r'[^A-Za-z0-9\ \-\' \\]+', '', str(re.search(r'<series_title>(.*?)</series_title>', page_source).group(1))).title().strip()
|
||||
episode_number = re.search(r'<episode_number>(.*?)</episode_number>', page_source.decode("utf-8")).group(1)
|
||||
episode_number = re.search(r'<episode_number>(.*?)</episode_number>', page_source).group(1)
|
||||
video_width, video_height = resolution_to_find.split("x")
|
||||
video_resolution = str(video_width) + "x" + str(video_height)
|
||||
|
||||
|
|
Loading…
Reference in New Issue