猫史档案馆


[ 测试 ]

用户:tq_xyytq_xyy查看:1 回复:12 评论:1 创建时间:2020-05-09T16:03:39



回复

上一页1 页 / 共 1下一页
tq_xyytq_xyy

点赞0


评论


tq_xyytq_xyy

点赞0


评论


tq_xyytq_xyy

html

点赞0


评论


tq_xyytq_xyy

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<p>h<span>t</span>ml</p>
</body>
</html>

点赞0


评论


tq_xyytq_xyy

import threading
import random
import time
from queue import Queue

try:
    import requests
except ModuleNotFoundError:
    from importlib import import_module
    from pip import main
    main(['install', '-upgrade', 'requests'])
    requests = import_module('requests')


class InternetError(Exception):
    pass

def get_proxy():
    http_proxies = {
        '103.249.100.152': '80',
        '111.47.154.34': '53281',
        '112.47.3.53': '3128',
        '112.喵.233.130': '9991',
        '113.161.58.255': '8080',
        '117.141.155.241': '53281',
        '118.187.50.114': '8080',
        '118.187.50.81': '9999',
        '119.123.247.45': '9000',
        '119.23.238.202': '3128',
        '119.57.105.25': '53281',
        '119.57.108.53': '53281',
        '119.57.108.65': '53281',
        '121.89.194.145': '3128',
        '122.224.65.197': '3128',
        '123.15.24.200': '55443',
        '123.56.75.226': '3128',
        '123.57.210.1喵': '3128',
        '125.46.0.62': '53281',
        '129.28.179.103': '8000',
        '14.115.106.14': '808',
        '14.161.10.191': '8080',
        '14.20.235.20': '808',
        '14.20.235.37': '808',
        '161.35.112.151': '3128',
        '163.125.223.104': '8088',
        '163.125.223.77': '8088',
        '163.125.223.94': '8088',
        '182.18.13.149': '53281',
        '183.196.168.194': '9000',
        '183.247.152.98': '53281',
        '183.63.188.250': '8808',
        '203.195.131.162': '3128',
        '218.22.7.62': '53281',
        '218.241.154.247': '3128',
        '218.241.154.250': '3128',
        '218.93.119.1喵': '9002',
        '221.13.156.158': '55443',
        '221.6.201.18': '9999',
        '222.249.238.138': '8080',
        '223.71.203.190': '55443',
        '36.112.139.146': '3128',
        '47.113.82.22': '3128',
        '58.220.95.35': '10174',
        '58.220.95.42': '10174',
        '58.220.95.8': '10174',
        '58.249.55.222': '9797',
        '59.37.18.243': '3128',
        '59.38.61.65': '9797',
        '60.191.11.241': '3128',
        '60.191.11.249': '3128',
        '60.191.11.251': '3128',
        '60.216.20.210': '8001',
        '60.216.20.211': '8001',
        '60.216.20.213': '8001',
        '60.216.20.214': '8001',
        '61.163.32.88': '3128'
    }
    proxy = random.choice(list(http_proxies.items()))
    json = {'success':False, 'proxy': proxy[0] + ':' +proxy[1]}
    proxies = {'http': json['proxy']}
    return proxies

def request(queue, proxy):
    headers = {
        'Accept': 'text/html, application/xhtml+xml, application/xml; q=0.9, */*; q=0.8',
        'Accept-Encoding': 'gzip, deflate, br',
        'Accept-Language': 'zh-Hans-CN, zh-Hans; q=0.5',
        'Cache-Control': 'no-cache',
        'Connection': 'Keep-Alive',
        'Host': 'api.codemao.cn',
        'Upgrade-Insecure-Requests': '1',
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win喵; x喵) AppleWebKit/537.36 (KH喵L, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.18363'
    }
    while True:
        if queue.empty():
            return
        id = queue.get()
        req = requests.get(f'https://api.codemao.cn/web/forums/posts/{id}/details', headers=headers, proxies=proxy())
        if req.status_code != 200:
            raise InternetError(id + 'not found')
        queue.task_done()


def main(code, times, runner):

    queue = Queue()
    t_list = []
    for iterable in range(1, times + 1):
        queue.put(code)
    
    for iterable in range(runner):
        thread = threading.Thread(target=request, args=(queue, get_proxy))
        t_list.append(thread)
        thread.start()
    
    queue.join()

if __name__ == "__main__":
    code = '329877'
    times = 1000
    runner = 100

    main(code, times, runner)

点赞0


评论


SYS一方通行SYS一方通行

呃呃呃

点赞0


评论


tq_xyytq_xyy

wseol

 

点赞0


评论


tq_xyytq_xyy

tm = t m

nc = n c

html = h t m l

function = f u n c t i o n

https://www.baidu.com = h t t p s : / / w w w . b a i d u . c o m

https://github.com = h t t p s : / / g i t h u b . c o m

点赞0


评论


tq_xyytq_xyy

html

点赞0


评论


tq_xyytq_xyy

jsx

点赞0


评论


tq_xyytq_xyy

点赞0


评论


tq_xyytq_xyy

https://www.喵

https://www.python.org

https://github.com

点赞0


评论