Jump to content

Recent problem with python workflow

Recommended Posts

Any ideas why the URL call from Python is failing?


Workflow in question: https://www.alfredforum.com/topic/8418-apple-music-search-with-alfred/


[14:30:20.771] Search Apple Music[Script Filter] Queuing argument 'charlatans'
[14:30:21.205] Search Apple Music[Script Filter] Script with argv '(null)' finished
[14:30:21.208] ERROR: Search Apple Music[Script Filter] Code 1: Traceback (most recent call last):
  File "album.py", line 33, in <module>
    data = urllib.urlopen(url, params).read()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 89, in urlopen
    return opener.open(url, data)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 215, in open
    return getattr(self, name)(url, data)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 460, in open_https
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 379, in http_error
    result = method(url, fp, errcode, errmsg, headers, data)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 673, in http_error_301
    return self.http_error_302(url, fp, errcode, errmsg, headers, data)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 642, in http_error_302
    headers, data)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 669, in redirect_internal
    return self.open(newurl)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 213, in open
    return getattr(self, name)(url)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 443, in open_https
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1038, in endheaders
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 882, in _send_output
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 844, in send
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1255, in connect
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 821, in connect
    self.timeout, self.source_address)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 557, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
IOError: [Errno socket error] [Errno 8] nodename nor servname provided, or not known


Link to post

Apple's server redirects to a different server that isn't responding. The error Python is throwing normally happens when it can't find the server by name (i.e. DNS resolution error). In this case, it might be because the server it's being redirected to doesn't have a hostname (it's just an IP address), but it's using HTTPS, which technically require a hostname, not an IP address.

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...