1
0
Fork 0
mirror of synced 2024-12-25 08:13:20 -05:00

Revert previous commit

This commit is contained in:
Wu Tingfeng 2023-01-02 00:49:49 +08:00
parent a8e4b7065a
commit 72e1499d27
No known key found for this signature in database

View file

@ -8,18 +8,12 @@ except ImportError:
import re import re
import shutil import shutil
import sys
import tempfile import tempfile
import urllib.request
import zipfile import zipfile
from io import BytesIO from io import BytesIO
from os import listdir, path from os import listdir, path
if sys.version_info.major > 2:
import urllib2 as request
else:
import urllib.request as request
# --- Globals ---------------------------------------------- # --- Globals ----------------------------------------------
PLUGINS = """ PLUGINS = """
auto-pairs https://github.com/jiangmiao/auto-pairs auto-pairs https://github.com/jiangmiao/auto-pairs
@ -79,7 +73,7 @@ SOURCE_DIR = path.join(path.dirname(__file__), "sources_non_forked_cache")
def download_extract_replace(plugin_name, zip_path, temp_dir, source_dir): def download_extract_replace(plugin_name, zip_path, temp_dir, source_dir):
# Download and extract file in temp dir # Download and extract file in temp dir
with request.urlopen(zip_path) as req: with urllib.request.urlopen(zip_path) as req:
zip_f = zipfile.ZipFile(BytesIO(req.read())) zip_f = zipfile.ZipFile(BytesIO(req.read()))
zip_f.extractall(temp_dir) zip_f.extractall(temp_dir)
content_disp = req.headers.get("Content-Disposition") content_disp = req.headers.get("Content-Disposition")