<commit_before><?php

 class YouTubeRetriever extends URLDataRetriever implements SearchDataRetriever, ItemDataRetriever
 {
    protected $DEFAULT_PARSER_CLASS='YouTubeDataParser';
    
 	private function setStandardFilters() {
 		if ($playlist = $this->getOption('playlist')) {
			$this->setBaseUrl('http://gdata.youtube.com/feeds/api/playlists/' . $playlist);
 		} else {
			$this->setBaseUrl('http://gdata.youtube.com/feeds/mobile/videos');
		}
		
        $this->addFilter('alt', 'jsonc'); //set the output format to json
        $this->addFilter('format', 6); //only return mobile videos
        $this->addFilter('v', 2); // version 2
        $this->addFilter('orderby', 'published');
    }
    
    public function search($searchTerms, &$response=null) {
        $this->setStandardFilters();
        $this->addFilter('q', $searchTerms); //set the query
        $this->addFilter('orderby', 'relevance');
        return $this->getData($response);
    }
    
    protected function init($args) {
        parent::init($args);
        if (isset($args['PLAYLIST']) && strlen($args['PLAYLIST'])) {
            $this->setOption('playlist', $args['PLAYLIST']);
        }<commit_msg>fixed a bug that prevented limiting search to the appropriate feed<commit_after><?php

 class YouTubeRetriever extends URLDataRetriever implements SearchDataRetriever, ItemDataRetriever
 {
    protected $DEFAULT_PARSER_CLASS='YouTubeDataParser';
    
 	private function setStandardFilters() {
 		if ($playlist = $this->getOption('playlist')) {
			$this->setBaseUrl('http://gdata.youtube.com/feeds/api/playlists/' . $playlist);
 		} else {
			$this->setBaseUrl('http://gdata.youtube.com/feeds/mobile/videos');
		}
		
        $this->addFilter('alt', 'jsonc'); //set the output format to json
        $this->addFilter('format', 6); //only return mobile videos
        $this->addFilter('v', 2); // version 2
        $this->addFilter('orderby', 'published');
    }
    
    public function search($searchTerms, &$response=null) {
        $this->addFilter('q', $searchTerms); //set the query
        $this->addFilter('orderby', 'relevance');
        return $this->getData($response);
    }
    
    protected function init($args) {
        parent::init($args);
        if (isset($args['PLAYLIST']) && strlen($args['PLAYLIST'])) {
            $this->setOption('playlist', $args['PLAYLIST']);
        }
{'fraction_non_alphanumeric': 0.16694772344013492, 'fraction_numerical': 0.002529510961214165, 'mean_word_length': 3.3701657458563536, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1053473', 'n_tokens_mistral': 736, 'n_tokens_neox': 709, 'n_words': 135}