mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-25 14:04:23 +00:00
Fix kat.ph search with python3
This commit is contained in:
parent
64fd3044b1
commit
f369e22de0
@ -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.31
|
#VERSION: 1.32
|
||||||
|
|
||||||
# Author:
|
# Author:
|
||||||
# Christophe DUMEZ (chris@qbittorrent.org)
|
# Christophe DUMEZ (chris@qbittorrent.org)
|
||||||
@ -63,6 +63,13 @@ def retrieve_url(url):
|
|||||||
""" Return the content of the url page as a string """
|
""" Return the content of the url page as a string """
|
||||||
response = urllib.request.urlopen(url)
|
response = urllib.request.urlopen(url)
|
||||||
dat = response.read()
|
dat = response.read()
|
||||||
|
# Check if it is gzipped
|
||||||
|
if dat[:2] == '\037\213':
|
||||||
|
# Data is gzip encoded, decode it
|
||||||
|
compressedstream = StringIO.StringIO(dat)
|
||||||
|
gzipper = gzip.GzipFile(fileobj=compressedstream)
|
||||||
|
extracted_data = gzipper.read()
|
||||||
|
dat = extracted_data
|
||||||
info = response.info()
|
info = response.info()
|
||||||
charset = 'utf-8'
|
charset = 'utf-8'
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user