Created
December 15, 2018 02:25
-
-
Save zhusaidong/70afa829aefce75d60777b73c3cbc2a4 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python | |
# -*- coding: UTF-8 -*- | |
''' | |
解析 app.baiyug.cn | |
@author zhusaidong [zhusaidong@gmail.com] | |
''' | |
import json | |
import urllib | |
import urllib2 | |
def post(url,data): | |
response = urllib2.urlopen(urllib2.Request(url),urllib.urlencode(data)) | |
return response.read() | |
def getUrl(url): | |
#12小时前的key没有过期,应该可以一直用,不用再获取key了 | |
data = post('http://222.187.224.181:4466/api_g/api.php',{'time':'','key':'1e72c91e31c180d0ccf3429687b73add','key2':'','url':url}) | |
data = json.loads(data) | |
return data['url'] if data['success'] == 1 else none | |
url = 'http://v.qq.com/x/cover/bojb6fxtqh2ekw0.html' | |
print getUrl(url) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment