Skip to content

Instantly share code, notes, and snippets.

@zhusaidong
Created December 15, 2018 02:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zhusaidong/70afa829aefce75d60777b73c3cbc2a4 to your computer and use it in GitHub Desktop.
Save zhusaidong/70afa829aefce75d60777b73c3cbc2a4 to your computer and use it in GitHub Desktop.
#!/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