Move useragent to config

This commit is contained in:
Mint 2022-12-11 13:38:06 +03:00
parent e6492a9246
commit f503e1429a
3 changed files with 11 additions and 3 deletions

View file

@ -1,4 +1,5 @@
{
"base_url": "",
"port": 8069
"port": 8069,
"useragent": "Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Firefox/102.0"
}

View file

@ -4,11 +4,15 @@ from hashlib import sha256
import sqlite3
from bs4 import BeautifulSoup
from json import dumps
from json import loads
import re
from time import time
with open("config.json") as f:
config = loads(f.read())
headers = {
"user-agent": "Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Firefox/102.0"
"user-agent": config["useragent"]
}

View file

@ -4,6 +4,9 @@ import sqlite3
import sys
import json
with open("config.json") as f:
config = json.loads(f.read())
domain = sys.argv[1]
blacklist = [
@ -13,7 +16,7 @@ blacklist = [
]
headers = {
"user-agent": "Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Firefox/102.0"
"user-agent": config["useragent"]
}