Restructuration + init test system
This commit is contained in:
17
webpicdownloader/util/UpdateModule.py
Normal file
17
webpicdownloader/util/UpdateModule.py
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
|
||||
from http.client import HTTPException
|
||||
import re
|
||||
from urllib import request as http
|
||||
|
||||
|
||||
def fetch_version(headers: str, url: str) -> str:
|
||||
"""
|
||||
|
||||
"""
|
||||
request = http.Request(url=url, headers=headers, method='GET')
|
||||
response = http.urlopen(request)
|
||||
if response.getcode() != 200:
|
||||
raise HTTPException("Bad response returned by server")
|
||||
return response.read().decode('utf-8')
|
||||
|
||||
Reference in New Issue
Block a user