宇宙主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

欧基零壹微头条IP归属甄别会员请立即修改密码
查看: 2644|回复: 12

PEE.CX 是哪个大佬的站?

[复制链接]
发表于 2018-1-8 13:17:59 | 显示全部楼层 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2018-1-8 13:26:41 | 显示全部楼层
  1. <meta charset="UTF-8">
  2. <script language="javascript">
  3. for(var i=0;i<=10;i++){
  4.     var link=document.createElement("img");
  5.     link.href="http://www.dounar.com/space-uid-"+Math.floor(10000 + Math.random() * (24000 - 10000))+".html";
  6.     document.head.appendChild(link);
  7. }
  8.   alert("刷分完毕");
  9. </script>
  10. <head/>
复制代码

就是这个
发表于 2018-1-8 13:24:29 | 显示全部楼层
py版本1
  1. #!/usr/bin/python
  2. #encoding=utf-8
  3. import requests
  4. from bs4 import BeautifulSoup
  5. import re
  6. import sys
  7. import datetime


  8. uid="username"   #用户名
  9. pwd="userpasswd"   #密码


  10. http = requests.Session()
  11. http.headers.update({
  12.     'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36'
  13.     ,'Accept-Language':"zh-CN,zh;q=0.8,ko;q=0.6,zh-TW;q=0.4"
  14. })
  15. #http.proxies = {"http":"http://127.0.0.1:8080","https":"http://127.0.0.1:8080"}

  16. ##打开登陆界面
  17. res=http.get("http://www.dounar.com/member.php?mod=logging&action=login&infloat=yes&handlekey=login&inajax=1&ajaxtarget=fwin_content_login")
  18. match=re.search(r'name="formhash" value="(\S+)"',res.text)
  19. if(match):
  20.     formhash=match.group(1)
  21. else:
  22.     exit(0)
  23.    
  24. ##登陆
  25. form={
  26.     "formhash":formhash
  27.     ,"referer":"http://www.dounar.com/thread-12949-1-1.html"
  28.     ,"loginfield":"username"
  29.     ,"username":uid
  30.     ,"password":pwd
  31.     ,"questionid":0
  32.     ,"answer":""
  33.     ,"loginsubmit":"true"
  34. }
  35. res=http.post("http://www.dounar.com/member.php?mod=logging&action=login&loginsubmit=yes&handlekey=login&loginhash=LWKbr&inajax=1",data=form)
  36. match=re.search(r"'uid':'",res.text)
  37. if(match):
  38.     print("登陆成功")
  39. else:
  40.     print("登陆失败")
  41.     exit(0)
  42. ##查询今天访问的空间数量  
  43. res=http.get("http://www.dounar.com/home.php?mod=spacecp&ac=credit&op=log&suboperation=creditrulelog")
  44. bs=BeautifulSoup(res.text,"html.parser")
  45. td=bs.find('td',string="访问别人空间")
  46. if(td==None):
  47.     print("信息获取失败")
  48.     exit(0)
  49. tds=td.parent.find_all("td")
  50. today_view_count=int(tds[2].text)    #今天已经翻牌数
  51. last_view_date=tds[5].text         #上次翻牌时间,这个时间不会自动刷新,所以不能仅仅依据数量就决定不翻牌
  52. need_view=last_view_date.find(datetime.datetime.now().strftime("%Y-%m-%d"))==-1    #上次翻牌时间是不是今天,不是今天则需要翻
  53. if(today_view_count>=10 and (not need_view)):       #不论数量多少,只要上次翻牌时间不是今天就翻。上次翻牌是今天才去判断数量
  54.     print("今日累了,明日再翻!")
  55.     exit(0)
  56. ##去首页获取等待临幸的网址
  57. res=http.get("http://www.dounar.com/forum-45-1.html")
  58. users   =re.findall("(space-uid\S+)"",res.text)
  59. viewed=set()
  60. num=0
  61. while num <13:
  62.     url = users.pop()
  63.     if(url in viewed):continue
  64.     viewed.add(url)
  65.     print(url)
  66.     res=http.get('http://www.dounar.com/'+url)
  67.     users.extend(re.findall("(space-uid\S+)"",res.text))
  68.     num+=1
  69.    
  70. print("今日累了,明日再翻!")
复制代码


py版本2
  1. #-*- coding=utf-8 -*-
  2. import requests
  3. import re
  4. import cookielib
  5. import sys

  6. index='http://www.dounar.com/'
  7. page_url='http://www.dounar.com/forum-45-1.html'
  8. credit_url='http://www.dounar.com/home.php?mod=spacecp&ac=credit&showcredit=1'
  9. login_url='http://www.dounar.com/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&inajax=1'
  10. login_data={
  11.         'fastloginfield':'username'
  12.         ,'username':''
  13.         ,'cookietime':'2592000'
  14.         ,'password':''
  15.         ,'quickforward':'yes'
  16.         ,'handlekey':'ls'
  17.     }
  18. headers={
  19.     'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
  20.     ,'Accept-Encoding':'gzip, deflate, sdch'
  21.     ,'Accept-Language':'zh-CN,zh;q=0.8,en;q=0.6'
  22.     ,'Host':'www.dounar.com'
  23.     ,'Referer':'http://www.dounar.com/forum.php'
  24.     ,'Upgrade-Insecure-Requests':'1'
  25.     ,'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36'
  26. }
  27.    
  28.    
  29. class HostLoc():
  30.     def __init__(self,username,passwd):
  31.         self.username=username
  32.         self.passwd=passwd
  33.         login_data['username']=username
  34.         login_data['password']=passwd
  35.         self.session=requests.Session()
  36.         self.session.headers=headers
  37.         self.login()
  38.         self.pass_jdkey()
  39.         

  40.     def pass_jdkey(self):
  41.         html=self.session.get(index).content
  42.         try:
  43.             jdkey=re.findall('jdfwkey=(.*?)"')[0]
  44.         except:
  45.             jdkey=''
  46.         url=index+'?jdfwkey='+jdkey
  47.         self.session.get(index)
  48.    
  49.     def login(self):
  50.         self.session.post(login_url,data=login_data)
  51.    
  52.     def isLogin(self):
  53.         url='http://www.dounar.com/home.php?mod=spacecp'
  54.         html=self.session.get(url).content
  55.         UserName=re.findall(self.username,html)
  56.         if len(UserName)==0:
  57.             return False
  58.         else:
  59.             return True

  60.     def get_credit(self):
  61.         html=self.session.get(credit_url).content
  62.         credit_pattern=re.compile(r'</ul><ul class="creditl mtm bbda cl"><li class="xi1 cl"><em> 金钱: </em>(.*?)  .*? </li>[\w\W]*?<li><em> 威望: </em>(.*?) </li>[\w\W]*?<li class="cl"><em>积分: </em>(.*?) <span class="xg1">')
  63.         try:
  64.             credit=credit_pattern.findall(html)
  65.             coin,wh,jf=credit[0]
  66.             print u"金币:%s,威望:%s,积分:%s"%(coin,wh,jf)
  67.             return True
  68.         except:
  69.             print u"获取数据失败,请稍后再试"
  70.             return False
  71.         
  72.     def get_user(self):
  73.         print('parse '+page_url)
  74.         self.html=self.session.get(page_url).content
  75.         user_pattern=re.compile('space-uid-\d+?.html')
  76.         users=list(set(user_pattern.findall(self.html)))
  77.         self.users=[index+i for i in users]

  78.     def visit_user(self):
  79.         for user in self.users[:10]:
  80.             print('visit user '+user)
  81.             self.session.get(user)
  82.      


  83. if __name__=='__main__':
  84.     username='' #用户名
  85.     passwd='' #密码
  86.     hostloc=HostLoc(username,passwd)
  87.     if hostloc.get_credit():
  88.         hostloc.get_user()
  89.         hostloc.visit_user()
  90.         hostloc.get_credit()
  91.     else:
  92.         sys.exit(0)
复制代码


py洁癖版(需要自己动手修改部分)
  1. import requests
  2. import time
  3. s = requests.Session()
  4. s.post("http://www.dounar.com/member.php", {'username':'XXXX', 'password': 'xxxxxx',})
  5. urls = ["http://www.dounar.com/space-uid-{}.html".format(str(i)) for i in range(10000, 24000)]
  6. for i in urls:
  7.     s.get(i)
  8.     time.sleep(3)
复制代码


php版
  1. <?php
  2. function login_post($url, $cookie, $post) {
  3.     $curl = curl_init();
  4.     curl_setopt($curl, CURLOPT_URL, $url);
  5.     curl_setopt($curl, CURLOPT_HEADER, 0);
  6.     curl_setopt($curl, CURLOPT_RETURNTRANSFER, 0);
  7.     curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie);
  8.     curl_setopt($curl, CURLOPT_POST, 1);
  9.     curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post));
  10.     curl_exec($curl);
  11.     curl_close($curl);
  12.    
  13. }
  14. function get_content($url, $cookie) {
  15.     $ch = curl_init();
  16.     curl_setopt($ch, CURLOPT_URL, $url);
  17.     curl_setopt($ch, CURLOPT_HEADER, 0);
  18.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  19.     curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
  20.     $rs = curl_exec($ch);
  21.     curl_close($ch);
  22.     return $rs;
  23. }
  24. $post = array(
  25.     'mod' => 'logging',
  26.     'action' => 'login',
  27.     'loginsubmit' => 'yes',
  28.     'infloat' => 'yes',
  29.     'lssubmit' => 'yes',
  30.     'username' => '账号',
  31.     'password' => '密码'
  32. );
  33. $url = "http://www.dounar.com/member.php";
  34. $cookie = dirname(__FILE__) . '/cookie_lochost.txt';
  35. login_post($url, $cookie, $post);
  36. for ($i = 0; $i <= 12; $i++) {
  37.     $url2 = "http://www.dounar.com/space-uid-" . rand(10000, 24000) . ".html";
  38.     $content = get_content($url2, $cookie);
  39.     echo $content;
  40. }
  41. ?>
复制代码


当然 还有exe版 我就不放了
发表于 2018-1-8 13:24:19 | 显示全部楼层
http://hunter.gitlab.io/app/hostloc/
 楼主| 发表于 2018-1-8 13:28:36 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2018-1-8 13:28:46 | 显示全部楼层
收藏一下代码
 楼主| 发表于 2018-1-8 13:34:16 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2018-1-8 13:37:09 | 显示全部楼层
救世主 发表于 2018-1-8 13:34
对对对,原来是大佬的站!看到 "刷分完毕" 就知道是你的了

大佬,这个代码怎么用?怎么和普通的网页代码 ...

都一样 会自动补全的
 楼主| 发表于 2018-1-8 13:38:34 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2018-1-8 13:38:41 | 显示全部楼层
救世主 发表于 2018-1-8 13:34
对对对,原来是大佬的站!看到 "刷分完毕" 就知道是你的了

大佬,这个代码怎么用?怎么和普通的网页代码 ...

都一样 会自动补全的
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|兜哪儿主机交流论坛

GMT+8, 2024-9-23 03:17 , Processed in 0.067497 second(s), 14 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表