code: def download_storyitem(self, item: StoryItem, target: str) -> bool:
          
  
          date_local = item.date_local
          dirname = _PostPathFormatter(item).format(self.dirname_pattern, target=target)
          filename = dirname + '/' + self.format_filename(item, target=target)
          os.makedirs(os.path.dirname(filename), exist_ok=True)
          downloaded = False
          if not item.is_video or self.download_video_thumbnails is True:
              url = item.url
              downloaded = self.download_pic(filename=filename, url=url, mtime=date_local)
          if item.is_video and self.download_videos is True:
              downloaded |= self.download_pic(filename=filename, url=item.video_url, mtime=date_local)
          # Save caption if desired
          metadata_string = _ArbitraryItemFormatter(item).format(self.storyitem_metadata_txt_pattern).strip()
          if metadata_string:
              self.save_caption(filename=filename, mtime=item.date_local, caption=metadata_string)
          # Save metadata as JSON if desired.
          if self.save_metadata is not False:
              self.save_metadata_json(filename, item)
          self.context.log()
          return downloaded
docs: Download one user story.
  
          :param item: Story item, as in story['items'] for story in :meth:`get_stories`
          :param target: Replacement for {target} in dirname_pattern and filename_pattern
          :return: True if something was downloaded, False otherwise, i.e. file was already there