mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-12-16 21:11:50 +03:00
Really fix kat search engine with python3
This commit is contained in:
parent
f369e22de0
commit
d740b051cb
1 changed files with 3 additions and 3 deletions
|
@ -22,7 +22,7 @@
|
||||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#VERSION: 1.32
|
#VERSION: 1.33
|
||||||
|
|
||||||
# Author:
|
# Author:
|
||||||
# Christophe DUMEZ (chris@qbittorrent.org)
|
# Christophe DUMEZ (chris@qbittorrent.org)
|
||||||
|
@ -64,9 +64,9 @@ def retrieve_url(url):
|
||||||
response = urllib.request.urlopen(url)
|
response = urllib.request.urlopen(url)
|
||||||
dat = response.read()
|
dat = response.read()
|
||||||
# Check if it is gzipped
|
# Check if it is gzipped
|
||||||
if dat[:2] == '\037\213':
|
if dat[:2] == b'\x1f\x8b':
|
||||||
# Data is gzip encoded, decode it
|
# Data is gzip encoded, decode it
|
||||||
compressedstream = StringIO.StringIO(dat)
|
compressedstream = io.BytesIO(dat)
|
||||||
gzipper = gzip.GzipFile(fileobj=compressedstream)
|
gzipper = gzip.GzipFile(fileobj=compressedstream)
|
||||||
extracted_data = gzipper.read()
|
extracted_data = gzipper.read()
|
||||||
dat = extracted_data
|
dat = extracted_data
|
||||||
|
|
Loading…
Reference in a new issue