Skip to content

Commit

Permalink
Fix For #31
Browse files Browse the repository at this point in the history
Fixes #31
  • Loading branch information
Xonshiz committed Jan 21, 2018
1 parent a8623f8 commit fcb44c3
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@
- Fix for #17 and #22 [2017.12.27]
- Fix for #17 and #26 [2017.12.27]
- PEP8 Cleaning [2018.01.02]
- Fix for #18 [2018.01.02]
- Fix for #18 [2018.01.02]
- Fix for #31 [2018.01.21]
2 changes: 1 addition & 1 deletion anime_dl/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ class main():
if type(args.range) == list:
args.range = args.range[0]

AnimeDL(url=args.input, username=str(args.username), password=str(args.password),
AnimeDL(url=args.input, username=args.username, password=args.password,
resolution=args.resolution, language=args.language, skipper=skipper,
logger=logger, episode_range=args.range)
1 change: 1 addition & 0 deletions anime_dl/animeName.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
class animeName(object):

def nameEdit(self, animeName, episodeNumber, resolution):
animeName = str(animeName).replace("039T", "'")
rawName = str(animeName).title().strip().replace("Season ", "S") + " - " +\
str(episodeNumber).strip() + " [" + str(resolution) + "]"
file_name = str(re.sub(r'[^A-Za-z0-9\ \-\' \\]+', '', str(animeName))).title().strip().replace("Season ", "S")\
Expand Down
21 changes: 19 additions & 2 deletions anime_dl/sites/crunchyroll.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@

class CrunchyRoll(object):
def __init__(self, url, password, username, resolution, language, skipper, logger, episode_range):
# print("Username : {0}".format(username))
# print("Type Username : {0}".format(type(username)))
# print("Type Username : {0}".format(type(password)))
# print("Password : {0}".format(password))
if logger == "True":
logging.basicConfig(format='%(levelname)s: %(message)s', filename="Error Log.log", level=logging.DEBUG,
encoding="utf-8")
Expand Down Expand Up @@ -96,6 +100,9 @@ def webpagedownloader(self, url, username, password):
headers=headers,
cookies=initial_cookies)

# with open("login_source.html", "w") as wf:
# wf.write(login_post.text.encode('utf-8'))

if self.login_check(htmlsource=login_post.text.encode('utf-8')):
print("Logged in successfully...")
resp = sess.get(
Expand Down Expand Up @@ -349,6 +356,8 @@ def wholeShow(self, url, cookie, token, language, resolution, skipper, episode_r
sess = requests.session()
sess = cfscrape.create_scraper(sess)
page_source = sess.get(url=url, headers=headers, cookies=cookie).text.encode("utf-8")
# with open("New_way.html", "w") as wf:
# wf.write(page_source)

dub_list = []
ep_sub_list = []
Expand Down Expand Up @@ -396,7 +405,11 @@ def wholeShow(self, url, cookie, token, language, resolution, skipper, episode_r
for episode_url in dub_list[::-1]:
# cookies, Token = self.webpagedownloader(url=url)
# print("Dub list : %s" % dub_list)
self.singleEpisode(url=episode_url, cookies=cookie, token=token, resolution=resolution)
try:
self.singleEpisode(url=episode_url, cookies=cookie, token=token, resolution=resolution)
except Exception as SomeError:
print("Error Downloading : {0}".format(SomeError))
pass
print("-----------------------------------------------------------")
print("\n")
else:
Expand All @@ -405,7 +418,11 @@ def wholeShow(self, url, cookie, token, language, resolution, skipper, episode_r
for episode_url in sub_list[::-1]:
# cookies, Token = self.webpagedownloader(url=url)
# print("Sub list : %s" % sub_list)
self.singleEpisode(url=episode_url, cookies=cookie, token=token, resolution=resolution)
try:
self.singleEpisode(url=episode_url, cookies=cookie, token=token, resolution=resolution)
except Exception as SomeError:
print("Error Downloading : {0}".format(SomeError))
pass
print("-----------------------------------------------------------")
print("\n")

Expand Down
3 changes: 2 additions & 1 deletion docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@
- Fix for #17 and #22 [2017.12.27]
- Fix for #17 and #26 [2017.12.27]
- PEP8 Cleaning [2018.01.02]
- Fix for #18 [2018.01.02]
- Fix for #18 [2018.01.02]
- Fix for #31 [2018.01.21]

0 comments on commit fcb44c3

Please sign in to comment.