def test_api(self): url = youtube_tools.GenerateYouTubeURL("she is still sleeping SAO", meta_tags=None) video_ids = url.api(bestmatch=False) const.config.manual = False # API gives us 50 videos (or as requested) assert len(video_ids) == 50
def test_scrape(self): const.config.manual = True url = youtube_tools.GenerateYouTubeURL("she is still sleeping SAO", meta_tags=None) video_ids = url.scrape(bestmatch=False) # Web scraping gives us all videos on the 1st page assert len(video_ids) == 20