-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMaimemoClick.py
More file actions
28 lines (26 loc) · 938 Bytes
/
Copy pathMaimemoClick.py
File metadata and controls
28 lines (26 loc) · 938 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/python
# -*- coding: utf-8 -*-
import datetime
from ProxyCrawl import *
import requests
import time
uid = '2039695' # 用户ID,在签到页面可以看见
pid = 1023 # 每日主题的id,不是必须的,据我观察是每天递增的
pid += (datetime.datetime.now() - datetime.datetime(2017, 10, 20)).days
shared_url = 'http://www.maimemo.com/share/page/?uid=' + uid + '&pid=' + str(pid)
if __name__ == '__main__':
proxy_list = get_proxy_ip()
for proxy_ip in proxy_list:
if proxy_ip[4] == 's':
proxy_ip = {'https': proxy_ip}
else:
proxy_ip = {'http': proxy_ip}
try:
request = requests.get(shared_url, proxies=proxy_ip, timeout=2)
except:
continue
if request.status_code == 200:
print("通过", proxy_ip, "成功点击链接\n")
time.sleep(1)
else:
print("代理连接失败\n")