Sfoglia il codice sorgente

(跟上次一样,忘了添加了awa)更换了chaojiying为ttshitu,完成了cookie登录和自动的验证码截图与提交、获取坐标,接下来做验证码的点选

Shellmiao 4 anni fa
parent
commit
5389c67e25

+ 9 - 0
VerificationCode/GetImage.py

@@ -0,0 +1,9 @@
+from PIL import Image
+from io import BytesIO
+
+
+def get_vc_image(element):
+    image = element.screenshot_as_png
+    imageStream = BytesIO(image)
+    im = Image.open(imageStream)
+    return im

BIN
VerificationCode/a.png


BIN
VerificationCode/b.png


BIN
VerificationCode/c.png


BIN
VerificationCode/d.jpg


+ 15 - 0
VerificationCode/ttshitu.py

@@ -0,0 +1,15 @@
+import base64
+import json
+import requests
+
+
+def base64_api(uname, pwd, img):
+    with open(img, 'rb') as f:
+        base64_data = base64.b64encode(f.read())
+        b64 = base64_data.decode()
+    data = {"username": uname, "password": pwd, "typeid": 27, "image": b64}
+    result = json.loads(requests.post("http://api.ttshitu.com/imageXYPlus", json=data).text)
+    if result['success']:
+        return result["data"]["result"]
+    else:
+        return result["message"]

File diff suppressed because it is too large
+ 0 - 0
cookies3.txt


+ 75 - 0
geckodriver.log

