Index: ahttp.py ================================================================== --- ahttp.py +++ ahttp.py @@ -86,14 +86,17 @@ if not content: return r elif binary: r = r.content else: - # Receival is actually happening here + # Manually decode charset if encoding: r.encoding = encoding - r = r.text + r = r.content.decode(encoding, errors='replace') + # See requests isse #2359, automatic charset detection can be awfully slow + else: + r = r.text # clean statusbar statusmsg and progress_feedback() return r Index: channels/xiph.py ================================================================== --- channels/xiph.py +++ channels/xiph.py @@ -146,11 +146,11 @@ if conf.xiph_source != "buffy": buffy = [] # Get XML blob if not buffy: - yp = ahttp.get(self.xml_url, statusmsg="Brace yourselves, still downloading the yp.xml blob.") + yp = ahttp.get(self.xml_url, encoding="utf-8", statusmsg="Brace yourselves, still downloading the yp.xml blob.") else: yp = "" self.status("Yes, XML parsing isn't much faster either.", timeout=20) for entry in xml.dom.minidom.parseString(yp).getElementsByTagName("entry"): buffy.append({ @@ -521,11 +521,11 @@ # Convert bitrate string or "Quality \d+" to integer def bitrate(str): uu = re.findall("(\d+)", str) if uu: - br = uu[0] + br = int(uu[0]) if br > 10: return int(br) else: return int(br * 25.6) else: