Last updated:
0 purchases
crunchyroll 1.0.1
python-crunchyroll==================Python interface to Crunchyroll's undocumented APIs and utilitiesfor working with the returned data. Eventual plan is to create a betterXMBC plugin.### Requirements * Python 2.6+ * requests * tlslite### UsagePretty much anything of interest is available now, including the RTMPE streamdata and decrypted and formatted subtitles.Example usage:~~~~>>> from crunchyroll.apis.meta import MetaApi>>> api = MetaApi()>>> pprint([s.name for s in api.list_anime_series(limit=5)])[u'07 Ghost', u'11eyes', u'A Bridge to the Starry Skies - Hoshizora e Kakaru Hashi', u'A Dark Rabbit has Seven Lives', u'Abunai Sisters']>>> space_brothers = api.search_anime_series('Space Brothers')[0]>>> pprint(space_brothers.description)u'To follow his brother Hibito to the moon, Mutta will attempt to become anastronaut at the age of 32. Unaware of his own talent, Mutta chases hisdreams to get back in front of his younger brother.'>>> sb_episodes = api.list_media(space_brothers)>>> len(sb_episodes)49>>> ep = [e for e in sb_episodes if e.episode_number == '40'][0]>>> print ep.episode_number, ep.name, ep.free_available40 Heaven and Hell True>>> api.login(username=username, password=password)True>>> stream = api.get_media_stream(ep)>>> subs = stream.default_subtitles.decrypt().get_ass_formatted()>>> print '\n'.join(subs.split('\n')[:9])[Script Info]Title: English (US)ScriptType: v4.00+WrapStyle: 0PlayRexX: 704PlayResY: 400Subtitle ID: XXXXXLanguage: English (US)Created: 28 days ago>>> [s.language for s in stream.subtitle_stubs]['English (US)', u'Espa\xf1ol', u'Fran\xe7ais (France)', u'Portugu\xeas (Brasil)']>>> fr_subs = api.unfold_subtitle_stub(stream.subtitle_stubs[2]).decrypt().get_srt_formatted()>>> print '\n'.join(fr_subs.split('\n')[:11])100:00:00,760 --> 00:00:02,940Tiens ? Ça ne s'ouvre pas.200:00:04,500 --> 00:00:06,770Tourne le levier vers la gauche.300:00:07,360 --> 00:00:10,150Lequel ?~~~~### TestingRun the unit tests with: $ python setup.py testNote that some of the unit tests will use a CR account which should be madeavailable in the `CRUNCHYROLL_USERNAME` and `CRUNCHYROLL_PASSWORD` environmentvariables.### LICENSEThis project is licensed under GPLv2+, see LICENSE for more details.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.