add new cdn parsing
This commit is contained in:
parent
a150967ffa
commit
f97b6b2fe1
|
@ -503,6 +503,11 @@ class CdnManager:
|
||||||
token_str = str(token_list[0])
|
token_str = str(token_list[0])
|
||||||
except TypeError:
|
except TypeError:
|
||||||
token_str = ""
|
token_str = ""
|
||||||
|
expires_list = token_query.get("Expires")
|
||||||
|
try:
|
||||||
|
expires_str = str(expires_list[0])
|
||||||
|
except TypeError:
|
||||||
|
expires_str = ""
|
||||||
if token_str != "None" and len(token_str) != 0:
|
if token_str != "None" and len(token_str) != 0:
|
||||||
expire_at = None
|
expire_at = None
|
||||||
split = token_str.split("~")
|
split = token_str.split("~")
|
||||||
|
@ -520,6 +525,15 @@ class CdnManager:
|
||||||
"Invalid __token__ in CDN url: {}".format(url))
|
"Invalid __token__ in CDN url: {}".format(url))
|
||||||
return
|
return
|
||||||
self.__expiration = expire_at * 1000
|
self.__expiration = expire_at * 1000
|
||||||
|
elif expires_str != "None" and len(expires_str) != 0:
|
||||||
|
expires_at = None
|
||||||
|
expires_str = expires_str.split("~")[0]
|
||||||
|
expires_at = int(expires_str)
|
||||||
|
if expires_at is None:
|
||||||
|
self.__expiration = -1
|
||||||
|
self.__cdn_manager.logger.warning("Invalid Expires param in CDN url: {}".format(url))
|
||||||
|
return
|
||||||
|
self.__expiration = expires_at * 1000
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
i = token_url.query.index("_")
|
i = token_url.query.index("_")
|
||||||
|
|
Loading…
Reference in New Issue