Skip to content

Instantly share code, notes, and snippets.

@jzp113
Created May 10, 2016 09:39
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 jzp113/a524c82dfe79bdb4929463246b9cde0a to your computer and use it in GitHub Desktop.
Save jzp113/a524c82dfe79bdb4929463246b9cde0a to your computer and use it in GitHub Desktop.
#-*-coding=utf-8-*-
import requests
import re
import time
import random
page=1 #max=79
home='http://91porn.com/video.php?page=%d&category=rf'
cont_reg=re.compile('<a target=blank href="(http://91porn\.com/view_video\.php.*?)" title="')
vid_reg=re.compile('http://91\.p9p\.co/ev\.php\?VID=(.*?)<')
get_real='http://91.9p91.com/getfile_jw.php?VID='
real_reg=re.compile("<embed id='91' name='91' width='700' height='450' src='(.*?)'")
title_reg=re.compile('<title>([\w\W]*?)-')
vhead='http://91.9p91.com/9e.swf?autoplay=false&video_id=%s&mp4=999'
tr="<tr><td>%s</td><td><form target='_blank' action='hhhhhhhhplayer.html'><input type='hidden' name='url' value='%s'/> <input type='submit' value='view online'/></form></td></tr>\n"
data={'session_language':'cn_CN'
}
cont_queue=[]
vid_queue=[]
video_list=[]
for i in range(1,page+1):
url='http://91porn.com/video.php?page=%d&category=rf'%i
print 'start parse url: ' + url
try:
content=requests.post(url,data=data).content
list_=cont_reg.findall(content)
vid_queue.extend(list_)
except Exception,e:
print e
for i in vid_queue:
try:
print 'start parse url: ' + i
content=requests.post(i,data=data).content
video=vid_reg.findall(content)[0]
title=title_reg.findall(content)[0]
print video,title
apiurl=get_real+video
r=requests.get(apiurl).content
link=re.findall('file=(.*?mp4)&',r)[0]
print link
#video_list.append((title,vhead%video))
except Exception,e:
print e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment