Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: a bytes-like object is required, not 'str' #116

Open
bluephx4 opened this issue Mar 31, 2020 · 1 comment
Open

TypeError: a bytes-like object is required, not 'str' #116

bluephx4 opened this issue Mar 31, 2020 · 1 comment

Comments

@bluephx4
Copy link

I am able to download individual shows but when it comes to full series it throws an error.

C:\Users\mkark\Documents\Python\ffmpeg-4.2.2-win64-static\bin>main.py -i "https://www.crunchyroll.com/i-cant-understand-what-my-husband-is-saying" -u "$USERNAME" -p "$PASSWORD" -r "1080p"
Trying to login...
Logged in successfully...
Traceback (most recent call last):
File "C:\Users\mkark\Documents\Python\anime-dl-master\anime_dl_main_.py", line 22, in
class Main():
File "C:\Users\mkark\Documents\Python\anime-dl-master\anime_dl_main_.py", line 82, in Main
logger=logger, episode_range=args.range, output=args.output)
File "C:\Users\mkark\Documents\Python\anime-dl-master\anime_dl\Anime_dl.py", line 30, in init
skipper=skipper, logger=logger, episode_range=episode_range, output=output)
File "C:\Users\mkark\Documents\Python\anime-dl-master\anime_dl\sites\crunchyroll.py", line 44, in init
self.whole_show(url=url, cookie=cookies, token=token, language=language, resolution=resolution, skipper=skipper, episode_range=episode_range, output=output)
File "C:\Users\mkark\Documents\Python\anime-dl-master\anime_dl\sites\crunchyroll.py", line 127, in whole_show
dub_list, ep_sub_list = self.episode_list_extractor(page_source=page_source, url=url)
File "C:\Users\mkark\Documents\Python\anime-dl-master\anime_dl\sites\crunchyroll.py", line 185, in episode_list_extractor
if "(Dub)" in u' '.join(title_value).encode('utf-8').strip():
TypeError: a bytes-like object is required, not 'str'

Error Log

DEBUG: You have successfully set the Debugging On.
DEBUG: Arguments Provided : Namespace(input=['https://www.crunchyroll.com/i-cant-understand-what-my-husband-is-saying'], language='Japanese', output=None, password=['$PASWWORD'], range='All', resolution=['1080p'], skip=False, username=['$USERNAME'], verbose=True, version=False)
DEBUG: Operating System : Windows - 10 - 10.0.18362
DEBUG: Python Version : 3.7.5 (64bit)
DEBUG: Starting new HTTPS connection (1): www.crunchyroll.com:443
DEBUG: https://www.crunchyroll.com:443 "GET /login HTTP/1.1" 200 None
DEBUG: https://www.crunchyroll.com:443 "POST /login HTTP/1.1" 302 None
DEBUG: https://www.crunchyroll.com:443 "GET / HTTP/1.1" 200 None
DEBUG: Starting new HTTPS connection (1): www.crunchyroll.com:443
DEBUG: https://www.crunchyroll.com:443 "GET /i-cant-understand-what-my-husband-is-saying HTTP/1.1" 200 None

@bluephx4
Copy link
Author

Found resolution in another issue. Issue #109

Epic Unknown statement
{
I sure did! It's a very simple fix and I apologize for not posting about it earlier.
So the script SHOULD check if "title_value" is a byte like object or a regular string.

Because it is needed to be a byte like object for the anime you are downloading, simply make "(Dub)" now b'Dub' and yes that b needs to be in front of the single quotes, not inside.

Quick Edit: Line 185 of crunchyroll.py inside the sites folder ;) sorry

Happy coding and let me know if it fixes it for you! :)
}

After changing that the script runs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant