Fix
Fix for getting CSRF token for Germany region (Amazon)
This commit is contained in:
parent
a80eb98e36
commit
34bf93c2d5
@ -99,7 +99,8 @@ endpoints:
|
||||
# chapters/scenes
|
||||
xray: '/swift/page/xray'
|
||||
# device registration
|
||||
ontv: '/region/eu/ontv/code?ref_=atv_auth_red_aft' #/gp/video/ontv/code
|
||||
ontv: '/region/eu/ontv/code?ref_=atv_auth_red_aft'
|
||||
ontvold: '/gp/video/ontv/code/ref=atv_device_code'
|
||||
devicelink: '/gp/video/api/codeBasedLinking'
|
||||
codepair: '/auth/create/codepair'
|
||||
register: '/auth/register'
|
||||
|
||||
@ -788,7 +788,7 @@ class Amazon(BaseService):
|
||||
def prepare_endpoint(self, name: str, uri: str, region: dict) -> str:
|
||||
if name in ("browse", "playback", "licence", "xray"):
|
||||
return f"https://{(region['base_manifest'])}{uri}"
|
||||
if name in ("ontv", "devicelink", "details", "getDetailWidgets"):
|
||||
if name in ("ontv", "ontvold", "devicelink", "details", "getDetailWidgets"):
|
||||
if self.pv:
|
||||
host = "www.primevideo.com"
|
||||
else:
|
||||
@ -961,6 +961,7 @@ class Amazon(BaseService):
|
||||
return "".join(match.groups())
|
||||
else:
|
||||
try:
|
||||
if not "live" in mpd_url:
|
||||
mpd_url = "".join(
|
||||
re.split(r"(?i)(/)", mpd_url)[:5] + re.split(r"(?i)(/)", mpd_url)[9:]
|
||||
)
|
||||
@ -1231,7 +1232,10 @@ class Amazon(BaseService):
|
||||
this token is used to register the device
|
||||
:return: OnTV Page's CSRF Token
|
||||
"""
|
||||
try:
|
||||
res = self.session.get(self.endpoints["ontv"])
|
||||
except:
|
||||
res = self.session.get(self.endpoints["ontvold"])
|
||||
response = res.text
|
||||
if 'input type="hidden" name="appAction" value="SIGNIN"' in response:
|
||||
raise self.log.exit(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user