- If there is an updated file, the old directory will be moved to `name_timestamp` where `timestamp` is the last upload time of the old files. The code will then copy unchanged files across and download any new ones.
## Changelog
+* v0.8.6
+ - Handle thingiverse returning no files for a thing gracefully.
* v0.8.5
- Strip '.'s from the end of filenames
- If you fail a download for an already failed download it no longer throws an exception
MAX_PATH_LENGTH = 250
-VERSION = "0.8.5"
+VERSION = "0.8.6"
#BROWSER = webdriver.PhantomJS('./phantomjs')
self.title = pc.title
self._file_links=[]
+ if not pc.files:
+ logging.error("No files found for thing {} - probably thingiverse being broken, try again later".format(self.thing_id))
for link in pc.files:
logging.debug("Parsing link: {}".format(link.text))
link_link = link.find_element_by_xpath(".//a").get_attribute("href")
print("{} - {} already downloaded - skipping.".format(self.thing_id, self.title))
return State.ALREADY_DOWNLOADED
+ if not self._file_links:
+ print("{} - {} appears to have no files. Thingiverse acting up again?".format(self.thing_id, self.title))
+ return State.FAILED
+
# Have we already downloaded some things?
timestamp_file = os.path.join(self.download_dir, 'timestamp.txt')
prev_dir = None