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

NoneType' object has no attribute 'group #109

Open
Thedarklife74 opened this issue Dec 26, 2019 · 27 comments
Open

NoneType' object has no attribute 'group #109

Thedarklife74 opened this issue Dec 26, 2019 · 27 comments

Comments

@Thedarklife74
Copy link

Thedarklife74 commented Dec 26, 2019

Hi i've got this problem today

Trying to login...
Logged in successfully...
Seems like this video isn't available...
'NoneType' object has no attribute 'group'

My account is okay and the video exist

@Thedarklife74
Copy link
Author

Trying to login...
Logged in successfully...
Traceback (most recent call last):
File "anime_dl_main_.py", line 16, in
File "anime_dl_main_.py", line 73, in Main
File "anime_dl\Anime_dl.py", line 30, in init
File "anime_dl\sites\crunchyroll.py", line 42, in init
File "anime_dl\sites\crunchyroll.py", line 65, in single_episode
File "anime_dl\sites\crunchyroll.py", line 425, in m3u8_finder
AttributeError: 'NoneType' object has no attribute 'group'
[15980] Failed to execute script main

@Thedarklife74
Copy link
Author

Any Workaround ? Still not working

@iiEpic
Copy link
Contributor

iiEpic commented Jan 2, 2020

What are you trying to download exactly?
Please paste the actual command you are typing in please.

Please remove your email and password before doing so!

@Thedarklife74
Copy link
Author

Thedarklife74 commented Jan 2, 2020

What are you trying to download exactly?
Please paste the actual command you are typing in please.

Please remove your email and password before doing so!

@echo off
set /p lien= Enter link :
echo %lien%
pause
anime-dl.exe -i "%lien%" -u "user" -p "password" -r "720" -v
pause

I precise i always use that for years now and i don't work anymore since 6days. I think it's more a backend change from Crunchyroll who cause the problem.

@iiEpic
Copy link
Contributor

iiEpic commented Jan 2, 2020

I'm using it and I'm not having a problem atm.
What anime are you trying to download?

@Thedarklife74
Copy link
Author

Thedarklife74 commented Jan 2, 2020

I'm using it and I'm not having a problem atm.
What anime are you trying to download?

Nothing precize, i try multiple episode on Crunchyroll and it doing the same error

I have the very last update of the script and Binaries

@iiEpic
Copy link
Contributor

iiEpic commented Jan 2, 2020

I just did
"./main.py -i https://www.crunchyroll.com/welcome-to-demon-school-iruma-kun -u me -p pass -r 480 -o /home/anime/myshow/"

It downloaded my videos fine. Are you sure you got everything updated? Just curious is all.

@Thedarklife74
Copy link
Author

I just did
"./main.py -i https://www.crunchyroll.com/welcome-to-demon-school-iruma-kun -u me -p pass -r 480 -o /home/anime/myshow/

It downloaded my videos fine. Are you sure you got everything updated? Just curious is all.

I tried it work only with no premium episodes. BUT my account is okay and subscribed ( I can read premium video on the website)

@iiEpic
Copy link
Contributor

iiEpic commented Jan 2, 2020

Wait a second.. I just realized you're using windows.. My apologies. I have not a clue what your error could be then.. Let me do some looking because I use Linux to do my dirty work.

@iiEpic
Copy link
Contributor

iiEpic commented Jan 2, 2020

I'm pretty sure the anime_dl.exe is out dated...

@Thedarklife74
Copy link
Author

I'm pretty sure the anime_dl.exe is out dated...

Mine is dating from January 2019, I try with the last one on the projet and is not even able to login so ...

@iiEpic
Copy link
Contributor

iiEpic commented Jan 2, 2020

It's the anime_dl.exe. Give me a minute to compile a new one and I'll post it here for you.

@iiEpic
Copy link
Contributor

iiEpic commented Jan 2, 2020

I've compiled it multiple times with the newest stuff and it's just not working.. I think I know what the issue is so I'll see if I can fix it but below is the issue I'm getting.

Traceback (most recent call last): File "anime_dl\__main__.py", line 22, in <module> class Main(): File "anime_dl\__main__.py", line 82, in Main logger=logger, episode_range=args.range, output=args.output) File "anime_dl\Anime_dl.py", line 30, in __init__ skipper=skipper, logger=logger, episode_range=episode_range, output=output) File "anime_dl\sites\crunchyroll.py", line 36, in __init__ File "anime_dl\common\browser_instance.py", line 76, in login_crunchyroll File "anime_dl\common\browser_instance.py", line 92, in login_check TypeError: a bytes-like object is required, not 'str' [26508] Failed to execute script __main__

@iiEpic
Copy link
Contributor

iiEpic commented Jan 2, 2020

Fixed-2020-01-01.zip
Here is a temp fix, it worked for me on my Windows Machine. Let me know if it works for you!
@Thedarklife74

iiEpic added a commit to iiEpic/anime-dl that referenced this issue Jan 2, 2020
- Removed ".decode" on line 209 in file crunchyroll.py
- Added " b' " on line 98 in file browser_instance.py
@Thedarklife74
Copy link
Author

Fixed-2020-01-01.zip
Here is a temp fix, it worked for me on my Windows Machine. Let me know if it works for you!
@Thedarklife74

Same problem.

Trying to login...
Let me check again...
Unable to Log you in. Check credentials again.
Failed Login!!!
Traceback (most recent call last):
File "anime_dl_main_.py", line 22, in
class Main():
File "anime_dl_main_.py", line 82, in Main
logger=logger, episode_range=args.range, output=args.output)
File "anime_dl\Anime_dl.py", line 30, in init
skipper=skipper, logger=logger, episode_range=episode_range, output=output)
File "anime_dl\sites\crunchyroll.py", line 49, in init
NameError: name 'exit' is not defined
[10672] Failed to execute script main

