CoolFace
Apppublic

Atharv91/audio_video_module

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes
category_mapper.py42 linesDownload Raw Back to topic_category_module
1def map_category_id(category_id: str) -> str:2    """3    Maps YouTube categoryId to a readable category name.4    Reference: https://gist.github.com/dcreager/883915    """6    mapping = {7        "1": "film & animation",8        "2": "autos & vehicles",9        "10": "music",10        "15": "pets & animals",11        "17": "sports",12        "18": "short movies",13        "19": "travel & events",14        "20": "gaming",15        "21": "videoblogging",16        "22": "vlog", # People & Blogs17        "23": "comedy",18        "24": "entertainment",19        "25": "news & politics",20        "26": "howto & style",21        "27": "educational",22        "28": "science & technology",23        "29": "nonprofits & activism",24        "30": "movies",25        "31": "anime/animation",26        "32": "action/adventure",27        "33": "classics",28        "34": "comedy",29        "35": "documentary",30        "36": "drama",31        "37": "family",32        "38": "foreign",33        "39": "horror",34        "40": "sci-fi/fantasy",35        "41": "thriller",36        "42": "shorts",37        "43": "shows",38        "44": "trailers"39    }40    41    return mapping.get(category_id, "other")42