Download the specified feed item
@param models\Download\Feed\DownloadFeedItem $DownloadFeedItem
@return bool
@throws \GuzzleHttp\Exception\GuzzleException
@throws \alphayax\freebox\Exception\FreeboxApiException
198
public function downloadFeedItem(models\Download\Feed\DownloadFeedItem $DownloadFeedItem)
    {
        $service = sprintf(self::API_DOWNLOAD_FEEDS_ITEMS_ITEM_DOWNLOAD, $DownloadFeedItem->getFeedId(), $DownloadFeedItem->getId());
        $rest    = $this->callService('POST', $service, $DownloadFeedItem);

        return $rest->getSuccess();
    }
1336893
public function download($url)
    {
        $context = $this->getContext($url);

        return file_get_contents($url, false, $context);
    }
461142
public function download()
    {
        if ( ! $this->exists() ) {
            throw new FileExistException('Remote template does not exist');
        }

        try {
            $result = $this->getSoapClient()->DownloadTemplate(array(
                'filename' => basename($this->getName()) ));

            return base64_decode($result->DownloadTemplateResult);
        } catch ( SoapException $ex ) {
            throw new DownloadException('Error while downloading the remote template from Livedocx service' , $ex);
        }
    }
779243
public function update( models\Download\Task $downloadTask){
        $rest = $this->getService( self::API_DOWNLOAD . $downloadTask->getId());
        $rest->PUT( $downloadTask);

        return $rest->getResult( models\Download\Task::class);
    }
492039
public function download()
    {
        foreach ($this->children as $child) {
            if ($child instanceof DownloadableClientInterface) {
                return $child->download();
            }
        }

        throw MissingDownloadableClientsException::create();
    }
277010
public function downloadFile($key, $downloadDir)
    {
        $targetPath = $downloadDir . DIRECTORY_SEPARATOR . $key;
        $path = $this->computePath($key);
        $this->fileSystem->copy($path, $targetPath);

        return $targetPath;
    }
1101361
public function update(UpdateFeedRequest $request, $id)
    {
        if(! class_exists($request->model)) return redirect()->back()->withInput()
            ->with('failed', 'This model does not exist. Please create model before updating feed.');

        $model = new $request->model;
        if(! method_exists($model, 'getFeedItems')) return redirect()->back()->withInput()
            ->with('failed', 'You must implement RssFeedInterface on your model before updating feed with new model');

        $feed = $this->feed->findOrFail($id);
        $feed->update($request->all());

        return redirect('admin/feeds');
    }
639662
def selective_download(name, oldest, newest):
    """"""
    if six.PY3:
        name = name.encode("utf-8")
    feed = resolve_name(name)
    if six.PY3:
        feed = feed.decode()
    d = feedparser.parse(feed)
    logger.debug(d)
    try:
        d.entries[int(oldest)]
    except IndexError:
        print("Error feed does not contain this many items.")
        print("Hitman thinks there are %d items in this feed." % len(d.entries))
        return
    for url in [q.enclosures[0]['href'] for q in d.entries[int(newest):int(oldest)]]:
        # iterate over urls in feed from newest to oldest feed items.
        url = str(url)
        with Database("downloads") as db:
            if url.split('/')[-1] not in db:
                # download(url, name, feed)
                with Database("settings") as settings:
                    if 'dl' in settings:
                        dl_dir = settings['dl']
                    else:
                        dl_dir = os.path.join(os.path.expanduser("~"), "Downloads")
                requests_get(url, dl_dir)
413828
public function addItem(Item $feedItem)
    {
        if ($feedItem->getVersion() != $this->version)
        {
            $msg = sprintf('Feed type mismatch: This instance can handle %s feeds only, but item for %s feeds given.', $this->version, $feedItem->getVersion());
            throw new \InvalidArgumentException($msg);
        }

        $this->items[] = $feedItem;

        return $this;
    }
760518
public function refreshFeed($downloadFeedId){
        $service = sprintf( self::API_DOWNLOAD_FEEDS_ITEM_FETCH, $downloadFeedId);
        $rest = $this->getService( $service);
        $rest->POST();

        return $rest->getSuccess();
    }
589577
public static function getStories(\Newscoop\IngestPluginBundle\Entity\Feed $feedEntity)
    {
        $feed = new SimplePie();
        $feed->set_feed_url($feedEntity->getUrl());
        $feed->set_cache_location(sprintf('%s/../../../../cache', __DIR__));

        $feedInitialized = $feed->init();

        if (!$feedInitialized) {
            throw new \Exception($feed->error());
        }

        $items = $feed->get_items();

        $entries = array();
        foreach ($items as $item) {
            $entries[] = new RFCRSSParser($item);
        }

        return array_reverse($entries);
    }
161940
public function getAllFromDownloadTaskId( $downloadTaskId) {
        $service = sprintf( self::API_DOWNLOAD_ITEM_BLACKLIST, $downloadTaskId);
        $rest = $this->getService( $service);
        $rest->GET();

        return $rest->getResultAsArray( models\Download\BlackListEntry::class);
    }
358261
public function onDownload(DownloadResourceEvent $event)
    {
        /** @var File $file */
        $file = $event->getResource();

        $event->setItem(
            $this->filesDir.DIRECTORY_SEPARATOR.$file->getHashName()
        );

        $event->stopPropagation();
    }
1280018
public function download($filename)
    {
        return $this->response->withFile($this->getPath($filename, false), ['download' => true]);
    }
167534
public function removeFeed( $downloadFeedId){
        $service = sprintf( self::API_DOWNLOAD_FEEDS_ITEM, $downloadFeedId);
        $rest = $this->getService( $service);
        $rest->DELETE();

        return $rest->getSuccess();
    }
772715
public function download()
    {
        try {
            $result = $this->getSoapClient()->DownloadImage(array(
                'filename' => basename($this->filename) ,
            ));

            return base64_decode($result->DownloadImageResult);
        } catch ( SoapException $e ) {
            throw new DownloadException('Error while downloading the image' , $e);
        }
    }
453767
public function getFromId( $download_id){
        $rest = $this->getService( self::API_DOWNLOAD . $download_id);
        $rest->GET();

        return $rest->getResult( models\Download\Task::class);
    }