<commit_before># -*- coding: utf-8 -*-
__author__ = 'xdc'

from PyQt5 import QtCore, QtGui, QtWidgets

from dialog import Ui_Dialog

import requests
from bs4 import BeautifulSoup as bs
import os

global MAGNET_HEAD,SEARCH_URL,TRANS_URL
MAGNET_HEAD = 'magnet:?xt=urn:btih:'
SEARCH_URL = 'http://www.bt2mag.com/search/'
TRANS_URL = 'http://magnet.vuze.com/magnetLookup'


class Ui(QtWidgets.QDialog):
    def __init__(self, parent=None):
        super(Ui, self).__init__(parent)
        self.ui = Ui_Dialog()
        self.ui.setupUi(self) #inittial
        self.ui.tableWidget.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) #read only
        self.ui.tableWidget.setSelectionMode(QtWidgets.QAbstractItemView.SingleSelection)#单个选择
        self.ui.tableWidget.setAlternatingRowColors(1) #隔行显示颜色

        self.result = []


    def search(self):
        key = self.ui.lineEdit.text()
        if len(key)==40:
            #composite link
            link = MAGNET_HEAD+key
        else:
            handle = NetHandler()
            self.result=handle.getMagnetLink(key) #search from web<commit_msg>update search url<commit_after># -*- coding: utf-8 -*-
__author__ = 'xdc'

from PyQt5 import QtCore, QtGui, QtWidgets

from dialog import Ui_Dialog

import requests
from bs4 import BeautifulSoup as bs
import os

global MAGNET_HEAD,SEARCH_URL,TRANS_URL
MAGNET_HEAD = 'magnet:?xt=urn:btih:'
SEARCH_URL = 'http://www.btaia.com/search/'
TRANS_URL = 'http://magnet.vuze.com/magnetLookup'


class Ui(QtWidgets.QDialog):
    def __init__(self, parent=None):
        super(Ui, self).__init__(parent)
        self.ui = Ui_Dialog()
        self.ui.setupUi(self) #inittial
        self.ui.tableWidget.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) #read only
        self.ui.tableWidget.setSelectionMode(QtWidgets.QAbstractItemView.SingleSelection)#单个选择
        self.ui.tableWidget.setAlternatingRowColors(1) #隔行显示颜色

        self.result = []


    def search(self):
        key = self.ui.lineEdit.text()
        if len(key)==40:
            #composite link
            link = MAGNET_HEAD+key
        else:
            handle = NetHandler()
            self.result=handle.getMagnetLink(key) #search from web
{'fraction_non_alphanumeric': 0.11106094808126411, 'fraction_numerical': 0.005869074492099322, 'mean_word_length': 3.1732580037664784, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7499716', 'n_tokens_mistral': 769, 'n_tokens_neox': 764, 'n_words': 137}