@Thedarklife74
Copy link
Author

@Xonshiz Any ideas ?

@Thedarklife74
Copy link
Author

I tried wit a complete fresh install with no .exe and use only python, here are the logs

Trying to login...
Traceback (most recent call last):
File "main.py", line 22, in
class Main():
File "main.py", line 80, in Main
AnimeDL(url=args.input, username=args.username, password=args.password,
File "anime_dl\Anime_dl.py", line 28, in init
sites.crunchyroll.Crunchyroll(
File "\anime_dl\sites\crunchyroll.py", line 33, in init
login_response, cookies, token = anime_dl.common.browser_instance.login_crunchyroll(url=url,
File "\anime_dl\common\browser_instance.py", line 76, in login_crunchyroll
login_check_response, login_cookies = login_check(html_source=login_post.text.encode('utf-8'), cookies=login_post.cookies)
File "\anime_dl\common\browser_instance.py", line 92, in login_check
if "href="/logout"" in html_source:
TypeError: a bytes-like object is required, not 'str'

And here the comand :

@echo off
set /p lien= Enter link :
pause
python main.py -i "%lien%" -u "user" -p "pass" -r "720" -v
pause

@axipher
Copy link

axipher commented Jan 3, 2020

What version of Python are you running, I can't remember if I was having issues with Python3 or Python2 not working with the current code base.

@Thedarklife74
Copy link
Author

What version of Python are you running, I can't remember if I was having issues with Python3 or Python2 not working with the current code base.

Python 3.8.0

@axipher
Copy link

axipher commented Jan 3, 2020

I just got home and checked quickly and an older copy of the anime-dl code I have only runs correctly using Python 2.7.17.

I don't have all the extras installed for Python3 like cfscrape and all the other pre-requiresites. I'm pretty sure this Linux box was rebuilt with only the working things I needed for a web-server and anime download server.

It might be a pain, but I would recommend trying Python 2.7.17. If that works, then awesome, otherwise I can't remember if 3.6 -> 3.7 > 3.8 have any differences that would affect the anime-dl Python code.

@iiEpic
Copy link
Contributor

iiEpic commented Jan 4, 2020

I have Python3.7 and I'm not having any problems at the moment with the current code I gave above. :(

@Thedarklife74
Copy link
Author

I have Python3.7 and I'm not having any problems at the moment with the current code I gave above. :(

Ok I uninstall Python 3.8 and install python 3.7

Official release of the scripti : Don't work (missing modules)
Release by @EpicUnknown : Work perfectly

Very weird problem because i have 2 computer where I've didn't change anything and the script stopping working one day so ..... quite weird

Xonshiz added a commit that referenced this issue Jan 5, 2020
@Thedarklife74
Copy link
Author

Thedarklife74 commented Jan 6, 2020

@EpicUnknown I donwload the update who @Xonshiz done and the exe you gave me doesn't work anymore ...

Trying to login...
Let me check again...
Unable to Log you in. Check credentials again.
Failed Login!!!
Traceback (most recent call last):
File "anime_dl_main_.py", line 22, in
class Main():
File "anime_dl_main_.py", line 82, in Main
logger=logger, episode_range=args.range, output=args.output)
File "anime_dl\Anime_dl.py", line 30, in init
skipper=skipper, logger=logger, episode_range=episode_range, output=output)
File "anime_dl\sites\crunchyroll.py", line 49, in init
NameError: name 'exit' is not defined
[14076] Failed to execute script main

@Thedarklife74
Copy link
Author

Thedarklife74 commented Jan 10, 2020

I still have the following problem with all last updates :

Trying to login...
Logged in successfully...
Traceback (most recent call last):
  File "anime_dl\__main__.py", line 16, in <module>
  File "anime_dl\__main__.py", line 73, in Main
  File "anime_dl\Anime_dl.py", line 30, in __init__
  File "anime_dl\sites\crunchyroll.py", line 42, in __init__
  File "anime_dl\sites\crunchyroll.py", line 65, in single_episode
  File "anime_dl\sites\crunchyroll.py", line 425, in m3u8_finder
AttributeError: 'NoneType' object has no attribute 'group'
[2560] Failed to execute script __main__

@iiEpic
Copy link
Contributor

iiEpic commented Jan 10, 2020

I'll check it out tonight but I didn't have any problems with my latest build and I even upgrading to Python 3.8. I'll reply again when I take a look.

@arbarbosa1979
Copy link

arbarbosa1979 commented Feb 7, 2020

@EpicUnknown Did you manage to find out something about this error??

Trying to login...
Logged in successfully...
Traceback (most recent call last):
  File "anime_dl\__main__.py", line 22, in <module>
    class Main():
  File "anime_dl\__main__.py", line 82, in Main
    logger=logger, episode_range=args.range, output=args.output)
  File "anime_dl\Anime_dl.py", line 30, in __init__
    skipper=skipper, logger=logger, episode_range=episode_range, output=output)
  File "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 "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 "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'
[7088] Failed to execute script __main__

@iiEpic
Copy link
Contributor

iiEpic commented Feb 9, 2020

@EpicUnknown Did you manage to find out something about this error??

Trying to login...
Logged in successfully...
Traceback (most recent call last):
  File "anime_dl\__main__.py", line 22, in <module>
    class Main():
  File "anime_dl\__main__.py", line 82, in Main
    logger=logger, episode_range=args.range, output=args.output)
  File "anime_dl\Anime_dl.py", line 30, in __init__
    skipper=skipper, logger=logger, episode_range=episode_range, output=output)
  File "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 "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 "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'
[7088] Failed to execute script __main__

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! :)

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

4 participants