Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Commit

Permalink
fix yaml format reading
Browse files Browse the repository at this point in the history
  • Loading branch information
Toperlock authored Sep 19, 2023
1 parent 2dee871 commit ceefd8f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import json,os,tool,time,requests,sys,urllib,re,importlib,argparse,tempfile,yaml
import json,os,tool,time,requests,sys,urllib,re,importlib,argparse,tempfile,yaml,ruamel.yaml
from datetime import datetime
from urllib.parse import quote
from api.app import TEMP_DIR
Expand Down Expand Up @@ -163,8 +163,9 @@ def get_content_from_url(url,n=6):
response_text = tool.noblankLine(response_text)
return response_text
elif 'proxies' in response_text:
yaml = ruamel.yaml.YAML()
try:
response_text = yaml.safe_load(response.text)
response_text = dict(yaml.load(response.text))
except:
pass
else:
Expand Down

0 comments on commit ceefd8f

Please sign in to comment.