diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b2a97aa --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +temp.py +__pycache__/ diff --git a/kickass.py b/kickass.py index 029b29e..cc124e4 100644 --- a/kickass.py +++ b/kickass.py @@ -2,28 +2,29 @@ import pyperclip import requests + def kickass_search(query, doDownload): - base_url="https://kickass.unblockit.top/search.php?q=" - url=base_url+query+'/' + base_url = "https://kickass.unblockit.top/search.php?q=" + url = base_url + query + '/' print("Searching......") - source=requests.get(url).text - soup=bs(source,'lxml') - name=soup.find_all('a', class_="cellMainLink") - results=[] - i=1 + source = requests.get(url).text + soup = bs(source, 'lxml') + name = soup.find_all('a', class_="cellMainLink") + results = [] + i = 1 for r in name: - print(i,r.text) - i=i+1 + print(i, r.text) + i = i + 1 - if doDownload == True: + if doDownload: print("Enter the Serial Number of the search item you like to download: ") - choice=int(input()) - print ("Fetching data.....") - magnet=soup.find_all('a', title="Torrent magnet link") - a=[] + choice = int(input()) + print("Fetching data.....") + magnet = soup.find_all('a', title="Torrent magnet link") + a = [] for m in magnet: a.append(m['href']) - magnet_link=(a[choice-1]) + magnet_link = (a[choice - 1]) print("Magnet Link of your selected choice has been fetched.") pyperclip.copy(magnet_link) - print ("Your magnet link is now in your clipboard.") + print("Your magnet link is now in your clipboard.") diff --git a/piratebay.py b/piratebay.py index 68b25dd..bb12baf 100644 --- a/piratebay.py +++ b/piratebay.py @@ -2,26 +2,28 @@ import pyperclip import requests + def piratebay_search(query, doDownload): - url='https://pirateproxy.gdn/search/'+query+'/0/99/0' + url = 'https://pirateproxy.gdn/search/' + query + '/0/99/0' print("Searching......") - source=requests.get(url).text - soup=bs(source,'lxml') - results=soup.find_all('div',class_='detName') - i=1 + source = requests.get(url).text + soup = bs(source, 'lxml') + results = soup.find_all('div', class_='detName') + i = 1 for r in results: - print(i,r.text) - i=i+1 + print(i, r.text) + i = i + 1 - if doDownload == True: + if doDownload: print("Enter the Serial Number of the search item you like to download: ") - choice=int(input()) - print ("Fetching data.....") - magnet_results=soup.find_all('a',title='Download this torrent using magnet') - a=[] + choice = int(input()) + print("Fetching data.....") + magnet_results = soup.find_all( + 'a', title='Download this torrent using magnet') + a = [] for m in magnet_results: a.append(m['href']) - magnet_link=(a[choice-1]) + magnet_link = (a[choice - 1]) print("Magnet Link of your selected choice has been fetched.") pyperclip.copy(magnet_link) - print ("Your magnet link is now in your clipboard.") + print("Your magnet link is now in your clipboard.") diff --git a/search.py b/search.py index d4c0251..18c47f1 100644 --- a/search.py +++ b/search.py @@ -6,17 +6,17 @@ import piratebay import spell -query=input("Enter your query\n") -query=str(spell.Check(query)) -print("Searching for :",query) +query = input("Enter your query\n") +query = str(spell.Check(query)) +print("Searching for :", query) -n=int(input("Enter your preferred Torrent Search Engine:\n 1: ThePirateBay\n 2: Kickass\n 3: Zooqle\n 4: All\n")) +n = int(input("Enter your preferred Torrent Search Engine:\n 1: ThePirateBay\n 2: Kickass\n 3: Zooqle\n 4: All\n")) -if n==1: +if n == 1: piratebay.piratebay_search(query, True) -elif n==2: +elif n == 2: kickass.kickass_search(query, True) -elif n==3: +elif n == 3: zooqle.zooqle_search(query, True) elif n == 4: print("Searching ThePirateBay") @@ -26,7 +26,7 @@ print("Searching Kickass") print("-----------------------") kickass.kickass_search(query, False) - + print("Searching Zooqle") print("-----------------------") zooqle.zooqle_search(query, False) diff --git a/zooqle.py b/zooqle.py index 12fa485..4b3dde6 100644 --- a/zooqle.py +++ b/zooqle.py @@ -1,36 +1,41 @@ -import json from bs4 import BeautifulSoup as bs -import requests -import urllib.parse import pyperclip -#import colored -#from colored import stylize -import re +import requests +# import json +# import urllib.parse +# 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 + url = "https://zooqle.unblockit.top/search?q=" + query + print("Searching......\n") + source = requests.get(url).text + soup = bs(source, 'lxml') + table_entries = soup.find_all('tr') + magnet_links = [] - 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!") + ind = 1 + + for i in table_entries: + if i.contents[1].text is not '': + print(ind, i.contents[1].text) + print() + ind += 1 + try: + magnet_links.append(i.contents[2].ul.contents[1].a['href']) + except: + pass + + if doDownload: + index = int(input("Select one from the list below: \n")) + print() + + magnet_link = magnet_links[index - 1] + # print(magnet_link) + pyperclip.copy(magnet_link) + print("Magnet link of the selected movie is copied to clipboard!") -#zooqle_search(query)