Git Product home page Git Product logo

Comments (2)

mai1202 avatar mai1202 commented on June 18, 2024

可以用这个 Python 脚本自己生成 pr_ip.txt。

部署到服务器上,设置定时任务每天运行,然后将 ./cf_ddns/cf_ddns_cloudflare.sh 中第 95 行的https://cf.vbar.fun/zip_baipiao_eu_org/pr_ip.txt替换成自己的网址即可。

import requests
import zipfile
import os
import requests
import shutil

def download_and_extract():
    # Step 1: Download the zip file
    url = "https://zip.baipiao.eu.org/"
    response = requests.get(url)
    zip_file_path = "reversedIp.zip"

    with open(zip_file_path, "wb") as file:
        file.write(response.content)

    # Step 2: Extract the files from the zip
    extracted_files_dir = "./extracted_files/"
    os.makedirs(extracted_files_dir, exist_ok=True)

    with zipfile.ZipFile(zip_file_path, "r") as zip_ref:
        zip_ref.extractall(extracted_files_dir)

    # Step 3: Combine the text files into one file
    combined_file_path = "pr_ip.txt"

    with open(combined_file_path, "w") as combined_file:
        for root, dirs, files in os.walk(extracted_files_dir):
            for file in files:
                if file.endswith(".txt"):
                    file_path = os.path.join(root, file)
                    if "-80." in file or "-443." in file:
                        print(file, file_path)
                        with open(file_path, "r") as txt_file:
                            combined_file.write(txt_file.read())
                        
# Run the task once at the beginning
download_and_extract()

from cloudflarespeedtestddns.

mai1202 avatar mai1202 commented on June 18, 2024

https://github.com/mai1202/proxyIPsGetter

from cloudflarespeedtestddns.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.