Skip to content

Instantly share code, notes, and snippets.

View nickfox-taterli's full-sized avatar
😰
想哭

Tater Li nickfox-taterli

😰
想哭
View GitHub Profile
@nickfox-taterli
nickfox-taterli / pt_auto.py
Created June 20, 2020 09:06
PT自动刷+GD上传
import json
import time
from datetime import datetime
import feedparser
import pymongo
import qbittorrentapi
import requests
# 需求:
@nickfox-taterli
nickfox-taterli / cf_speed.py
Created June 20, 2020 09:04
从Cloudflare下载速度测试
import io
import csv
import time
import requests
from urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning)
with open('cf_ips.txt') as fo:
with open('speedtest_result.csv','w')as fc:
@nickfox-taterli
nickfox-taterli / speedtest.py
Created June 20, 2020 09:01
Speedtest 作弊
#!/usr/bin/env python
import requests
import argparse
import sys
import hashlib
headers = {
'User-Agent': 'DrWhat Speedtest',
'Origin': 'https://c.speedtest.net',
'Referer': 'https://c.speedtest.net/flash/speedtest.swf'
from xml.dom.minidom import parse
import xml.dom.minidom
doc = xml.dom.minidom.parse("results-all.xml")
root = doc.documentElement
hosts = root.getElementsByTagName('host')
for host in hosts:
try:
ip = host.getElementsByTagName('address')[0].getAttribute('addr')
c = host.getElementsByTagName('ports')[0].getElementsByTagName('port')[0]. \
@nickfox-taterli
nickfox-taterli / cf_ips.txt
Created June 20, 2020 08:57
Cloudflare All Web Endpoint IP
This file has been truncated, but you can view the full file.
173.245.49.0
173.245.49.1
173.245.49.2
173.245.49.3
173.245.49.4
173.245.49.5
173.245.49.6
173.245.49.7
173.245.49.8
173.245.49.9
@nickfox-taterli
nickfox-taterli / cf_ips.txt
Created June 20, 2020 08:56
Cloudflare All Web Endpoint IP
This file has been truncated, but you can view the full file.
173.245.49.0
173.245.49.1
173.245.49.2
173.245.49.3
173.245.49.4
173.245.49.5
173.245.49.6
173.245.49.7
173.245.49.8
173.245.49.9
@nickfox-taterli
nickfox-taterli / uploader.py
Created June 20, 2020 08:50
无管理员OneDrive上传(进度条)
import json
import os
import requests
from progressbar import *
url = "https://zstueducn-my.sharepoint.com/:f:/g/personal/zywang_zstu_edu_cn/ElSrM9_2jD9IrsEwNoN0qyABAxhYvGgFCj0UpcjIf17W4g?e=S2XoVf"
tenant = url.split('/')[2]
mail = url.split('/')[6]
@nickfox-taterli
nickfox-taterli / numpy_sgd.py
Created June 20, 2020 08:48
Numpy SGD 实现
import numpy as np
def calc_mse(b, w, points):
totalError = 0
for i in range(0, len(points)):
x = points[i, 0]
y = points[i, 1]
totalError += (y - (w * x + b)) ** 2
return totalError / float(len(points))
@nickfox-taterli
nickfox-taterli / downloads.py
Created June 20, 2020 08:47
Python下载文件带进度
import requests
from contextlib import closing
def get_files(url,files):
with closing(requests.get(url, stream=True)) as response:
chunk_size = 1024 # 单次请求最大值
content_size = int(response.headers['Content-Length']) # 内容体总大小
data_count = 0
with open(files, "wb") as file:
for data in response.iter_content(chunk_size=chunk_size):
@nickfox-taterli
nickfox-taterli / downloads.py
Created June 18, 2020 05:10
NexusPHP 种子枚举下载
import urllib
import requests
import re
for i in range(4300):
try:
r = requests.get('https://pt.msg.vg/download.php?id='+ str(i) +'&passkey=xxx')
d = r.headers['content-disposition']
fname = re.findall("filename=(.+)", d)[0]
f = open('result.txt','a')