Browse Source

이머전시 툴로 개편

ect (or 2du) 8 years ago
parent
commit
dfbec787ec
3 changed files with 50 additions and 56 deletions
  1. 0 41
      back_reset.py
  2. 0 15
      delete_recaptcha.py
  3. 50 0
      emergency_tool.py

+ 0 - 41
back_reset.py

@@ -1,41 +0,0 @@
-# 주요 모듈 불러옴
-import json
-import sqlite3
-import threading
-
-# 기타 코드 불러옴
-from func import *
-from mark import namumark
-
-# JSON 불러옴
-json_data = open('set.json').read()
-set_data = json.loads(json_data)
-
-# 디비 연결
-conn = sqlite3.connect(set_data['db'] + '.db', check_same_thread = False)
-curs = conn.cursor()
-
-# 파싱 해주는 함수
-def parser(data):
-    namumark(conn, data[0], data[1], 1)
-
-# 역링크 전부 삭제
-curs.execute("delete from back")
-conn.commit()
-
-# 데이터에서 제목이랑 내용 불러옴
-curs.execute("select title, data from data")
-data = curs.fetchall()
-
-# for 돌려서 처리
-for test in data:
-    # 제목 프린트
-    print(test[0])
-
-    # 스레드 기반으로 처리
-    t = threading.Thread(target = parser, args = [test])
-    t.start()
-    t.join()
-
-# 커밋
-conn.commit()

+ 0 - 15
delete_recaptcha.py

@@ -1,15 +0,0 @@
-import json
-import sqlite3
-
-# JSON 연결
-json_data = open('set.json').read()
-set_data = json.loads(json_data)
-
-# 디비 연결
-conn = sqlite3.connect(set_data['db'] + '.db', check_same_thread = False)
-curs = conn.cursor()
-
-# 데이터 삭제
-curs.execute("delete from other where name = 'recaptcha'")
-curs.execute("delete from other where name = 'sec_re'")
-conn.commit()

+ 50 - 0
emergency_tool.py

@@ -0,0 +1,50 @@
+# 주요 모듈 불러옴
+import json
+import sqlite3
+import threading
+
+# 기타 코드 불러옴
+from func import *
+from mark import namumark
+
+# JSON 불러옴
+json_data = open('set.json').read()
+set_data = json.loads(json_data)
+
+# 디비 연결
+conn = sqlite3.connect(set_data['db'] + '.db', check_same_thread = False)
+curs = conn.cursor()
+
+print('1. BackLink ReSet')
+print('2. ReCaptcha Delete')
+print('')
+
+print('select : ', end = '')
+what_i_do = input()
+
+if what_i_do == '1':
+    # 파싱 해주는 함수
+    def parser(data):
+        namumark(conn, data[0], data[1], 1)
+
+    # 역링크 전부 삭제
+    curs.execute("delete from back")
+    conn.commit()
+
+    # 데이터에서 제목이랑 내용 불러옴
+    curs.execute("select title, data from data")
+    data = curs.fetchall()
+
+    # for 돌려서 처리
+    for test in data:
+        # 스레드 기반으로 처리
+        t = threading.Thread(target = parser, args = [test])
+        t.start()
+        t.join()
+elif what_i_do == '2':
+    # 데이터 삭제
+    curs.execute("delete from other where name = 'recaptcha'")
+    curs.execute("delete from other where name = 'sec_re'")
+
+# 커밋
+conn.commit()