-
Notifications
You must be signed in to change notification settings - Fork 29
/
zooqle.py
36 lines (31 loc) · 959 Bytes
/
zooqle.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import json
from bs4 import BeautifulSoup as bs
import requests
import urllib.parse
import pyperclip
#import colored
#from colored import stylize
import re
def zooqle_search(query, doDownload):
url="https://zooqle.unblockit.top/search?q="+query
print("Searching......")
source=requests.get(url).text
soup=bs(source,'lxml')
magnet_results=soup.find_all('a',title='Magnet link',href=True)
# print(magnet_results)
i=1
for a in soup.find_all('a',class_=' small', href=True):
len(a)
print (i," :", a['href'][1:-11])
print()
i+=1
if doDownload == True:
index=int(input("Select one from the list below: \n"))
m=[]
for links in magnet_results:
m.append(links['href'])
magnet_link=m[index-1]
# print(magnet_link)
pyperclip.copy(magnet_link)
print("Magnet link of the selected movie is copied to clipboard!")
#zooqle_search(query)