Skip to content

Commit

Permalink
Merge branch 'nexus-staging'
Browse files Browse the repository at this point in the history
# Conflicts:
#	resources/lib/api.py
  • Loading branch information
smirgol committed Apr 3, 2024
2 parents 5c4ec5a + 222acb5 commit 04951fe
Show file tree
Hide file tree
Showing 18 changed files with 920 additions and 392 deletions.
3 changes: 2 additions & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.crunchyroll" name="Crunchyroll" version="3.3.0.13" provider-name="MrKrabat">
<addon id="plugin.video.crunchyroll" name="Crunchyroll" version="3.3.0.14" provider-name="MrKrabat">
<requires>
<import addon="xbmc.python" version="3.0.1"/>
<import addon="script.module.inputstreamhelper" version="0.3.3"/>
Expand All @@ -21,6 +21,7 @@
<disclaimer lang="de_DE">HINWEIS: Du MUSST PREMIUM Mitglied sein um dieses Plugin zu benutzen</disclaimer>
<disclaimer lang="es_ES">Atención: Necesitas ser miembro PREMIUM para utilizar este Plugin</disclaimer>
<news>
v3.3.0.14 (2023.01.16)[CR]- update auth, add new routing, async data fetching, updated language settings, improved bookmarking/favourite support
v3.3.0.13 (2023.01.05)[CR]- improve listing, add crunchylists
v3.3.0.12 (2023.12.30)[CR]- add resume watching, update settings, add skip intro
v3.3.0.11 (2023.12.28)[CR]- improve series filtering, proper labels for soft subtitles
Expand Down
6 changes: 4 additions & 2 deletions default.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import re
import sys

sys.modules['_asyncio'] = None # @see: https://kodi.wiki/view/Python_Problems#asyncio

import xbmc
import xbmcaddon

# plugin constants
_addon = xbmcaddon.Addon(id='plugin.video.crunchyroll') # or re.sub(r"^plugin://([^/]+)/.*$", r"\1", sys.argv[0])
_addon = xbmcaddon.Addon(id=re.sub(r"^plugin://([^/]+)/.*$", r"\1", sys.argv[0]))
_plugin = _addon.getAddonInfo("name")
_version = _addon.getAddonInfo("version")

Expand Down
20 changes: 15 additions & 5 deletions resources/language/resource.language.de_de/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,10 @@ msgid "Subtitle Language"
msgstr "Untertitel Sprache"

msgctxt "#30021"
msgid "English (US)"
msgstr "Englisch (US)"
msgid "English"
msgstr "Englisch"

msgctxt "#30022"
msgid "English (UK)"
msgstr "Englisch (UK)"
# 30022 free

msgctxt "#30023"
msgid "Spanish"
Expand Down Expand Up @@ -116,6 +114,18 @@ msgctxt "#30031"
msgid "Russian"
msgstr "Russisch"

msgctxt "#30032"
msgid "Hindi"
msgstr ""

msgctxt "#30038"
msgid "Filter available dubs"
msgstr "Verfügbare Dubs filtern"

msgctxt "#30039"
msgid "In an anime seasons view, only display dubs in either Japanese, your CR language or any of your configured subtitle languages."
msgstr "Zeige in der Season-Übersicht eines Anime nur Dubs in Japanisch, deiner CR Sprache oder in einer der von Dir konfigurierten Untertitel-Sprachen"


# Crunchyroll Menue

Expand Down
19 changes: 15 additions & 4 deletions resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,10 @@ msgid "Subtitle Language"
msgstr ""

msgctxt "#30021"
msgid "English (US)"
msgid "English"
msgstr ""

msgctxt "#30022"
msgid "English (UK)"
msgstr ""
# 30022 free

msgctxt "#30023"
msgid "Spanish"
Expand Down Expand Up @@ -115,6 +113,19 @@ msgctxt "#30031"
msgid "Russian"
msgstr ""

msgctxt "#30032"
msgid "Hindi"
msgstr ""


msgctxt "#30038"
msgid "Filter available dubs"
msgstr "Filter available dubs"

