I don't see why your code snipplet doesn't work. But did not properly indent your code as follows?
Code:
class YourRecipe(BasicNewsRecipe):
...
def get_cover_url(self):
cover_url = "actual url"
return cover_url
....
Also, it could be useful to figure out the error message by running the ebook-convert command-line program installed with Calibre. Details are
here.