From 1abdbb3899d87b8b060eda0b4eb302bb3adfc002 Mon Sep 17 00:00:00 2001 From: sky1ab <72817511+sky1ab@users.noreply.github.com> Date: Sun, 25 Oct 2020 02:51:15 +0100 Subject: [PATCH] fix for urllib issues recent tls changes on srrdb.com broke API search --- resce.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resce.py b/resce.py index d6d68d0..2a2d0d8 100755 --- a/resce.py +++ b/resce.py @@ -6,7 +6,7 @@ # This file is part of rescepy. # -import argparse,json,os,re,shutil,socket,sys,urllib,zlib +import argparse,json,os,re,shutil,socket,sys,urllib,urllib2,zlib from rescepy.cfv import CFV from rescepy.srr import SRR @@ -427,7 +427,7 @@ def srrdbget(dirname, srrdir): sys.stdout.flush() try: socket.setdefaulttimeout(30) - urllib.urlretrieve('http://www.srrdb.com/download/srr/%s' % (dirname), srrfile) + urllib.urlretrieve('https://www.srrdb.com/download/srr/%s' % (dirname), srrfile) except: if len(str(sys.exc_info()[1])) > 0: print sys.exc_info()[1] @@ -459,7 +459,7 @@ def srrdbidentify(crc): sys.stdout.flush() try: socket.setdefaulttimeout(30) - response = json.load(urllib.urlopen('http://www.srrdb.com/api/search/archive-crc:%s' % (crc))) + response = json.load(urllib2.urlopen('https://www.srrdb.com/api/search/archive-crc:%s' % (crc))) except: if len(str(sys.exc_info()[1])) > 0: print sys.exc_info()[1]