msgctxt "#30039"
msgid "In an anime seasons view, only display dubs in either Japanese, your CR language or any of your configured subtitle languages."
msgstr "In an anime seasons view, only display dubs in either Japanese, your CR language or any of your configured subtitle languages."


# Crunchyroll Menue

Expand Down
21 changes: 16 additions & 5 deletions resources/language/resource.language.es_es/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,10 @@ msgid "Subtitle Language"
msgstr "Lenguaje de los subtítulos"

msgctxt "#30021"
msgid "English (US)"
msgstr "Inglés (US)"
msgid "English"
msgstr "Inglés"

msgctxt "#30022"
msgid "English (UK)"
msgstr "Inglés (UK)"
# 30022 free

msgctxt "#30023"
msgid "Spanish"
Expand Down Expand Up @@ -115,6 +113,19 @@ msgctxt "#30031"
msgid "Russian"
msgstr "Ruso"

msgctxt "#30032"
msgid "Hindi"
msgstr ""


msgctxt "#30038"
msgid "Filter available dubs"
msgstr "Filtrar los idiomas de audio disponibles"

msgctxt "#30039"
msgid "In an anime seasons view, only display dubs in either Japanese, your CR language or any of your configured subtitle languages."
msgstr "En una vista de temporadas de anime, sólo se muestran los idiomas de audio en japonés, su idioma Crunchyroll o cualquiera de los idiomas de subtítulos configurados."


# Crunchyroll Menue

Expand Down
21 changes: 16 additions & 5 deletions resources/language/resource.language.fr_fr/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,10 @@ msgid "Subtitle Language"
msgstr "Language des sous titres"

msgctxt "#30021"
msgid "English (US)"
msgstr "Anglais (US)"
msgid "English"
msgstr "Anglais"

msgctxt "#30022"
msgid "English (UK)"
msgstr "Anglais (UK)"
# 30022 free

msgctxt "#30023"
msgid "Spanish"
Expand Down Expand Up @@ -115,6 +113,19 @@ msgctxt "#30031"
msgid "Russian"
msgstr "Russe"

msgctxt "#30032"
msgid "Hindi"
msgstr ""

msgctxt "#30038"
msgid "Filter available dubs"
msgstr "Filtrer les langues audio disponibles"

msgctxt "#30039"
msgid "In an anime seasons view, only display dubs in either Japanese, your CR language or any of your configured subtitle languages."
msgstr "Dans une vue de saisons d'anime, n'affichez que les langues audio en japonais, votre langue Crunchyroll ou l'une des langues de sous-titres que vous avez configurées."


# Crunchyroll Menue
msgctxt "#30040"
msgid "Queue"
Expand Down
22 changes: 17 additions & 5 deletions resources/language/resource.language.pt_br/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,10 @@ msgid "Subtitle Language"
msgstr "Linguagem da legenda"

msgctxt "#30021"
msgid "English (US)"
msgstr "Inglês (US)"
msgid "English"
msgstr "Inglês"

msgctxt "#30022"
msgid "English (UK)"
msgstr "Inglês (UK)"
# 30022 free

msgctxt "#30023"
msgid "Spanish"
Expand Down Expand Up @@ -115,6 +113,20 @@ msgctxt "#30031"
msgid "Russian"
msgstr "Russo"

msgctxt "#30032"
msgid "Hindi"
msgstr ""

msgctxt "#30038"
msgid "Filter available dubs"
msgstr "Filtrar os idiomas de áudio disponíveis"

msgctxt "#30039"
msgid "In an anime seasons view, only display dubs in either Japanese, your CR language or any of your configured subtitle languages."
msgstr "Em uma exibição de temporadas de anime, exiba apenas os idiomas de áudio em japonês, o idioma Crunchyroll ou qualquer um dos idiomas de legenda configurados."



