Fix #4 - deal with bug in date parsing
authorOliver Matthews <oliver@codersoffortune.net>
Sun, 12 Apr 2020 11:02:53 +0000 (12:02 +0100)
committerOliver Matthews <oliver@codersoffortune.net>
Sun, 12 Apr 2020 11:02:53 +0000 (12:02 +0100)
README.md
thingy_grabber.py

index a17764a..6daf44b 100644 (file)
--- a/README.md
+++ b/README.md
@@ -85,6 +85,8 @@ python3, beautifulsoup4, requests, lxml
 - 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.1
+  - Fix bug on when all files were created / updated in October after the 9th.
 * v0.8.0
   - Updated to support new thingiverse front end
 * v0.7.0
index 5be21db..22d34c3 100755 (executable)
@@ -37,7 +37,7 @@ NO_WHITESPACE_REGEX = re.compile(r'[-\s]+')
 DOWNLOADER_COUNT = 1
 RETRY_COUNT = 3
 
-VERSION = "0.8.0"
+VERSION = "0.8.1"
 
 
 #BROWSER = webdriver.PhantomJS('./phantomjs')
@@ -318,7 +318,8 @@ class Thing:
                 
             #link_details will be something like '461 kb | Updated 06-11-2019 | 373 Downloads'
             #need to convert from M D Y to Y M D
-            link_date = [int(x) for x in link_details.split("|")[1][10:-1].split("-")]
+            link_date = [int(x) for x in link_details.split("|")[1].split()[-1].split("-")]
+            logging.error(link_details)
             try:
                 self._file_links.append(FileLink(link_title, datetime.datetime(link_date[2], link_date[0], link_date[1]), link_link))
             except ValueError: