-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzooqle.py
20 lines (17 loc) · 848 Bytes
/
zooqle.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import requests
from bs4 import BeautifulSoup
import pprint
def zooqle(query):
url = "https://zooqle.unblockit.top/search?q=" + query
response = requests.get(url)
soup = BeautifulSoup(response.text, "html.parser")
tr = soup.select("div.panel-body tr")[1:]
titles = [item.a.text for item in tr]
magnets = soup.find_all(title = "Magnet link")
size = soup.find_all(class_ = "progress-bar prog-blue prog-l")
seeders = soup.find_all(class_ = "progress-bar smaller prog-green prog-l")
leechers = soup.find_all(class_ = "progress-bar smaller prog-yellow prog-r")
data = []
for i in range(len(tr)):
data.append({"Index": i+1, "Title": titles[i], "Size": size[i].text, "Seeders / Leechers": seeders[i].text + " / " + leechers[i].text, "Magnet": magnets[i]["href"]})
return data