| skipped 145 lines |
146 | 146 | | progress_bar.close() |
147 | 147 | | |
148 | 148 | | |
| 149 | + | def torch1(searchstr): |
| 150 | + | torch1_url = supported_engines['torch1'] + "/search?q={}&cmd=Search!" |
| 151 | + | |
| 152 | + | with tqdm(total=1, initial=0, desc="%20s" % "TORCH", unit="req", ascii=False, ncols=120, |
| 153 | + | bar_format=tqdm_bar_format) as progress_bar: |
| 154 | + | response = requests.get(torch1_url.format(quote(searchstr)), proxies=proxies, headers=random_headers()) |
| 155 | + | soup = BeautifulSoup(response.text, 'html5lib') |
| 156 | + | link_finder("torch1", soup) |
| 157 | + | progress_bar.update() |
| 158 | + | progress_bar.close() |
| 159 | + | |
| 160 | + | |
149 | 161 | | def darksearchio(searchstr): |
150 | 162 | | global result |
151 | 163 | | result['darksearchio'] = [] |
| skipped 899 lines |
1051 | 1063 | | append_link() |
1052 | 1064 | | |
1053 | 1065 | | if engine_str == "torch": |
| 1066 | + | for r in data_obj.select("dl > dt > a"): |
| 1067 | + | name = clear(r.get_text()) |
| 1068 | + | link = clear(r['href']) |
| 1069 | + | append_link() |
| 1070 | + | |
| 1071 | + | if engine_str == "torch1": |
1054 | 1072 | | for r in data_obj.select("dl > dt > a"): |
1055 | 1073 | | name = clear(r.get_text()) |
1056 | 1074 | | link = clear(r['href']) |
| skipped 113 lines |