mirror of
https://github.com/RROrg/rr.git
synced 2025-06-21 05:51:05 +08:00
fix makeqr error
This commit is contained in:
parent
3857652388
commit
cf1d15adb9
@ -42,6 +42,7 @@ def makeqr(data, file, location, output):
|
||||
"""
|
||||
Generate a QRCode.
|
||||
"""
|
||||
try:
|
||||
import fcntl, struct
|
||||
import qrcode
|
||||
from PIL import Image
|
||||
@ -92,6 +93,9 @@ def makeqr(data, file, location, output):
|
||||
alpha.paste(img, loc)
|
||||
alpha.save(output)
|
||||
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
@cli.command()
|
||||
@click.option("-p", "--platforms", type=str, help="The platforms of Syno.")
|
||||
@ -105,8 +109,8 @@ def getmodels(platforms=None):
|
||||
|
||||
adapter = HTTPAdapter(max_retries=Retry(total=3, backoff_factor=0.5, status_forcelist=[500, 502, 503, 504]))
|
||||
session = requests.Session()
|
||||
session.mount('http://', adapter)
|
||||
session.mount('https://', adapter)
|
||||
session.mount("http://", adapter)
|
||||
session.mount("https://", adapter)
|
||||
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
||||
|
||||
if platforms is not None and platforms != "":
|
||||
@ -142,6 +146,7 @@ def getmodels(platforms=None):
|
||||
try:
|
||||
import re
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
# url="https://kb.synology.com/en-us/DSM/tutorial/What_kind_of_CPU_does_my_NAS_have"
|
||||
url = "https://kb.synology.cn/zh-cn/DSM/tutorial/What_kind_of_CPU_does_my_NAS_have"
|
||||
req = session.get(url, timeout=10, verify=False)
|
||||
|
Loading…
x
Reference in New Issue
Block a user