mirror of
https://github.com/RROrg/rr.git
synced 2025-06-21 05:51:05 +08:00
fix getmodels on TimeError
This commit is contained in:
parent
ab175ffee5
commit
2a30ce8604
@ -99,7 +99,7 @@ def getmodels(platforms=None):
|
||||
"""
|
||||
Get Syno Models.
|
||||
"""
|
||||
import json, requests
|
||||
import json, requests, urllib3
|
||||
from requests.adapters import HTTPAdapter
|
||||
from requests.packages.urllib3.util.retry import Retry # type: ignore
|
||||
|
||||
@ -107,6 +107,7 @@ def getmodels(platforms=None):
|
||||
session = requests.Session()
|
||||
session.mount('http://', adapter)
|
||||
session.mount('https://', adapter)
|
||||
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
||||
|
||||
if platforms is not None and platforms != "":
|
||||
PS = platforms.lower().replace(",", " ").split()
|
||||
@ -116,7 +117,7 @@ def getmodels(platforms=None):
|
||||
models = []
|
||||
if len(models) == 0:
|
||||
try:
|
||||
req = session.get("https://autoupdate.synology.com/os/v2", timeout=10)
|
||||
req = session.get("https://autoupdate.synology.com/os/v2", timeout=10, verify=False)
|
||||
req.encoding = "utf-8"
|
||||
data = json.loads(req.text)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user