From df65566e2fe7061787cd4d5af2a114885f0f84ca Mon Sep 17 00:00:00 2001 From: Lim Nicolas Date: Sat, 26 Jan 2019 16:29:11 +0100 Subject: [PATCH] Fix for python 2.7 --- anime_dl/sites/crunchyroll.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/anime_dl/sites/crunchyroll.py b/anime_dl/sites/crunchyroll.py index 96c1902..d2b1200 100644 --- a/anime_dl/sites/crunchyroll.py +++ b/anime_dl/sites/crunchyroll.py @@ -196,13 +196,13 @@ def singleEpisode(self, url, cookies, token, resolution): xml_page = xml_page_connect.text.encode("utf-8") try: - m3u8_file_link = str(re.search(r'(.*?)', xml_page.decode("utf-8")).group(1)).replace("&", "&") + m3u8_file_link = str(re.search(r'(.*?)', xml_page).group(1)).replace("&", "&") logging.debug("m3u8_file_link : %s", m3u8_file_link) if not m3u8_file_link: # If no m3u8 found, try the rtmpdump... try: - host_link = re.search(r'(.*?)', xml_page.decode("utf-8")).group(1) + host_link = re.search(r'(.*?)', xml_page).group(1) logging.debug("Found RTMP DUMP!") print("RTMP streams not supported currently...") except Exception as NoRtmpDump: @@ -210,7 +210,7 @@ def singleEpisode(self, url, cookies, token, resolution): print(NoRtmpDump) else: anime_name = re.sub(r'[^A-Za-z0-9\ \-\' \\]+', '', str( - re.search(r'(.*?)', xml_page.decode("utf-8")).group(1))).title().strip() + re.search(r'(.*?)', xml_page).group(1))).title().strip() episode_number = re.search(r'(.*?)', xml_page.decode("utf-8")).group(1) video_width = re.search(r'(.*?)', xml_page.decode("utf-8")).group(1) @@ -241,7 +241,7 @@ def singleEpisode(self, url, cookies, token, resolution): pass else: self.subFetcher( - xml=str(xml_page.decode("utf-8")), + xml=str(xml_page), episode_number=episode_number, file_name=file_name) @@ -527,9 +527,9 @@ def onlySubs(self, url, cookies): video_id, url) xml_page = sess.get(url=infoURL, headers=headers, cookies=cookies).text.encode("utf-8") - # anime_name = re.search(r'(.*?)', xml_page.decode("utf-8")).group(1) + # anime_name = re.search(r'(.*?)', xml_page).group(1) anime_name = re.sub(r'[^A-Za-z0-9\ \-\' \\]+', '', - str(re.search(r'(.*?)', xml_page.decode("utf-8")).group(1))).title().strip() + str(re.search(r'(.*?)', xml_page).group(1))).title().strip() episode_number = re.search(r'(.*?)', xml_page.decode("utf-8")).group(1) video_width = re.search(r'(.*?)', xml_page.decode("utf-8")).group(1) @@ -548,7 +548,7 @@ def onlySubs(self, url, cookies): if not os.path.exists(output_directory): os.makedirs(output_directory) - self.subFetcher(xml=xml_page.decode('utf-8'), episode_number=episode_number, file_name=file_name) + self.subFetcher(xml=xml_page, episode_number=episode_number, file_name=file_name) for sub_file in glob("*.ass"): try: