chrippa / livestreamer

Command-line utility that extracts streams from various services and pipes them into a video player of choice. No longer maintained, use streamlink or youtube-dl instead.
http://livestreamer.io/
BSD 2-Clause "Simplified" License
3.88k stars 582 forks source link

Crunchyroll plugin #696

Open iplaywithdrums opened 9 years ago

iplaywithdrums commented 9 years ago

Hello.

Whether I try to do "livestreamer (some URL from crunchyroll) best" after putting in crunchyroll-username and crunchyroll-password into the config file, or if I put down "livestreamer --crunchyroll-username XXX --crunchyroll-password XXX (url from crunchyroll) best", I get the same error message:

error: Unable to validate API response: Unable to validate key 'user': Unable to validate key 'username': Type of None should be 'basestring' but is 'NoneType'.

I'm using Windows. I probably did something stupid.

Thanks in advance.

chrippa commented 9 years ago

Does passing --crunchyroll-purge-credentials help?

iplaywithdrums commented 9 years ago

No. It gives me:

error: Authentication error: Unauthenticated request

zJoul commented 9 years ago

What does your config file look like ? Does it have an unknown key value ? Do you use the crunchyroll.com domain or an other tld (like fr, co.uk, es...) ? Maybe your end of line in your config file is messed up.

iplaywithdrums commented 9 years ago

player=D:\Program Files (x86)\DAUM\PotPlayer\PotPlayerMini.exe crunchyroll-username=username crunchyroll-password=password

I use the crunchyroll.com domain.

zJoul commented 9 years ago

Have you tried to put the player path between quotes ?

iplaywithdrums commented 9 years ago

No, but livestreamer works with other sites, like twitch, as set up.

zJoul commented 9 years ago

I guess you don't have some specials characters in your username / password. If so, you need to escape them.

Do you use the --player-continuous-http option since it seems to be required by Pot Player ?

What it says if you append --loglevel debug in the command line ?

iplaywithdrums commented 9 years ago

No special characters.

No, I don't use the continuous http option, but it doesn't seem to affect playback on twitch.

This is what I get when I append --loglevel debug:

[plugin.crunchyroll][debug] Creating session [plugin.crunchyroll][debug] Session created [plugin.crunchyroll][info] Attempting to login using username and password error: Unable to validate API response: Unable to validate key 'user': Unable to validate key 'username': Type of None should be 'basestring' but is 'NoneType'

alsanchez commented 9 years ago

Try setting an username for your account at https://www.crunchyroll.com/acct?action=emailpw

This is the response you get from CR if the account lacks an username:

[plugin.crunchyroll][info] Attempting to login using username and password
{'code': 'ok', 'data': {'expires': '2015-06-09T05:21:28-07:00', 'user': {'last_name': '', 'username': None, 'email': '<redacted>', 'first_name': '', 'class': 'user', 'is_publisher': False, 'created': '2014-10-29T16:14:43-07:00', 'user_id': '<redacted>', 'premium': 'anime|drama|manga'}, 'auth': '<redacted>'}, 'error': False}
error: Unable to validate API response: Unable to validate key 'user': Unable to validate key 'username': Type of None should be 'str' but is 'NoneType'
sammy8806 commented 8 years ago

Yep, that worked ;-)

Probably some error-handling or better typechecking for "NoneType" within the validators used here: src/livestreamer/plugins/crunchyroll.py#L81