From bd537d9c13bb7fb7fe5447c51c2aa5132042b920 Mon Sep 17 00:00:00 2001 From: tech234a <46801700+tech234a@users.noreply.github.com> Date: Tue, 22 Sep 2020 17:50:28 -0400 Subject: [PATCH] Validate settings --- worker.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/worker.py b/worker.py index 5dbd98b..06e68e1 100644 --- a/worker.py +++ b/worker.py @@ -88,6 +88,17 @@ if not (cookies["HSID"] and cookies["SSID"] and cookies["SID"]): mysession = requests.session() mysession.headers.update({"cookie": "HSID="+cookies["HSID"]+"; SSID="+cookies["SSID"]+"; SID="+cookies["SID"], "Accept-Language": "en-US",}) +validationtest = mysession.get("https://www.youtube.com/timedtext_editor?action_mde_edit_form=1&v=1iNTtHUwvq4&lang=en&bl=vmp&ui=hd&ref=player&tab=captions&o=U") + +assert not "accounts.google.com" in validationtest.url, "Please ensure you have correctly specified account cookies." +assert """""" in validationtest.text, "Please make sure your YouTube and Google account language is set to English (United States)" + +del validationtest + open("cookies.txt", "w").write("""# HTTP Cookie File .youtube.com TRUE / FALSE 1663793455 SID [SID] .youtube.com TRUE / FALSE 1663793455 HSID [HSID]