#import code
#code.interact(local=dict(globals(), **locals()))
try:
- self.title = slugify(soup.find_all('h1')[0].text.strip())
+ self.title = slugify(soup.find_all('h1')[0].text.strip())
except IndexError:
- logging.warning("No title found for thing {}".format(self.thing_id))
- self.title = self.thing_id
+ logging.warning(
+ "No title found for thing {}".format(self.thing_id))
+ self.title = self.thing_id
if req.status_code == 404:
- logging.warning("404 for thing {} - DMCA or invalid number?".format(self.thing_id))
- return
+ logging.warning(
+ "404 for thing {} - DMCA or invalid number?".format(self.thing_id))
+ return
if req.status_code > 299:
- logging.warning("bad status code {} for thing {} - try again later?".format(req.status_code, self.thing_id))
- return
+ logging.warning(
+ "bad status code {} for thing {} - try again later?".format(req.status_code, self.thing_id))
+ return
- self.download_dir = os.path.join(base_dir, self.title)
+ self.old_download_dir = os.path.join(base_dir, self.title)
+ self.download_dir = os.path.join(base_dir, "{} - {}".format(self.thing_id, self.title))
logging.debug("Parsing {} ({})".format(self.thing_id, self.title))