Merge pull request #125 from iBug/apt-sync-user-agent

apt-sync.py: Set default User-Agent for requests lib
This commit is contained in:
Miao Wang 2021-06-24 01:12:29 +08:00 committed by GitHub
commit a3f82e9ba0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,6 +18,10 @@ from typing import List, Dict, Set, Tuple, IO
import requests import requests
APT_SYNC_USER_AGENT = os.getenv("APT_SYNC_USER_AGENT", "APT-Mirror-Tool/1.0")
requests.utils.default_user_agent = lambda: APT_SYNC_USER_AGENT
OS_TEMPLATE = { OS_TEMPLATE = {
'ubuntu-current': ["xenial", "bionic", "focal", "groovy"], 'ubuntu-current': ["xenial", "bionic", "focal", "groovy"],
'ubuntu-lts': ["xenial", "bionic", "focal"], 'ubuntu-lts': ["xenial", "bionic", "focal"],