Welcome to the heart of YouTrend’s data-gathering prowess – the Scraper module. This essential component empowers you to delve deep into the YouTube trending landscape by collecting and parsing data from the Google YouTube API. Harnessing the capabilities of Python, requests, and pandas, our Scraper module ensures you have access to a rich dataset, enabling you to derive valuable insights and make informed decisions.
post_request_ytb(country_code_list, trending_type_dict)country_code_list: List of countries from which to retrieve trending videos.trending_type_dict: Dictionary of different video categories to retrieve.collect_video_data(video_list, data_dictionary, trending_type, country_code)video_list: List of videos retrieved using the post_request_ytb function.data_dictionary: Dictionary containing YouTube data to be updated in place.trending_type: Code corresponding to different categories in trending videos.country_code: Code corresponding to the country from which the videos are scraped.collect_short_data(shorts_list, data_dictionary, country_code)shorts_list: List of shorts retrieved using the post_request_ytb function.data_dictionary: Dictionary containing YouTube data to be updated in place.country_code: Code corresponding to the country from which the videos are scraped.add_now_videos_shorts(response_dict, data_dictionary)data_dictionary dictionary with trending videos and shorts from YouTube.response_dict: Dictionary containing the response to the HTTP post request.data_dictionary: Dictionary containing YouTube data to be updated in place.add_other_sections(response_dict, data_dictionary)data_dictionary dictionary with trending videos from categories other than “Now.”response_dict: Dictionary containing the response to the HTTP post request.data_dictionary: Dictionary containing YouTube data to be updated in place.update_video_data(data_dictionary)data_dictionary in place with information on individual videos.data_dictionary: Dictionary containing YouTube data to be updated in place.update_meta_data(data_dictionary)data_dictionary in place with metadata information on individual videos.data_dictionary: Dictionary containing YouTube data to be updated in place.data_dictionary to be filled.post_request_ytb, add_now_videos_shorts, and add_other_sections functions.data_dictionary with individual data by calling update_video_data and update_meta_data functions..csv file within the /data directory.Unleash the power of data-driven decision-making with YouTrend’s Scraper module. Dive into the world of YouTube trending with confidence!