It happens that when downloading an XMTV file the download gets stuck.
The total EPGimport routine comes then to an halt, and the only way to abort this is restarting enigma.
Lately I discovered that sometimes this is caused by some of the download sites.
Contact has been made, a download requested, but nothing is transferred. Result: hung EPGimport.
From my limited knowledge of python, these are the statements for the download:
def fetchUrl(self, filename): if filename.startswith('http:') or filename.startswith('https:') or filename.startswith('ftp:'): self.do_download(filename, self.afterDownload, self.downloadFail) else: self.afterDownload(None, filename, deleteFile=False)
def do_download(self, sourcefile, afterDownload, downloadFail): path = bigStorage(9000000, '/tmp', '/media/cf', '/media/mmc', '/media/usb', '/media/hdd') filename = os.path.join(path, 'epgimport') ext = os.path.splitext(sourcefile)[1] # Keep sensible extension, in particular the compression type if ext and len(ext) < 6: filename += ext sourcefile = sourcefile.encode('utf-8') sslcf = SNIFactory(sourcefile) if sourcefile.startswith('https:') else None print>>log, "[EPGImport] Downloading: " + sourcefile + " to local path: " + filename if self.source.nocheck == 1: print>>log, "[EPGImport] Not cheching the server since nocheck is set for it: " + sourcefile downloadPage(sourcefile, filename, contextFactory=sslcf).addCallbacks(afterDownload, downloadFail, callbackArgs=(filename, True)) return filename else: if self.checkValidServer(sourcefile) == 1: downloadPage(sourcefile, filename, contextFactory=sslcf).addCallbacks(afterDownload, downloadFail, callbackArgs=(filename, True)) return filename else: self.downloadFail("checkValidServer reject the server")
No time-out has been defined.
I had the same thing happening when updating the downloadsites.
Connecting to the site, but no upload. curl kept on trying forever. And the rest of the uploads never happened.
I solved this problem by adding the option --max-time 90 to the curl statement for the upload (and download of the folder contents - to determine the changed files)
This 90 is 90 seconds.
Of course when the file won't upload, the file is not updated. But it is updated on the other downloadsites.
My request:
Provide for the file download in EPGimport a time-out. 90 seconds will niceley do.
And when a file download times out, treat this as a failed download, so EPGimport knows it has to skip this source and go to the next source for this file.
PS: My python knowledge is very limited.
Edited by doglover, 1 July 2022 - 15:22.