@@ -0,0 +1,75 @@
+1612860082189	geckodriver	INFO	Listening on 127.0.0.1:4702
+1612860082721	mozrunner::runner	INFO	Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "-foreground" "-no-remote" "-profile" "C:\\Users\\SHELLM~1\\AppData\\Local\\Temp\\rust_mozprofileXUQL4U"
+JavaScript error: hvxo0zbh3go.cfg, line 2: ReferenceError: Components is not defined
+console.warn: SearchSettings: "get: No settings file exists, new profile?" (new Error("", "(unknown module)"))
+1612860084722	Marionette	INFO	Listening on port 4708
+1612860084793	Marionette	WARN	TLS certificate errors will be ignored for this session
+1612860084806	Marionette	ERROR	[15] No reply from Marionette:Register
+JavaScript warning: https://www.mcbbs.net/template/mcbbs/common/jquery.min.js, line 2: Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead
+JavaScript error: https://www.mcbbs.net/, line 1532: ReferenceError: A is not defined
+JavaScript warning: https://www.mcbbs.net/template/mcbbs/common/jquery.min.js, line 2: Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead
+JavaScript error: https://www.mcbbs.net/plugin.php?id=dc_signin, line 259: ReferenceError: announcement is not defined
+JavaScript error: https://www.mcbbs.net/plugin.php?id=dc_signin, line 383: ReferenceError: A is not defined
+SourceActor threw an exception: [Exception... "Component returned failure code: 0x80470002 (NS_BASE_STREAM_CLOSED) [nsIInputStream.available]"  nsresult: "0x80470002 (NS_BASE_STREAM_CLOSED)"  location: "JS frame :: resource://devtools/shared/DevToolsUtils.js :: onResponse :: line 567"  data: no]
+Stack: onResponse@resource://devtools/shared/DevToolsUtils.js:567:34
+onStopRequest@resource://gre/modules/NetUtil.jsm:128:18
+Line: 567, column: 0
+console.error: ({})
+JavaScript error: resource://devtools/shared/DevToolsUtils.js, line 567: NS_BASE_STREAM_CLOSED: Component returned failure code: 0x80470002 (NS_BASE_STREAM_CLOSED) [nsIInputStream.available]
+1612860204489	Marionette	INFO	Stopped listening on port 4708
+
+###!!! [Child][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost
+
+1612860209747	geckodriver	INFO	Listening on 127.0.0.1:4887
+1612860210299	mozrunner::runner	INFO	Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "-foreground" "-no-remote" "-profile" "C:\\Users\\SHELLM~1\\AppData\\Local\\Temp\\rust_mozprofile7wevcJ"
+JavaScript error: hvxo0zbh3go.cfg, line 2: ReferenceError: Components is not defined
+console.warn: SearchSettings: "get: No settings file exists, new profile?" (new Error("", "(unknown module)"))
+1612860212298	Marionette	INFO	Listening on port 4892
+1612860212346	Marionette	WARN	TLS certificate errors will be ignored for this session
+1612860212361	Marionette	ERROR	[15] No reply from Marionette:Register
+JavaScript warning: https://www.mcbbs.net/template/mcbbs/common/jquery.min.js, line 2: Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead
+JavaScript error: https://www.mcbbs.net/, line 1532: ReferenceError: A is not defined
+JavaScript warning: https://www.mcbbs.net/template/mcbbs/common/jquery.min.js, line 2: Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead
+JavaScript error: https://www.mcbbs.net/plugin.php?id=dc_signin, line 259: ReferenceError: announcement is not defined
+JavaScript error: https://www.mcbbs.net/plugin.php?id=dc_signin, line 383: ReferenceError: A is not defined
+JavaScript error: resource://gre/modules/XULStore.jsm, line 66: Error: Can't find profile directory.
+1612860267318	Marionette	INFO	Stopped listening on port 4892
+
+###!!! [Child][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost
+
+1612860272673	geckodriver	INFO	Listening on 127.0.0.1:5024
+1612860273204	mozrunner::runner	INFO	Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "-foreground" "-no-remote" "-profile" "C:\\Users\\SHELLM~1\\AppData\\Local\\Temp\\rust_mozprofilekBrPCb"
+JavaScript error: hvxo0zbh3go.cfg, line 2: ReferenceError: Components is not defined
+console.warn: SearchSettings: "get: No settings file exists, new profile?" (new Error("", "(unknown module)"))
+1612860275241	Marionette	INFO	Listening on port 5029
+1612860275362	Marionette	WARN	TLS certificate errors will be ignored for this session
+1612860275373	Marionette	ERROR	[15] No reply from Marionette:Register
+JavaScript warning: https://www.mcbbs.net/template/mcbbs/common/jquery.min.js, line 2: Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead
+JavaScript error: https://www.mcbbs.net/, line 1532: ReferenceError: A is not defined
+JavaScript warning: https://www.mcbbs.net/template/mcbbs/common/jquery.min.js, line 2: Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead
+JavaScript error: https://www.mcbbs.net/plugin.php?id=dc_signin, line 259: ReferenceError: announcement is not defined
+JavaScript error: https://www.mcbbs.net/plugin.php?id=dc_signin, line 383: ReferenceError: A is not defined
+JavaScript error: resource://gre/modules/XULStore.jsm, line 66: Error: Can't find profile directory.
+[Child 18972, IPC I/O Child] WARNING: pipe error: 232: file /builds/worker/checkouts/gecko/ipc/chromium/src/chrome/common/ipc_channel_win.cc:545
+[Child 18972, IPC I/O Child] WARNING: pipe error: 232: file /builds/worker/checkouts/gecko/ipc/chromium/src/chrome/common/ipc_channel_win.cc:545
+1612860382252	Marionette	INFO	Stopped listening on port 5029
+
+###!!! [Child][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost
+
+1612860384089	geckodriver	INFO	Listening on 127.0.0.1:5216
+1612860384638	mozrunner::runner	INFO	Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "-foreground" "-no-remote" "-profile" "C:\\Users\\SHELLM~1\\AppData\\Local\\Temp\\rust_mozprofilembaO7r"
+JavaScript error: hvxo0zbh3go.cfg, line 2: ReferenceError: Components is not defined
+console.warn: SearchSettings: "get: No settings file exists, new profile?" (new Error("", "(unknown module)"))
+1612860386692	Marionette	INFO	Listening on port 5221
+1612860386787	Marionette	WARN	TLS certificate errors will be ignored for this session
+1612860386798	Marionette	ERROR	[15] No reply from Marionette:Register
+JavaScript warning: https://www.mcbbs.net/template/mcbbs/common/jquery.min.js, line 2: Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead
+JavaScript error: https://www.mcbbs.net/, line 1532: ReferenceError: A is not defined
+JavaScript warning: https://www.mcbbs.net/template/mcbbs/common/jquery.min.js, line 2: Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead
+JavaScript error: https://www.mcbbs.net/plugin.php?id=dc_signin, line 259: ReferenceError: announcement is not defined
+JavaScript error: https://www.mcbbs.net/plugin.php?id=dc_signin, line 383: ReferenceError: A is not defined
+JavaScript error: resource://gre/modules/XULStore.jsm, line 66: Error: Can't find profile directory.
+JavaScript warning: https://www.mcbbs.net/template/mcbbs/common/jquery.min.js, line 2: Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead
+JavaScript error: https://www.mcbbs.net/plugin.php?id=dc_signin, line 259: ReferenceError: announcement is not defined
+JavaScript error: https://www.mcbbs.net/plugin.php?id=dc_signin, line 383: ReferenceError: A is not defined
+1612865986239	Marionette	INFO	Stopped listening on port 5221

File diff suppressed because it is too large
+ 0 - 0
loginTools/cookies3.txt


+ 15 - 0
loginTools/login.py

@@ -0,0 +1,15 @@
+import json
+
+
+def login(driver, cookie_path):
+    print('OK')
+    driver.get('https://www.mcbbs.net/')
+    print('OK')
+    driver.delete_all_cookies()
+    print('OK')
+    with open(cookie_path, 'r') as cookief:
+        cookieslist = json.load(cookief)
+        for cookie in cookieslist:
+            driver.add_cookie(cookie)
+            print(cookie)
+        print('OK')

Some files were not shown because too many files changed in this diff