Skip to content

Commit

Permalink
silence paramiko warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Toperlock committed Aug 8, 2024
1 parent daff55a commit 375cdbf
Show file tree
Hide file tree
Showing 17 changed files with 24 additions and 25 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ https://xxxxxxx.vercel.app/config/https://xxxxxxsubscribe?token=123456&file=2
python main.py
```

或者你可以直接带template_index参数选定模板,0表示第一个模板
或者你可以直接带template_index参数选定模板,0表示第一个模板(no flask不支持此参数)

```
python main.py --template_index=0
Expand Down
5 changes: 2 additions & 3 deletions api/app.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
from flask import Flask, render_template, request, redirect, url_for, flash, send_file, jsonify, Response
from urllib.parse import quote, urlparse, parse_qs, unquote
from flask import Flask, render_template, request, redirect, url_for, flash, jsonify, Response
from urllib.parse import quote, urlparse, unquote
import json
import os
import sys
import subprocess
import argparse # 添加 argparse 模块
import tempfile
import shutil
import tempfile # 导入 tempfile 模块
Expand Down
2 changes: 1 addition & 1 deletion instructions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ pip install -r requirements.txt
python main.py
```

or you can directly select the template with the `template_index`, `0` means the first template
or you can directly select the template with the `template_index`, `0` means the first template(no flask doesn't support)

```
python main.py --template_index=0
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import json, os, tool, time, requests, sys, urllib, importlib, argparse, yaml, ruamel.yaml
import json, os, tool, time, requests, sys, importlib, argparse, yaml, ruamel.yaml
import re
from datetime import datetime
from urllib.parse import urlparse
Expand Down
2 changes: 1 addition & 1 deletion parsers/http.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import tool,json,re,urllib,sys
import tool,re
from urllib.parse import urlparse, parse_qs, unquote
def parse(data):
info = data[:]
Expand Down
4 changes: 2 additions & 2 deletions parsers/https.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import tool,json,re,urllib,sys
from urllib.parse import urlparse, parse_qs, unquote
import tool,re
from urllib.parse import urlparse,unquote
def parse(data):
info = data[:]
server_info = urlparse(info)
Expand Down
2 changes: 1 addition & 1 deletion parsers/hysteria.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import tool,json,re,urllib,sys
import tool,re
from urllib.parse import urlparse, parse_qs, unquote

def parse(data):
Expand Down
2 changes: 1 addition & 1 deletion parsers/hysteria2.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import tool,json,re,urllib,sys
import tool,re
from urllib.parse import urlparse, parse_qs, unquote

def parse(data):
Expand Down
4 changes: 2 additions & 2 deletions parsers/socks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import tool,json,re,urllib,sys
from urllib.parse import urlparse, parse_qs, unquote
import tool,re
from urllib.parse import urlparse,unquote
def parse(data):
info = data[:]
server_info = urlparse(info)
Expand Down
2 changes: 1 addition & 1 deletion parsers/ss.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import tool,json,re,urllib,sys
import tool,json,re,urllib
from urllib.parse import parse_qs
def parse(data):
param = data[5:]
Expand Down
2 changes: 1 addition & 1 deletion parsers/ssr.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import tool,json,re,urllib,sys
import tool
def parse(data):
info = data[6:]
if not info or info.isspace():
Expand Down
2 changes: 1 addition & 1 deletion parsers/trojan.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import tool,json,re,urllib,sys
import tool,re
from urllib.parse import urlparse, parse_qs, unquote
def parse(data):
info = data[:]
Expand Down
4 changes: 2 additions & 2 deletions parsers/tuic.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import tool,json,re,urllib,sys
from urllib.parse import urlparse, parse_qs, unquote
import tool,re
from urllib.parse import urlparse, parse_qs
def parse(data):
info = data[:]
server_info = urlparse(info)
Expand Down
2 changes: 1 addition & 1 deletion parsers/vless.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import tool,json,re,urllib,sys
import tool,re
from urllib.parse import urlparse, parse_qs, unquote
def parse(data):
info = data[:]
Expand Down
4 changes: 2 additions & 2 deletions parsers/vmess.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import tool,json,re,urllib,sys
from urllib.parse import urlparse, parse_qs, unquote
import tool,json,re
from urllib.parse import urlparse, parse_qs
def parse(data):
info = data[8:]
if not info or info.isspace():
Expand Down
2 changes: 1 addition & 1 deletion parsers/wg.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import tool,json,re,urllib,sys
import tool,re
from urllib.parse import urlparse, parse_qs, unquote
def parse(data):
info = data[:]
Expand Down
6 changes: 3 additions & 3 deletions tool.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import urllib.parse,base64,requests,paramiko,random,string,re,chardet
import base64,requests,random,string,re,chardet
import warnings
from cryptography.utils import CryptographyDeprecationWarning
with warnings.catch_warnings(action="ignore", category=CryptographyDeprecationWarning):
from paramiko import SSHClient
import paramiko
from scp import SCPClient

def get_encoding(file):
Expand Down Expand Up @@ -314,7 +314,7 @@ def __init__(self,server:dict) -> None:
if k in server.keys():
self.server[k] = server[k]
def connect(self):
ssh = SSHClient()
ssh = paramiko.SSHClient()
ssh.load_system_host_keys()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(hostname=self.server['ip'],port=22, username=self.server['user'], password=self.server['password'])
Expand Down

0 comments on commit 375cdbf

Please sign in to comment.