mirror of
https://github.com/rembo10/headphones.git
synced 2026-07-22 00:44:00 +01:00
Bugfixes
This commit is contained in:
@@ -609,12 +609,12 @@ def request_response(url, method="get", auto_raise=True, whitelist_status_code=N
|
|||||||
whitelist_status_code = [whitelist_status_code]
|
whitelist_status_code = [whitelist_status_code]
|
||||||
|
|
||||||
# Map method to the request.XXX method. This is a simple hack, but it allows
|
# Map method to the request.XXX method. This is a simple hack, but it allows
|
||||||
# requests to apply more magic per method. See it's source.
|
# requests to apply more magic per method. See lib/requests/api.py.
|
||||||
request_method = requests[method.lower()]
|
request_method = getattr(requests, method)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Request the URL
|
# Request the URL
|
||||||
logger.debug("Requesting URL via %s method: %s", method, url)
|
logger.debug("Requesting URL via %s method: %s", method.upper(), url)
|
||||||
response = request_method(url, **kwargs)
|
response = request_method(url, **kwargs)
|
||||||
|
|
||||||
# If status code != OK, then raise exception, except if the status code
|
# If status code != OK, then raise exception, except if the status code
|
||||||
@@ -649,7 +649,7 @@ def request_soup(url, **kwargs):
|
|||||||
response = request_response(url, **kwargs)
|
response = request_response(url, **kwargs)
|
||||||
|
|
||||||
if response is not None:
|
if response is not None:
|
||||||
return BeautifulSoup(response.content)
|
return BeautifulSoup(response.content, "html5lib")
|
||||||
|
|
||||||
def request_minidom(url, **kwargs):
|
def request_minidom(url, **kwargs):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -1133,10 +1133,9 @@ def searchTorrent(album, new=False, losslessOnly=False):
|
|||||||
timeout=20
|
timeout=20
|
||||||
)
|
)
|
||||||
|
|
||||||
# Process feed
|
# Process content
|
||||||
if data:
|
if data:
|
||||||
table = data.find('table')
|
rows = data.select('table tr')
|
||||||
rows = table.findAll('tr')
|
|
||||||
|
|
||||||
if not rows or len(rows) == '1':
|
if not rows or len(rows) == '1':
|
||||||
logger.info(u"No results found from %s for %s" % (provider, term))
|
logger.info(u"No results found from %s for %s" % (provider, term))
|
||||||
|
|||||||
Reference in New Issue
Block a user