mirrors: record deprecation reason

This commit is contained in:
Iain Learmonth 2022-05-01 16:23:45 +01:00
parent cacb35a671
commit 18e046dc42
9 changed files with 96 additions and 26 deletions

View file

@ -2,6 +2,7 @@ from bs4 import BeautifulSoup
import requests
from app import app
from app.extensions import db
from app.models.mirrors import Proxy
@ -44,7 +45,7 @@ def check_blocks():
if proxy.deprecated:
print("Proxy already marked blocked")
continue
proxy.deprecate()
proxy.deprecate(reason="external")
if "azureedge.net" in url:
slug = url[len('https://'):][:-len('.azureedge.net')]
print(f"Found {slug} blocked")
@ -58,7 +59,8 @@ def check_blocks():
if proxy.deprecated:
print("Proxy already marked blocked")
continue
proxy.deprecate()
proxy.deprecate(reason="external")
db.session.commit()
if __name__ == "__main__":