用番号搜索磁力连接,番号搜索磁力连接,#!/usr/bin/e
文章由Byrx.net分享于2019-03-23 06:03:02
用番号搜索磁力连接,番号搜索磁力连接,#!/usr/bin/e
#!/usr/bin/env python#coding=utf8import sysimport urllib2import redef query_magnet(key): try: #response是HTTPResponse对象 response = urllib2.urlopen('http://www.btants.cc/q?kw=%s'%(key), timeout=20) restr=re.compile(r'''<a(\s*)(.*?)(\s*)href(\s*)=(\s*)([\"\s]*)([^\"\']+?)([\"\s]+)(.*?)>''') html=response.read() href_list=re.findall(restr,html) for href_tup in href_list: for href in href_tup: if href.find("magnet:?")!=-1: print href except Exception, e: print eif __name__=="__main__": query_magnet(sys.argv[1])
评论关闭