Skip to content

Commit eb01619

Browse files
committed
多进程的刷
1 parent ab93b9c commit eb01619

15 files changed

+1256
-5
lines changed
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
4+
"""
5+
利用代理IP刷点赞票(3366代理-多进程)
6+
author: gxcuizy
7+
date: 2021-03-25
8+
"""
9+
10+
import requests
11+
import time
12+
from bs4 import BeautifulSoup
13+
from multiprocessing import Process
14+
15+
16+
class ThreeSixProcess(Process):
17+
def __init__(self):
18+
# 继承Process类
19+
super(ThreeSixProcess, self).__init__()
20+
# 点赞接口地址
21+
self.api_url = 'http://638140.szyuansl.com/topfirst.php?g=Wap&m=Vote&a=ticket'
22+
# 点赞请求参数
23+
self.post_param = {'zid': '11883', 'vid': '237', 'token': 'WMFAUktmdTwiHtTe'}
24+
# 接口请求头信息
25+
self.header = {
26+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36 QBCore/4.0.1320.400 QQBrowser/9.0.2524.400 Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2875.116 Safari/537.36 NetType/WIFI MicroMessenger/7.0.20.1781(0x6700143B) WindowsWechat(0x63010200)',
27+
'Content-Type': 'application/x-www-form-urlencoded'
28+
}
29+
# 代理IP地址
30+
self.proxies = {}
31+
# 超时时间
32+
self.time_out = 20
33+
34+
def get_proxies_ip(self, ip_url):
35+
"""获取代理IP"""
36+
ip_request = requests.get(url=ip_url)
37+
html_content = ip_request.text
38+
soup = BeautifulSoup(html_content, 'html.parser')
39+
# IP列表
40+
tr_list = soup.select('table tbody tr')
41+
ip_list = []
42+
for tr in tr_list:
43+
td_info = tr.select('td')
44+
ip_host = td_info[0].text.strip()
45+
ip_port = td_info[1].text.strip()
46+
ip_base = '//' + ip_host + ':' + ip_port
47+
ip_list.append(ip_base)
48+
return ip_list
49+
50+
def print_msg(self, msg=''):
51+
"""打印信息"""
52+
now_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
53+
print('[' + now_time + '] ' + msg)
54+
55+
def run(self):
56+
"""执行程序"""
57+
while True:
58+
# 获取前11页
59+
page_list = range(1, 11)
60+
for page in page_list:
61+
request_url = 'http://www.ip3366.net/?stype=1&page=' + str(page)
62+
# 获取IP地址
63+
ip_list = self.get_proxies_ip(request_url)
64+
for ip_info in ip_list:
65+
self.proxies = {
66+
'http': 'http:' + ip_info,
67+
'https': 'https:' + ip_info
68+
}
69+
try:
70+
# 发送post请求
71+
request = requests.post(url=self.api_url, data=self.post_param, headers=self.header,
72+
proxies=self.proxies, timeout=self.time_out)
73+
response_text = request.text
74+
self.print_msg(response_text)
75+
except Exception as err_info:
76+
# 异常信息
77+
self.print_msg(str(err_info))
78+
79+
80+
# 程序主入口
81+
if __name__ == '__main__':
82+
# 获取运行的进程数
83+
process_num = input('请输入运行进程数:')
84+
process_list = []
85+
for i in range(int(process_num)):
86+
p = ThreeSixProcess()
87+
# star默认执行run()方法
88+
p.start()
89+
process_list.append(p)
90+
# 循环执行多进程
91+
for process in process_list:
92+
process.join()
93+
# 每个进程间隔10秒执行
94+
time.sleep(10)
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
4+
"""
5+
利用代理IP刷点赞票(89IP多进程)
6+
author: gxcuizy
7+
date: 2021-03-25
8+
"""
9+
10+
import requests
11+
import time
12+
from bs4 import BeautifulSoup
13+
from multiprocessing import Process
14+
15+
16+
class EightNineProcess(Process):
17+
def __init__(self):
18+
# 继承Process类
19+
super(EightNineProcess, self).__init__()
20+
# 点赞接口地址
21+
self.api_url = 'http://638140.szyuansl.com/topfirst.php?g=Wap&m=Vote&a=ticket'
22+
# 点赞请求参数
23+
self.post_param = {'zid': '11883', 'vid': '237', 'token': 'WMFAUktmdTwiHtTe'}
24+
# 接口请求头信息
25+
self.header = {
26+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36 QBCore/4.0.1320.400 QQBrowser/9.0.2524.400 Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2875.116 Safari/537.36 NetType/WIFI MicroMessenger/7.0.20.1781(0x6700143B) WindowsWechat(0x63010200)',
27+
'Content-Type': 'application/x-www-form-urlencoded'
28+
}
29+
# 代理IP地址
30+
self.proxies = {}
31+
# 超时时间
32+
self.time_out = 20
33+
34+
def get_proxies_ip(self, ip_url):
35+
"""获取代理IP"""
36+
ip_request = requests.get(url=ip_url)
37+
html_content = ip_request.content
38+
soup = BeautifulSoup(html_content, 'html.parser')
39+
# IP列表
40+
tr_list = soup.select('.layui-table tbody tr')
41+
ip_list = []
42+
for tr in tr_list:
43+
td_info = tr.select('td')
44+
ip_host = td_info[0].text.strip()
45+
ip_port = td_info[1].text.strip()
46+
ip_base = '//' + ip_host + ':' + ip_port
47+
ip_list.append(ip_base)
48+
return ip_list
49+
50+
def print_msg(self, msg=''):
51+
"""打印信息"""
52+
now_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
53+
print('[' + now_time + '] ' + msg)
54+
55+
def run(self):
56+
"""执行程序"""
57+
while True:
58+
# 获取前7页
59+
page_list = range(1, 7)
60+
for page in page_list:
61+
request_url = 'https://www.89ip.cn/index_' + str(page) + '.html'
62+
# 获取IP地址
63+
ip_list = self.get_proxies_ip(request_url)
64+
for ip_info in ip_list:
65+
self.proxies = {
66+
'http': 'http:' + ip_info,
67+
'https': 'https:' + ip_info
68+
}
69+
try:
70+
# 发送post请求
71+
request = requests.post(url=self.api_url, data=self.post_param, headers=self.header,
72+
proxies=self.proxies, timeout=self.time_out)
73+
response_text = request.text
74+
self.print_msg(response_text)
75+
except Exception as err_info:
76+
# 异常信息
77+
self.print_msg(str(err_info))
78+
79+
80+
# 程序主入口
81+
if __name__ == '__main__':
82+
# 获取运行的进程数
83+
process_num = input('请输入运行进程数:')
84+
process_list = []
85+
for i in range(int(process_num)):
86+
p = EightNineProcess()
87+
# star默认执行run()方法
88+
p.start()
89+
process_list.append(p)
90+
# 循环执行多进程
91+
for process in process_list:
92+
process.join()
93+
# 每个进程间隔10秒执行
94+
time.sleep(10)

