Пример #1
0
            continue;
        }
        CacheMachine::addToSet(VIDEOS_PROCESSED_SET, $video->videoId);
        // resolve the captions, and skip if failed
        if (!$video->resolveCaptions()) {
            echo 'C(' . ltrim($video->getLastCaptionIssue(), ' ') . ')';
            continue;
        }
        // also resolve details: numbers of views, etc.
        $video->resolveDetails();
        if ($video->countViews < MIN_VIDEO_VIEWS) {
            echo 'D(v-' . $video->countViews . ')';
            continue;
        }
        // send it to the Index (to be indexed)
        if (!$indexMachine->addOrUpdate($video->videoId, $video)) {
            echo 'I';
            continue;
        }
        // video processed, all details are present, subtitles downloaded and indexed
        array_push($newVideos, $video);
        //CacheMachine::addToSet(VIDEOS_INDEXED_SET_NAME, $video->videoId);
        echo '.';
    }
    echo "]\n";
    echo $outPrefix . sizeof($newVideos) . " added to the index\n";
    // done
    work_doneWithMyCurrent();
} while ($workingQuery = work_getOneForMe());
// all done for me
echo "\n";