# Crunchyroll Menue
msgctxt "#30040"
msgid "Queue"
Expand Down
30 changes: 21 additions & 9 deletions resources/lib/api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# -*- coding: utf-8 -*-
# Crunchyroll
# Copyright (C) 2018 MrKrabat
# based on work by stefanodvx
# Copyright (C) 2023 smirgol
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
Expand Down Expand Up @@ -33,17 +35,20 @@ class API:
"""Api documentation
https://github.com/CloudMax94/crunchyroll-api/wiki/Api
"""
URL = "https://api.crunchyroll.com/"
VERSION = "1.1.21.0"
TOKEN = "LNDJgOit5yaRIWN"
DEVICE = "com.crunchyroll.windows.desktop"
TIMEOUT = 30
# URL = "https://api.crunchyroll.com/"
# VERSION = "1.1.21.0"
# TOKEN = "LNDJgOit5yaRIWN"
# DEVICE = "com.crunchyroll.windows.desktop"
# TIMEOUT = 30

CRUNCHYROLL_UA = "Crunchyroll/3.51.1 Android/14 okhttp/4.12.0"

INDEX_ENDPOINT = "https://beta-api.crunchyroll.com/index/v2"
PROFILE_ENDPOINT = "https://beta-api.crunchyroll.com/accounts/v1/me/profile"
TOKEN_ENDPOINT = "https://beta-api.crunchyroll.com/auth/v1/token"
SEARCH_ENDPOINT = "https://beta-api.crunchyroll.com/content/v1/search"
STREAMS_ENDPOINT = "https://beta-api.crunchyroll.com/cms/v2{}/videos/{}/streams"
STREAMS_ENDPOINT_DRM = "https://cr-play-service.prd.crunchyrollsvc.com/v1/{}/android/phone/play"
# SERIES_ENDPOINT = "https://beta-api.crunchyroll.com/cms/v2{}/series/{}"
SEASONS_ENDPOINT = "https://beta-api.crunchyroll.com/cms/v2{}/seasons"
EPISODES_ENDPOINT = "https://beta-api.crunchyroll.com/cms/v2{}/episodes"
Expand All @@ -68,7 +73,8 @@ class API:
CRUNCHYLISTS_LISTS_ENDPOINT = "https://beta-api.crunchyroll.com/content/v2/{}/custom-lists"
CRUNCHYLISTS_VIEW_ENDPOINT = "https://beta-api.crunchyroll.com/content/v2/{}/custom-lists/{}"

AUTHORIZATION = "Basic bHF0ai11YmY1aHF4dGdvc2ZsYXQ6N2JIY3hfYnI0czJubWE1bVdrdHdKZEY0ZTU2UU5neFQ="
AUTHORIZATION = "Basic OTQzcTkxX3NtMXVhbnZiX3ppbjQ6bDZ5cXJTQ1NPNzZNeXFVZ295c19SQVFKcWsyemU3YnE="
LICENSE_ENDPOINT = "https://cr-license-proxy.prd.crunchyrollsvc.com/v1/license/widevine"

def __init__(
self,
Expand Down Expand Up @@ -117,12 +123,18 @@ def create_session(self, refresh=False) -> None:
"password": password,
"grant_type": "password",
"scope": "offline_access",
"device_id": self.args.device_id,
"device_name": 'Kodi',
"device_type": 'MediaCenter'
}
elif refresh:
data = {
"refresh_token": self.account_data.refresh_token,
"grant_type": "refresh_token",
"scope": "offline_access",
"device_id": self.args.device_id,
"device_name": 'Kodi',
"device_type": 'MediaCenter'
}

r = self.http.request(
Expand Down Expand Up @@ -194,7 +206,7 @@ def make_request(
params=None,
data=None,
json_data=None,
is_retry=False
is_retry=False,
) -> Optional[Dict]:
if params is None:
params = dict()
Expand Down Expand Up @@ -295,7 +307,7 @@ def write_to_storage(self, account: AccountData) -> bool:

def default_request_headers() -> Dict:
return {
"User-Agent": "Crunchyroll/3.50.2 Android/14 okhttp/4.12.0",
"User-Agent": API.CRUNCHYROLL_UA,
"Content-Type": "application/x-www-form-urlencoded"
}

Expand Down
Loading

0 comments on commit 04951fe

Please sign in to comment.