Allow disabling short URLs with noshorturls.txt file

This commit is contained in:
Jay Lee
2020-05-13 13:00:51 -04:00
parent 1eb7ce3896
commit 32c02c36c9
3 changed files with 9 additions and 0 deletions

View File

@ -320,6 +320,8 @@ URL_SHORTENER_ENDPOINT = 'https://gam-shortn.appspot.com/create'
def shorten_url(long_url, httpc=None):
if GC_Defaults[GC_NO_SHORT_URLS]:
return long_url
if not httpc:
httpc = transport.create_http(timeout=10)
headers = {'Content-Type': 'application/json', 'User-Agent': GAM_INFO}