Example #1
0
 def download(self, post_id=None, post=None):
     if post:
         imgs = self.getImages(post)
     else:
         imgs, _ = self.view(post_id)
     downloadImages(imgs)
     return imgs
Example #2
0
 def download_pool(self, pool_id, jpeg=False):
     imgs, details = self.pool(pool_id, jpeg)
     pool_name = details['name']
     if not os.path.exists(DOWNLOAD_DIR + pool_name):
         os.makedirs(DOWNLOAD_DIR + pool_name)
     for key, img in enumerate(imgs):
         filename = str(key + 1)
         filename = '0' * (3 - len(filename)) + filename
         _, ext = self.parseUrl(img['url'])
         filename += ext
         downloadImages([{'url': img['url'], 'name': pool_name + '/' + filename}]) #TODO
Example #3
0
 def download_pool(self, pool_id, jpeg=False):
     imgs, details = self.pool(pool_id, jpeg)
     pool_name = details['name']
     if not os.path.exists(TEMP_DIR + pool_name):
         os.makedirs(TEMP_DIR + pool_name)
     for key, img in enumerate(imgs):
         filename = str(key + 1)
         filename = '0' * (3 - len(filename)) + filename
         _, ext = self.parseUrl(img.url)
         filename += ext
         img.name = pool_name + '/' + img.name
         downloadImages([img]) #TODO
Example #4
0
 def fetch(self, status_id):
     """Fetch & return tweet images and information."""
     tweet = self.getTweet(status_id)
     imgs = self.getImages(tweet)
     downloadImages(imgs)
     return imgs, tweet
Example #5
0
 def fetch(self, dynamic_id):
     """Fetch images and detail."""
     card = self.getDynamic(dynamic_id)
     imgs = self.getImages(card, dynamic_id)
     downloadImages(imgs)
     return imgs, card
Example #6
0
 def fetch(self, post_id):
     post = self.getPost(post_id)
     imgs = self.getImages(post)
     downloadImages(imgs)
     return imgs, post