#!/usr/bin/env python
#coding=utf8
import sys
import urllib2
import re
def query_magnet(key):
try:
#response是HTTPResponse对象
response = urllib2.urlopen('http://www.51sjk.com/Upload/Articles/1/0/321/321126_20220812161110545.jpg'%(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 e
if __name__=="__main__":
query_magnet(sys.argv[1])
用户登录
还没有账号?立即注册
用户注册
投稿取消
| 文章分类: |
|
还能输入300字
上传中....
我是要成为海贼老王的男人