def downloadVideoFromShortUrlAsync(self, shortUrl): try: url = yield transformShortUrlAsync(shortUrl) video = yield downloadVideoFromUrlAsync(url) self.storeVideo(video) except BaseException, e: print "[%d] exception:" % self.__count, e
def downloadVideoFromUrl(url): d = downloadVideoFromUrlAsync(url) def errDownloadVideoFromUrl(err): print "[%d] exception:" % self.__count, err d.addCallbacks(lambda v: self.storeVideo(v), errDownloadVideoFromUrl)