class TestIntegration(unittest.TestCase):
    def setUp(self):
        self.api = MetaApi()

    @skip_if_no_creds
    def test_login(self):
        self.api.login(username=CRUNCHYROLL_USERNAME, password=CRUNCHYROLL_PASSWORD)

    def test_login_fail(self):
        with self.assertRaises(ApiLoginFailure):
            self.api.login(username='******', password='******')

    def test_search(self):
        self._series = self.api.search_anime_series('Space Brothers')[0]
        self.assertEqual('Space Brothers', self._series.name)

    def test_list_media(self):
        self._media = self.api.list_media(self._series)
        self.assertEqual(99, len([ep for ep in self._media if not ep.clip]))
        self.assertEqual('Life Changes, Promises Don\'t')
예제 #2
0
class TestIntegration(unittest.TestCase):
    def setUp(self):
        self.api = MetaApi()

    @skip_if_no_creds
    def test_login(self):
        self.api.login(username=CRUNCHYROLL_USERNAME, password=CRUNCHYROLL_PASSWORD)

    def test_login_fail(self):
        with self.assertRaises(ApiLoginFailure):
            self.api.login(username='******', password='******')

    def test_anime_search(self):
        self._series = self.api.search_anime_series('Space Brothers')[0]
        self.assertEqual('Space Brothers', self._series.name)

    def test_list_media(self):
        self._series = self.api.search_anime_series('Space Brothers')[0]
        self._media = self.api.list_media(self._series)
        self.assertEqual(99, len([ep for ep in self._media if not ep.clip]))
        self.assertEqual('Life Changes, Promises Don\'t', self._media[0].name)
class TestIntegration(unittest.TestCase):
    def setUp(self):
        self.api = MetaApi()

    @skip_if_no_creds
    def test_login(self):
        self.api.login(username=CRUNCHYROLL_USERNAME, password=CRUNCHYROLL_PASSWORD)

    def test_login_fail(self):
        with self.assertRaises(ApiLoginFailure):
            self.api.login(username='******', password='******')

    def test_anime_search(self):
        self._series = self.api.search_anime_series('Space Brothers')[0]
        self.assertEqual('Space Brothers', self._series.name)

    def test_list_media(self):
        self._series = self.api.search_anime_series('Space Brothers')[0]
        self._media = self.api.list_media(self._series)
        self.assertEqual(99, len([ep for ep in self._media if not ep.clip]))
        self.assertEqual('Life Changes, Promises Don\'t', self._media[0].name)

    @skip_if_no_creds
    def test_subtitle_decryption(self):
        self.api.login(username=CRUNCHYROLL_USERNAME, password=CRUNCHYROLL_PASSWORD)
        series = self.api.search_anime_series('Space Brothers')[0]
        media = self.api.list_media(series)
        ep = [e for e in media if e.episode_number == '40'][0]

        stream = self.api.get_media_stream(ep, 0, 0)
        subs = stream.default_subtitles.decrypt().get_ass_formatted()
        self.assertIn('Hibito, let me see your back', subs)
예제 #4
0
"Specify indices of the videos in the playlist separated by commas like: "1,2,5,8" if you want to download videos indexed 1, 2, 5, 8 in the playlist.
You can specify range: "1-3,7,10-13", it will download the videos at index 1, 2, 3, 7, 10, 11, 12 and 13."
''')
        quit()
    else:
        print("Unrecognised argument \"" + argumentItem + "\"")
        print("Use \"--help\" to see all availiable arguemnts.")
        quit()

#User Authentication
if doLoginOrNot == True:
    while crunchyrollLoginAttempt == False:  #Asks user for Crunchyroll credentials and passes these to api so user can be authenticated
        CRUsername = input("Crunchyroll Username: "******"Crunchyroll Password: "******"Login Error\n\nTry again to login")
        else:
            print("Login Success")
            crunchyrollLoginAttempt = True
else:
    print(
        "User not authorized. To gain premium user benefits launch with command line \"--auth\"\n"
    )

if queueArgument == True:
    if crunchyrollLoginAttempt == True:
        userQueue = crunchyrollMetaAPI.list_queue()
        print("\nQueue Items:")
예제 #5
0
from crunchyroll.apis.meta import MetaApi
from crunchyroll.constants import META
api = MetaApi()
api.login(username=input("Crunchyroll username:\n"),password=input("\nCrunchyroll password:\n"))
queue=api.list_queue(media_types=[META.TYPE_ANIME])
for anime in queue:
    #add anime to mal
    pass