微信点赞刷票/process/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
### 文件结构
2+
3+
```
4+
├── 89ip_process.py # 获取89代理的IP刷赞-多进程
5+
├── 3366_process.py # 获取3366代理的IP刷赞-多进程
6+
├── jiangxianli_process.py # 获取JiangXianLi代理的IP刷赞-多进程
7+
├── xiaohuan_process.py # 获取小幻代理的国际IP刷赞-多进程
8+
├── xiaohuan_china_process.py # 获取小幻代理的国内IP刷赞-多进程
9+
├── xiaoshu_process.py # 获取晓舒代理的IP刷赞-多进程
10+
```
11+
12+
### 刷赞方式
13+
14+
这种方式只要是刷无需登录且校验IP地址的活动,也就是,不同的IP地址的人就可以继续点赞,所以就需要寻找代理IP,然后抓取到点赞接口,利用代理IP去请求点赞接口即可达到刷赞的目的,具体的活动的接口接口的相关地址以及请求参数,可以利用`fildder`工具去抓取,然后模拟请求即可。
15+
16+
### 交流学习
17+
18+
如有写的不对或者错误的地方,希望大家指正,相互交流,谢谢。
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
4+
"""
5+
利用代理IP刷点赞票(飞猪代理-多进程)
6+
author: gxcuizy
7+
date: 2021-03-26
8+
"""
9+
10+
import requests
11+
from bs4 import BeautifulSoup
12+
import re
13+
import time
14+
from multiprocessing import Process
15+
16+
17+
class FeiZhuProcess(Process):
18+
def __init__(self):
19+
# 继承Process类
20+
super(FeiZhuProcess, self).__init__()
21+
# 点赞接口地址
22+
self.api_url = 'http://638140.szyuansl.com/topfirst.php?g=Wap&m=Vote&a=ticket'
23+
# 点赞请求参数
24+
self.post_param = {'zid': '11883', 'vid': '237', 'token': 'WMFAUktmdTwiHtTe'}
25+
# 接口请求头信息
26+
self.header = {
27+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36 QBCore/4.0.1320.400 QQBrowser/9.0.2524.400 Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2875.116 Safari/537.36 NetType/WIFI MicroMessenger/7.0.20.1781(0x6700143B) WindowsWechat(0x63010200)',
28+
'Content-Type': 'application/x-www-form-urlencoded'
29+
}
30+
# 代理IP地址
31+
self.proxies = {}
32+
# 超时时间
33+
self.time_out = 20
34+
35+
def get_proxies_ip(self, ip_url):
36+
"""获取代理IP"""
37+
ip_request = requests.get(url=ip_url)
38+
html_content = ip_request.text
39+
soup = BeautifulSoup(html_content, 'html.parser')
40+
# IP列表
41+
tr_list = soup.select('tbody tr')
42+
ip_list = []
43+
for tr in tr_list:
44+
td_info = tr.select('td')
45+
ip_host = td_info[0].text.strip()
46+
ip_port = td_info[1].text.strip()
47+
ip_base = '//' + ip_host + ':' + ip_port
48+
ip_list.append(ip_base)
49+
return ip_list
50+
51+
def print_msg(self, msg=''):
52+
"""打印信息"""
53+
now_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
54+
print('[' + now_time + '] ' + msg)
55+
56+
def run(self):
57+
"""执行程序"""
58+
while True:
59+
# 获取前20页
60+
page_list = range(1466, 1400, -1)
61+
for page in page_list:
62+
request_url = 'https://www.feizhuip.com/news-getInfo-id-' + str(page) + '.html'
63+
# 获取IP地址
64+
ip_list = self.get_proxies_ip(request_url)
65+
for ip_info in ip_list:
66+
self.proxies = {
67+
'http': 'http:' + ip_info,
68+
'https': 'https:' + ip_info
69+
}
70+
try:
71+
# 发送post请求
72+
request = requests.post(url=self.api_url, data=self.post_param, headers=self.header,
73+
proxies=self.proxies, timeout=self.time_out)
74+
response_text = request.text
75+
self.print_msg(response_text)
76+
except Exception as err_info:
77+
# 异常信息
78+
self.print_msg(str(err_info))
79+
80+
81+
# 程序主入口
82+
if __name__ == '__main__':
83+
# 获取运行的进程数
84+
process_num = input('请输入运行进程数:')
85+
process_list = []
86+
for i in range(int(process_num)):
87+
p = FeiZhuProcess()
88+
# star默认执行run()方法
89+
p.start()
90+
process_list.append(p)
91+
# 循环执行多进程
92+
for process in process_list:
93+
process.join()
94+
# 每个进程间隔10秒执行
95+
time.sleep(10)

0 commit comments

Comments
 (0)