diff --git a/README.md b/README.md
new file mode 100644
index 0000000..6b9db81
--- /dev/null
+++ b/README.md
@@ -0,0 +1,28 @@
+# BTSearcher
+
+我通过浏览器访问各种BT搜索网站时,总会有乱七八糟的弹窗和广告,很是烦人。于是自己写了这么个小工具,通过`PyQt`爬取一些网站获得磁力链接。
+
+## 软件信赖
+
+- python 3.4+
+ - requests
+ - beautifulsoup 4
+ - lxml
+
+## 使用方法
+
+```shell
+python run.py
+```
+
+## 支持网站
+
+- Bobobt
+
+
+- BTcerise
+- Cililianc
+- BTdao
+- BTrabbit
+- BTanw
+- Ciliba
diff --git a/gen_ui.sh b/gen_ui.sh
new file mode 100755
index 0000000..6473f8b
--- /dev/null
+++ b/gen_ui.sh
@@ -0,0 +1 @@
+pyuic5 -o window.py ./qt/mainwindow.ui
diff --git a/qt/BTSearcher.pro b/qt/BTSearcher.pro
new file mode 100644
index 0000000..c14f353
--- /dev/null
+++ b/qt/BTSearcher.pro
@@ -0,0 +1,34 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2018-02-13T15:52:30
+#
+#-------------------------------------------------
+
+QT += core gui
+
+greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+
+TARGET = BtSearch
+TEMPLATE = app
+
+# The following define makes your compiler emit warnings if you use
+# any feature of Qt which has been marked as deprecated (the exact warnings
+# depend on your compiler). Please consult the documentation of the
+# deprecated API in order to know how to port your code away from it.
+DEFINES += QT_DEPRECATED_WARNINGS
+
+# You can also make your code fail to compile if you use deprecated APIs.
+# In order to do so, uncomment the following line.
+# You can also select to disable deprecated APIs only up to a certain version of Qt.
+#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
+
+
+SOURCES += \
+ main.cpp \
+ mainwindow.cpp
+
+HEADERS += \
+ mainwindow.h
+
+FORMS += \
+ mainwindow.ui
diff --git a/qt/BTSearcher.pro.user b/qt/BTSearcher.pro.user
new file mode 100644
index 0000000..094b848
--- /dev/null
+++ b/qt/BTSearcher.pro.user
@@ -0,0 +1,336 @@
+
+
+
+
+
+ EnvironmentId
+ {cfe5db96-a239-44a1-89bc-6e1d2df6822d}
+
+
+ ProjectExplorer.Project.ActiveTarget
+ 0
+
+
+ ProjectExplorer.Project.EditorSettings
+
+ true
+ false
+ true
+
+ Cpp
+
+ CppGlobal
+
+
+
+ QmlJS
+
+ QmlJSGlobal
+
+
+ 2
+ UTF-8
+ false
+ 4
+ false
+ 80
+ true
+ true
+ 1
+ true
+ false
+ 0
+ true
+ true
+ 0
+ 8
+ true
+ 1
+ true
+ true
+ true
+ false
+
+
+
+ ProjectExplorer.Project.PluginSettings
+
+
+
+ ProjectExplorer.Project.Target.0
+
+ Desktop Qt 5.10.1 clang 64bit
+ Desktop Qt 5.10.1 clang 64bit
+ qt.qt5.5101.clang_64_kit
+ 0
+ 0
+ 0
+
+ /Users/xwy/TODO/python/BTSearcher/build-BTSearcher-Desktop_Qt_5_10_1_clang_64bit-Debug
+
+
+ true
+ qmake
+
+ QtProjectManager.QMakeBuildStep
+ true
+
+ false
+ false
+ false
+
+
+ true
+ Make
+
+ Qt4ProjectManager.MakeStep
+
+ -w
+ -r
+
+ false
+
+
+
+ 2
+ 构建
+
+ ProjectExplorer.BuildSteps.Build
+
+
+
+ true
+ Make
+
+ Qt4ProjectManager.MakeStep
+
+ -w
+ -r
+
+ true
+ clean
+
+
+ 1
+ 清理
+
+ ProjectExplorer.BuildSteps.Clean
+
+ 2
+ false
+
+ Debug
+
+ Qt4ProjectManager.Qt4BuildConfiguration
+ 2
+ true
+
+
+ /Users/xwy/TODO/python/BTSearcher/build-BTSearcher-Desktop_Qt_5_10_1_clang_64bit-Release
+
+
+ true
+ qmake
+
+ QtProjectManager.QMakeBuildStep
+ false
+
+ false
+ false
+ false
+
+
+ true
+ Make
+
+ Qt4ProjectManager.MakeStep
+
+ -w
+ -r
+
+ false
+
+
+
+ 2
+ 构建
+
+ ProjectExplorer.BuildSteps.Build
+
+
+
+ true
+ Make
+
+ Qt4ProjectManager.MakeStep
+
+ -w
+ -r
+
+ true
+ clean
+
+
+ 1
+ 清理
+
+ ProjectExplorer.BuildSteps.Clean
+
+ 2
+ false
+
+ Release
+
+ Qt4ProjectManager.Qt4BuildConfiguration
+ 0
+ true
+
+
+ /Users/xwy/TODO/python/BTSearcher/build-BTSearcher-Desktop_Qt_5_10_1_clang_64bit-Profile
+
+
+ true
+ qmake
+
+ QtProjectManager.QMakeBuildStep
+ true
+
+ false
+ true
+ false
+
+
+ true
+ Make
+
+ Qt4ProjectManager.MakeStep
+
+ -w
+ -r
+
+ false
+
+
+
+ 2
+ 构建
+
+ ProjectExplorer.BuildSteps.Build
+
+
+
+ true
+ Make
+
+ Qt4ProjectManager.MakeStep
+
+ -w
+ -r
+
+ true
+ clean
+
+
+ 1
+ 清理
+
+ ProjectExplorer.BuildSteps.Clean
+
+ 2
+ false
+
+ Profile
+
+ Qt4ProjectManager.Qt4BuildConfiguration
+ 0
+ true
+
+ 3
+
+
+ 0
+ 部署
+
+ ProjectExplorer.BuildSteps.Deploy
+
+ 1
+ 在本地部署
+
+ ProjectExplorer.DefaultDeployConfiguration
+
+ 1
+
+
+ false
+ false
+ 1000
+
+ true
+
+ false
+ false
+ false
+ false
+ true
+ 0.01
+ 10
+ true
+ 1
+ 25
+
+ 1
+ true
+ false
+ true
+ valgrind
+
+ 0
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ 10
+ 11
+ 12
+ 13
+ 14
+
+ 2
+
+ BTSearcher
+
+ Qt4ProjectManager.Qt4RunConfiguration:/Users/xwy/TODO/python/BTSearcher/qt/BTSearcher.pro
+ true
+
+ BTSearcher.pro
+ false
+
+ /Users/xwy/TODO/python/BTSearcher/build-BTSearcher-Desktop_Qt_5_10_1_clang_64bit-Debug/BtSearch.app/Contents/MacOS
+ 3768
+ false
+ true
+ false
+ false
+ true
+
+ 1
+
+
+
+ ProjectExplorer.Project.TargetCount
+ 1
+
+
+ ProjectExplorer.Project.Updater.FileVersion
+ 18
+
+
+ Version
+ 18
+
+
diff --git a/qt/main.cpp b/qt/main.cpp
new file mode 100644
index 0000000..aab39bb
--- /dev/null
+++ b/qt/main.cpp
@@ -0,0 +1,11 @@
+#include "mainwindow.h"
+#include
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+ MainWindow w;
+ w.show();
+
+ return a.exec();
+}
diff --git a/qt/mainwindow.cpp b/qt/mainwindow.cpp
new file mode 100644
index 0000000..be4d3b6
--- /dev/null
+++ b/qt/mainwindow.cpp
@@ -0,0 +1,34 @@
+#include "mainwindow.h"
+#include "ui_mainwindow.h"
+
+
+class MyThread: QThread {
+ Q_OBJECT
+
+public:
+ void run();
+};
+
+MainWindow::MainWindow(QWidget *parent) :
+ QMainWindow(parent),
+ ui(new Ui::MainWindow)
+{
+ ui->setupUi(this);
+}
+
+MainWindow::~MainWindow()
+{
+ delete ui;
+}
+
+void MainWindow::on_btn_search_clicked(bool checked)
+{
+}
+
+void MainWindow::on_ln_key_returnPressed()
+{
+}
+
+void MainWindow::on_cb_source_currentIndexChanged(int index)
+{
+}
diff --git a/qt/mainwindow.h b/qt/mainwindow.h
new file mode 100644
index 0000000..116043e
--- /dev/null
+++ b/qt/mainwindow.h
@@ -0,0 +1,28 @@
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include
+
+namespace Ui {
+class MainWindow;
+}
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ explicit MainWindow(QWidget *parent = 0);
+ ~MainWindow();
+
+private slots:
+ void on_btn_search_clicked(bool checked);
+ void on_ln_key_returnPressed();
+
+ void on_cb_source_currentIndexChanged(int index);
+
+private:
+ Ui::MainWindow *ui;
+};
+
+#endif // MAINWINDOW_H
diff --git a/qt/mainwindow.ui b/qt/mainwindow.ui
new file mode 100644
index 0000000..b20a9cd
--- /dev/null
+++ b/qt/mainwindow.ui
@@ -0,0 +1,90 @@
+
+
+ MainWindow
+
+
+
+ 0
+ 0
+ 750
+ 600
+
+
+
+
+ 750
+ 600
+
+
+
+
+ 750
+ 600
+
+
+
+ BTSearcher
+
+
+
+ -
+
+
+ QAbstractItemView::NoEditTriggers
+
+
+ false
+
+
+ false
+
+
+ QAbstractItemView::SingleSelection
+
+
+ QAbstractItemView::SelectRows
+
+
+
+ 热度
+
+
+
+
+ 大小
+
+
+
+
+ 文件名
+
+
+
+
+ -
+
+
+ Search
+
+
+
+ -
+
+
+ -
+
+
+
+
+
+
+
+
+ cb_source
+ btn_search
+ ln_key
+ tb_result
+
+
+
+
diff --git a/run.py b/run.py
new file mode 100644
index 0000000..0962cd0
--- /dev/null
+++ b/run.py
@@ -0,0 +1,8 @@
+import sys
+import ux
+from PyQt5.QtWidgets import QApplication
+
+app = QApplication(sys.argv)
+search = ux.Ux()
+search.show()
+sys.exit(app.exec_())
diff --git a/sites.py b/sites.py
new file mode 100644
index 0000000..bac0b7b
--- /dev/null
+++ b/sites.py
@@ -0,0 +1,308 @@
+import requests
+from bs4 import BeautifulSoup
+
+
+class Sites:
+ def __init__(self, signal):
+ self.send_item = signal
+ print(self.name, 'start ...')
+
+ def __del__(self):
+ print(self.name, 'stop !')
+
+ def search(self, key_word):
+ key_word = self.trns_key(key_word)
+ for url in self.gen_url(key_word):
+ try:
+ soup = self.fetch_soup(url)
+ except:
+ break
+ for item in self.get_item(soup):
+ if 'link_url' in item:
+ try:
+ item['link'] = self.get_link(self.fetch_soup(item['link_url']))
+ except:
+ item['link'] = ''
+ if item['link']:
+ self.send_item.emit(item)
+ try:
+ if self.last_page(soup):
+ break
+ except:
+ break
+
+ @staticmethod
+ def fetch_soup(url):
+ print('fetching "' + url + '" ...', end=' ')
+ soup = BeautifulSoup(requests.get(url).text, 'lxml')
+ print('ok!')
+ return soup
+
+ @staticmethod
+ def gen_url(key_word):
+ raise NotImplementedError
+
+ @staticmethod
+ def last_page(soup):
+ raise NotImplementedError
+
+ @staticmethod
+ def get_item(soup):
+ raise NotImplementedError
+
+ @staticmethod
+ def get_link(url):
+ raise NotImplementedError
+
+
+class Bobobt(Sites):
+ name = 'Bobobt'
+
+ @staticmethod
+ def trns_key(key_word):
+ return key_word.replace(' ', '%20')
+
+ @staticmethod
+ def gen_url(key_word):
+ page_number = 0
+ while True:
+ page_number += 1
+ yield 'https://www.bobobt.com/search/%s/%d/0/0.html' % (key_word, page_number)
+
+ @staticmethod
+ def last_page(soup):
+ return soup.find('div', 'pager').find_all('a')[-1].string not in ['>>', '>>']
+
+ @staticmethod
+ def get_item(soup):
+ for dom_item in soup.find_all('div', 'ss'):
+ try:
+ la = dom_item.find_all('a')
+ lb = dom_item.find_all('b')
+ yield {
+ 'hot': lb[4].string,
+ 'size': lb[1].string,
+ 'name': ''.join(la[0].strings).strip(),
+ 'link': la[1].get('href')
+ }
+ except:
+ continue
+
+
+class BTcerise(Sites):
+ name = 'BTcerise'
+
+ @staticmethod
+ def trns_key(key_word):
+ return key_word.replace(' ', '%20')
+
+ @staticmethod
+ def gen_url(key_word):
+ page_number = 0
+ while True:
+ page_number += 1
+ yield 'http://www.btcerise.me/search?keyword=%s&p=%d' % (key_word, page_number)
+
+ @staticmethod
+ def last_page(soup):
+ return 'disable' in soup.find('ul', 'pagination').find_all('li')[-1]
+
+ @staticmethod
+ def get_item(soup):
+ for dom_item in soup.find_all('div', 'r'):
+ try:
+ yield {
+ 'hot': '-',
+ 'size': dom_item.find_all('span', 'prop_val')[1].string,
+ 'name': ''.join(dom_item.find('h5').strings),
+ 'link': dom_item.find('div').find('a').get('href')
+ }
+ except:
+ continue
+
+
+class Cililianc(Sites):
+ name = 'Cililianc'
+
+ @staticmethod
+ def trns_key(key_word):
+ return key_word.replace(' ', '%2B')
+
+ @staticmethod
+ def gen_url(key_word):
+ page_number = 0
+ while True:
+ page_number += 1
+ yield 'http://cililianc.com/list/%s/%d.html' % (key_word, page_number)
+
+ @staticmethod
+ def last_page(soup):
+ return soup.find('div', 'pg').find_all('a')[-1].string not in ['下一页']
+
+ @staticmethod
+ def get_item(soup):
+ for dom_item in soup.find('ul', 'mlist').find_all('li'):
+ try:
+ yield {
+ 'hot': '-',
+ 'size': dom_item.find('dt').find('span').string,
+ 'name': ''.join(dom_item.find('a').strings),
+ 'link': dom_item.find('div', 'dInfo').find('a').get('href')
+ }
+ except:
+ continue
+
+
+class BTdao(Sites):
+ name = 'BTdao'
+
+ @staticmethod
+ def trns_key(key_word):
+ return key_word.replace(' ', '%2B')
+
+ @staticmethod
+ def gen_url(key_word):
+ page_number = 0
+ while True:
+ page_number += 1
+ yield 'http://www.btdao.me/list/%s-s2d-%d.html' % (key_word, page_number)
+
+ @staticmethod
+ def last_page(soup):
+ return soup.find('div', 'pg').find_all('a')[-1].string not in ['下一页']
+
+ @staticmethod
+ def get_item(soup):
+ for dom_item in soup.find_all('li'):
+ try:
+ la = dom_item.find('a')
+ ls = dom_item.find('dl').find_all('span')
+ yield {
+ 'hot': ls[3].string,
+ 'size': ls[0].string,
+ 'name': la.get('title'),
+ 'link_url': 'http://www.btdao.me' + la.get('href')
+ }
+ except:
+ continue
+
+ @staticmethod
+ def get_link(soup):
+ return soup.find('dl', 'BotInfo').find('a').get('href')
+
+
+class BTrabbit(Sites):
+ name = 'BTrabbit'
+
+ @staticmethod
+ def trns_key(key_word):
+ return key_word.replace(' ', '%20')
+
+ @staticmethod
+ def gen_url(key_word):
+ page_number = 0
+ while True:
+ page_number += 1
+ yield 'http://www.btrabbit.net/search/%s/default-%d.html' % (key_word, page_number)
+
+ @staticmethod
+ def last_page(soup):
+ return soup.find('div', 'bottom-pager').find_all('a')[-1].string not in ['>']
+
+ @staticmethod
+ def get_item(soup):
+ for dom_item in soup.find_all('div', 'search-item'):
+ try:
+ la = dom_item.find('a')
+ lb = dom_item.find('div', 'item-bar').find_all('b')
+ yield {
+ 'hot': lb[2].string,
+ 'size': lb[1].string.replace(' ', ' '),
+ 'name': la.get('title'),
+ 'link_url': 'http://www.btrabbit.net' + la.get('href')
+ }
+ except:
+ continue
+
+ @staticmethod
+ def get_link(soup):
+ return soup.find_all('textarea')[0].string
+
+
+class BTanw(Sites):
+ name = 'BTanw'
+
+ @staticmethod
+ def trns_key(key_word):
+ return key_word.replace(' ', '%20')
+
+ @staticmethod
+ def gen_url(key_word):
+ page_number = 0
+ while True:
+ page_number += 1
+ yield 'http://www.btanw.com/search/%s-hot-desc-%d' % (key_word, page_number)
+
+ @staticmethod
+ def last_page(soup):
+ return len(soup.find('div', 'bottom-pager').find_all('a')[-1].get('href')) == 0
+
+ @staticmethod
+ def get_item(soup):
+ for dom_item in soup.find_all('div', 'search-item'):
+ try:
+ la = dom_item.find('a')
+ lb = dom_item.find('div', 'item-bar').find_all('b')
+ yield {
+ 'hot': lb[1].string,
+ 'size': lb[3].string,
+ 'name': ''.join(la.strings),
+ 'link_url': 'http://www.btanw.com' + la.get('href')
+ }
+ except:
+ continue
+
+ @staticmethod
+ def get_link(soup):
+ return soup.find('div', 'fileDetail').find_all('p')[5].find('a').get('href')
+
+
+class Ciliba(Sites):
+ name = 'Ciliba'
+
+ @staticmethod
+ def trns_key(key_word):
+ return key_word.replace(' ', '+')
+
+ @staticmethod
+ def gen_url(key_word):
+ page_number = 0
+ while True:
+ page_number += 1
+ yield 'https://www.ciliba.org/s/%s_rel_%d.html' % (key_word, page_number)
+
+ @staticmethod
+ def last_page(soup):
+ return soup.find('ul', 'pagination').find_all('a')[-1].string not in ['Last']
+
+ @staticmethod
+ def get_item(soup):
+ for dom_item in soup.find_all('div', 'search-item'):
+ try:
+ la = dom_item.find('h3').find('a')
+ lb = dom_item.find('div', 'item-bar').find_all('b')
+ yield {
+ 'hot': lb[2].string,
+ 'size': lb[1].string,
+ 'name': ''.join(la.strings),
+ 'link_url': la.get('href')
+ }
+ except:
+ continue
+
+ @staticmethod
+ def get_link(soup):
+ return soup.find('a', 'download').get('href')
+
+
+lst = (Bobobt, BTcerise, Cililianc, BTdao, BTrabbit, BTanw, Ciliba)
diff --git a/ux.py b/ux.py
new file mode 100644
index 0000000..41317c3
--- /dev/null
+++ b/ux.py
@@ -0,0 +1,88 @@
+import sites
+import window
+from PyQt5.QtGui import QClipboard
+from PyQt5.QtCore import QTimer, QThread, pyqtSignal, pyqtSlot
+from PyQt5.QtWidgets import QApplication, QMainWindow, QTableWidgetItem
+
+
+class Ux(QMainWindow, window.Ui_MainWindow):
+ def __init__(self):
+ super().__init__()
+ self.clipboard = QApplication.clipboard()
+ # timer for update status bar
+ self.timer = QTimer(self)
+ self.timer.setInterval(1000)
+ self.timer.timeout.connect(self.update_state)
+ # setting ui
+ self.setupUi(self)
+ self.tb_result.setColumnWidth(0, 70)
+ self.tb_result.setColumnWidth(1, 90)
+ self.tb_result.setColumnWidth(2, 480)
+ for it in sites.lst:
+ self.cb_source.addItem(it.name)
+
+ def update_state(self):
+ self.process += 1
+ self.state.showMessage('Searching ' + '.' * (self.process % 10))
+
+ def stop_search(self):
+ self.state.showMessage('Over')
+ if self.timer.isActive():
+ self.timer.stop()
+ while self.th_search.isRunning():
+ self.th_search.exit()
+
+ def on_cb_source_currentIndexChanged(self, index):
+ if type(index) == type(1):
+ self.site = sites.lst[index]
+ self.stop_search()
+
+ def on_btn_search_clicked(self, b=True):
+ if b:
+ return
+ self.stop_search()
+ self.tb_result.clearContents()
+ self.tb_result.setRowCount(0)
+ self.process = 0
+ self.links = []
+ self.timer.start()
+ self.th_search = SearchThread(self, self.ln_key.text())
+ self.th_search.start()
+
+ def on_ln_key_returnPressed(self):
+ self.btn_search.click()
+
+ def on_tb_result_cellActivated(self, row, col):
+ self.clipboard.setText(self.links[row])
+
+ @pyqtSlot()
+ def do_stop_search(self):
+ self.timer.stop()
+
+ @pyqtSlot(dict)
+ def do_append_result(self, item):
+ row = self.tb_result.rowCount()
+ self.tb_result.insertRow(row)
+ self.tb_result.setItem(row, 0, QTableWidgetItem(item['hot']))
+ self.tb_result.setItem(row, 1, QTableWidgetItem(item['size']))
+ self.tb_result.setItem(row, 2, QTableWidgetItem(item['name']))
+ self.links.append(item['link'])
+
+
+class SearchThread(QThread):
+ to_append_result = pyqtSignal([dict])
+ to_stop_search = pyqtSignal()
+
+ def __init__(self, obj, key_word, parent=None):
+ super(SearchThread, self).__init__(parent)
+ self.site = obj.site
+ self.key = key_word
+ self.to_append_result.connect(obj.do_append_result)
+ self.to_stop_search.connect(obj.do_stop_search)
+
+ def run(self):
+ if not self.key:
+ return
+ search = self.site(self.to_append_result)
+ search.search(self.key)
+ self.to_stop_search.emit()
diff --git a/window.py b/window.py
new file mode 100644
index 0000000..ef74d0f
--- /dev/null
+++ b/window.py
@@ -0,0 +1,69 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file './qt/mainwindow.ui'
+#
+# Created by: PyQt5 UI code generator 5.10
+#
+# WARNING! All changes made in this file will be lost!
+
+from PyQt5 import QtCore, QtGui, QtWidgets
+
+class Ui_MainWindow(object):
+ def setupUi(self, MainWindow):
+ MainWindow.setObjectName("MainWindow")
+ MainWindow.resize(750, 600)
+ MainWindow.setMinimumSize(QtCore.QSize(750, 600))
+ MainWindow.setMaximumSize(QtCore.QSize(750, 600))
+ self.centralWidget = QtWidgets.QWidget(MainWindow)
+ self.centralWidget.setObjectName("centralWidget")
+ self.gridLayout = QtWidgets.QGridLayout(self.centralWidget)
+ self.gridLayout.setContentsMargins(11, 11, 11, 11)
+ self.gridLayout.setSpacing(6)
+ self.gridLayout.setObjectName("gridLayout")
+ self.tb_result = QtWidgets.QTableWidget(self.centralWidget)
+ self.tb_result.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
+ self.tb_result.setProperty("showDropIndicator", False)
+ self.tb_result.setDragDropOverwriteMode(False)
+ self.tb_result.setSelectionMode(QtWidgets.QAbstractItemView.SingleSelection)
+ self.tb_result.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
+ self.tb_result.setObjectName("tb_result")
+ self.tb_result.setColumnCount(3)
+ self.tb_result.setRowCount(0)
+ item = QtWidgets.QTableWidgetItem()
+ self.tb_result.setHorizontalHeaderItem(0, item)
+ item = QtWidgets.QTableWidgetItem()
+ self.tb_result.setHorizontalHeaderItem(1, item)
+ item = QtWidgets.QTableWidgetItem()
+ self.tb_result.setHorizontalHeaderItem(2, item)
+ self.gridLayout.addWidget(self.tb_result, 1, 0, 1, 3)
+ self.btn_search = QtWidgets.QPushButton(self.centralWidget)
+ self.btn_search.setObjectName("btn_search")
+ self.gridLayout.addWidget(self.btn_search, 0, 1, 1, 1)
+ self.ln_key = QtWidgets.QLineEdit(self.centralWidget)
+ self.ln_key.setObjectName("ln_key")
+ self.gridLayout.addWidget(self.ln_key, 0, 2, 1, 1)
+ self.cb_source = QtWidgets.QComboBox(self.centralWidget)
+ self.cb_source.setObjectName("cb_source")
+ self.gridLayout.addWidget(self.cb_source, 0, 0, 1, 1)
+ MainWindow.setCentralWidget(self.centralWidget)
+ self.state = QtWidgets.QStatusBar(MainWindow)
+ self.state.setObjectName("state")
+ MainWindow.setStatusBar(self.state)
+
+ self.retranslateUi(MainWindow)
+ QtCore.QMetaObject.connectSlotsByName(MainWindow)
+ MainWindow.setTabOrder(self.cb_source, self.btn_search)
+ MainWindow.setTabOrder(self.btn_search, self.ln_key)
+ MainWindow.setTabOrder(self.ln_key, self.tb_result)
+
+ def retranslateUi(self, MainWindow):
+ _translate = QtCore.QCoreApplication.translate
+ MainWindow.setWindowTitle(_translate("MainWindow", "BTSearcher"))
+ item = self.tb_result.horizontalHeaderItem(0)
+ item.setText(_translate("MainWindow", "热度"))
+ item = self.tb_result.horizontalHeaderItem(1)
+ item.setText(_translate("MainWindow", "大小"))
+ item = self.tb_result.horizontalHeaderItem(2)
+ item.setText(_translate("MainWindow", "文件名"))
+ self.btn_search.setText(_translate("MainWindow", "Search"))
+