/private-bay Secret
Created
August 8, 2016 14:49
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyquery | |
import requests | |
import json | |
from lxml import html | |
from pyquery import PyQuery as pq | |
import re | |
SEARCH_WORD = 'shkd' | |
f = open( SEARCH_WORD + ".txt", "w") | |
def get_links(search_word, page_number): | |
try: | |
r = requests.get('http://pirateproxy.one/search/' + str(search_word) + '/' + str(page_number) + '/7/', verify=False) | |
content = r.content | |
d = pq(content) | |
for i in d('a'): | |
link = str(d(i).attr("href")) | |
magnet_link = re.findall(r"magnet.*", link) | |
if (len(magnet_link) > 0): | |
print >> f, magnet_link[0] | |
finally: | |
return '1' | |
#============================================================ | |
if __name__ == '__main__': | |
for page_number in range(0, 5): | |
get_links( SEARCH_WORD, page_number) | |
print "\n ==" + str(page_number) | |
print "\n\n===========done !!!! ===============" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment