You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sbenv.py 835B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import os
  2. import http.cookiejar as cookielib
  3. def load_cookiejar():
  4. cpath = os.getenv('SB_COOKIES_TXT')
  5. print('using cookies', cpath)
  6. cj = cookielib.MozillaCookieJar(cpath)
  7. cj.load()
  8. return cj
  9. def get_google_abuse_token():
  10. ga = os.getenv('SB_GOOGABUSE')
  11. if ga is not None:
  12. ga = ga.strip()
  13. return ga
  14. def get_report_webhook():
  15. hu = os.getenv('SB_REPORT_WH')
  16. if hu is not None:
  17. hu = hu.strip()
  18. return hu
  19. def get_admin_key():
  20. ak = os.getenv('SB_ADMIN_KEY')
  21. if ak is not None:
  22. ak = ak.strip()
  23. return ak
  24. def get_worker_datadir():
  25. wdd = os.getenv('SB_WORKER_DATADIR')
  26. if wdd is not None:
  27. wdd = wdd.strip()
  28. return wdd
  29. def get_submit_url():
  30. su = os.getenv('SB_SUBMIT_URL')
  31. if su is not None:
  32. su = su.strip()
  33. return su